Elgg  Version 5.1
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Elgg\Config Class Reference

Public Member Functions

 __construct (array $values=[])
 Constructor. More...
 
 getValues ()
 Get all values. More...
 
 getCookieConfig ()
 Set up and return the cookie configuration array resolved from settings. More...
 
 __get (string $name)
 Get an Elgg configuration value if it's been set or loaded during the boot process. More...
 
 hasValue (string $name)
 Test if we have a set value. More...
 
 getInitialValue (string $name)
 Get a value set at construction time. More...
 
 hasInitialValue (string $name)
 Was a value available at construction time? (From settings.php) More...
 
 isLocked (string $name)
 Is this value locked? More...
 
 __set (string $name, $value)
 Set an Elgg configuration value. More...
 
 __isset (string $name)
 Handle isset() More...
 
 __unset (string $name)
 Handle unset() More...
 
 save (string $name, $value)
 Save a configuration setting to the database. More...
 
 remove (string $name)
 Removes a configuration setting from the database. More...
 

Static Public Member Functions

static factory (string $settings_path= '')
 Build a config from default settings locations. More...
 
static resolvePath (string $settings_path= '')
 Resolve settings path. More...
 

Public Attributes

const ENTITY_TYPES = ['group', 'object', 'site', 'user']
 
const SENSITIVE_PROPERTIES
 

Protected Member Functions

 saveInitialValues (array $values)
 Stores the inital values. More...
 
 wasWarnedLocked (string $name)
 Log a read-only warning if the name is read-only. More...
 

Static Protected Member Functions

static fromFile ($path)
 Build a config from a file. More...
 

Protected Attributes

 $locked_values
 
 $deprecated
 
 $config_defaults
 
 $path_properties
 

Detailed Description

Definition at line 138 of file Config.php.

Constructor & Destructor Documentation

Elgg\Config::__construct ( array  $values = [])

Constructor.

Parameters
array$valuesInitial config values from Env/settings file

Definition at line 282 of file Config.php.

Member Function Documentation

Elgg\Config::__get ( string  $name)

Get an Elgg configuration value if it's been set or loaded during the boot process.

Before ::boot, values from the database will not be present.

Parameters
string$nameName
Returns
mixed null if does not exist

Definition at line 451 of file Config.php.

Elgg\Config::__isset ( string  $name)

Handle isset()

Parameters
string$nameName
Returns
bool

Definition at line 535 of file Config.php.

Elgg\Config::__set ( string  $name,
  $value 
)

Set an Elgg configuration value.

Warning
This does not persist the configuration setting. Use elgg_save_config()
Parameters
string$nameName
mixed$valueValue
Returns
void

Definition at line 517 of file Config.php.

Elgg\Config::__unset ( string  $name)

Handle unset()

Parameters
string$nameName
Returns
void

Definition at line 545 of file Config.php.

static Elgg\Config::factory ( string  $settings_path = '')
static

Build a config from default settings locations.

Parameters
string$settings_pathPath of settings file
Returns
Config

Definition at line 314 of file Config.php.

static Elgg\Config::fromFile (   $path)
staticprotected

Build a config from a file.

Parameters
string$pathPath of settings.php
Returns
Config
Exceptions
ConfigurationException

Definition at line 328 of file Config.php.

Elgg\Config::getCookieConfig ( )

Set up and return the cookie configuration array resolved from settings.

Returns
array

Definition at line 408 of file Config.php.

Elgg\Config::getInitialValue ( string  $name)

Get a value set at construction time.

Parameters
string$nameName
Returns
mixed null = not set

Definition at line 481 of file Config.php.

Elgg\Config::getValues ( )

Get all values.

Returns
array

Definition at line 399 of file Config.php.

Elgg\Config::hasInitialValue ( string  $name)

Was a value available at construction time? (From settings.php)

Parameters
string$nameName
Returns
bool

Definition at line 492 of file Config.php.

Elgg\Config::hasValue ( string  $name)

Test if we have a set value.

Parameters
string$nameName
Returns
bool

Definition at line 471 of file Config.php.

Elgg\Config::isLocked ( string  $name)

Is this value locked?

Parameters
string$nameName
Returns
bool

Definition at line 503 of file Config.php.

Elgg\Config::remove ( string  $name)

Removes a configuration setting from the database.

Parameters
string$nameConfiguration name
Returns
bool

Definition at line 590 of file Config.php.

static Elgg\Config::resolvePath ( string  $settings_path = '')
static

Resolve settings path.

Parameters
string$settings_pathPath of settings file
Returns
string

Definition at line 386 of file Config.php.

Elgg\Config::save ( string  $name,
  $value 
)

Save a configuration setting to the database.

Parameters
string$nameName (cannot be greater than 255 characters)
mixed$valueValue
Returns
bool

Definition at line 561 of file Config.php.

Elgg\Config::saveInitialValues ( array  $values)
protected

Stores the inital values.

Parameters
array$valuesThe initial values
Returns
void

Definition at line 298 of file Config.php.

Elgg\Config::wasWarnedLocked ( string  $name)
protected

Log a read-only warning if the name is read-only.

Parameters
string$nameName
Returns
bool

Definition at line 608 of file Config.php.

Member Data Documentation

Elgg\Config::$config_defaults
protected
Initial value:
= [
'allow_phpinfo' => false

Definition at line 189 of file Config.php.

Elgg\Config::$deprecated
protected
Initial value:
= [
]

Definition at line 181 of file Config.php.

Elgg\Config::$locked_values
protected
Initial value:
= [
'assetroot',
'cacheroot',
'dataroot',
'installed',
'plugins_path',
'wwwroot',
]

Definition at line 167 of file Config.php.

Elgg\Config::$path_properties
protected
Initial value:
= [
'dataroot',
'cacheroot',
'assetroot',
]

Definition at line 249 of file Config.php.

const Elgg\Config::ENTITY_TYPES = ['group', 'object', 'site', 'user']

Definition at line 260 of file Config.php.

const Elgg\Config::SENSITIVE_PROPERTIES
Initial value:
= [
'__site_secret__',
'db',
'dbhost',
'dbport',
'dbuser',
'dbpass',
'dbname',
]

Definition at line 267 of file Config.php.


The documentation for this class was generated from the following file: