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

Public Member Functions

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

Static Public Member Functions

static factory ($settings_path= '', $try_env=true)
 Build a config from default settings locations. More...
 
static fromFile ($path, &$reason= '')
 Build a config from a file. More...
 
static resolvePath ($settings_path= '', $try_env=true)
 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 ($name)
 Log a read-only warning if the name is read-only. More...
 

Protected Attributes

 $locked_values
 
 $deprecated
 
 $config_defaults
 
 $path_properties
 

Detailed Description

Definition at line 132 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 286 of file Config.php.

Member Function Documentation

Elgg\Config::__get (   $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 486 of file Config.php.

Elgg\Config::__isset (   $name)

Handle isset()

Parameters
string$nameName
Returns
bool

Definition at line 581 of file Config.php.

Elgg\Config::__set (   $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 563 of file Config.php.

Elgg\Config::__unset (   $name)

Handle unset()

Parameters
string$nameName
Returns
void

Definition at line 591 of file Config.php.

static Elgg\Config::factory (   $settings_path = '',
  $try_env = true 
)
static

Build a config from default settings locations.

Parameters
string$settings_pathPath of settings file
bool$try_envIf path not given, try $_ENV['ELGG_SETTINGS_FILE']
Returns
Config
Exceptions
ConfigurationException

Definition at line 320 of file Config.php.

static Elgg\Config::fromFile (   $path,
$reason = '' 
)
static

Build a config from a file.

Parameters
string$pathPath of settings.php
string$reasonReturned reason for failure
Returns
bool|Config false on failure

Definition at line 342 of file Config.php.

Elgg\Config::getCookieConfig ( )

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

Returns
array

Definition at line 445 of file Config.php.

Elgg\Config::getInitialValue (   $name)

Get a value set at construction time.

Parameters
string$nameName
Returns
mixed null = not set

Definition at line 516 of file Config.php.

Elgg\Config::getValues ( )

Get all values.

Returns
array

Definition at line 436 of file Config.php.

Elgg\Config::hasInitialValue (   $name)

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

Parameters
string$nameName
Returns
bool

Definition at line 527 of file Config.php.

Elgg\Config::hasValue (   $name)

Test if we have a set value.

Parameters
string$nameName
Returns
bool

Definition at line 506 of file Config.php.

Elgg\Config::isLocked (   $name)

Is this value locked?

Parameters
string$nameName
Returns
bool

Definition at line 549 of file Config.php.

Elgg\Config::lock (   $name)

Make a value read-only.

Parameters
string$nameName
Returns
void

Definition at line 538 of file Config.php.

Elgg\Config::mergeValues ( array  $values)

Set an array of values.

Parameters
array$valuesValues
Returns
void

Definition at line 425 of file Config.php.

Elgg\Config::remove (   $name)

Removes a configuration setting from the database.

Parameters
string$nameConfiguration name
Returns
bool

Definition at line 636 of file Config.php.

static Elgg\Config::resolvePath (   $settings_path = '',
  $try_env = true 
)
static

Resolve settings path.

Parameters
string$settings_pathPath of settings file
bool$try_envIf path not given, try $_ENV['ELGG_SETTINGS_FILE']
Returns
string

Definition at line 405 of file Config.php.

Elgg\Config::save (   $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 607 of file Config.php.

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

Stores the inital values.

Parameters
array$valuesThe initial values
Returns
void

Definition at line 302 of file Config.php.

Elgg\Config::wasWarnedLocked (   $name)
protected

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

Parameters
string$nameName
Returns
bool

Definition at line 654 of file Config.php.

Member Data Documentation

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

Definition at line 193 of file Config.php.

Elgg\Config::$deprecated
protected
Initial value:
= [
'elgg_settings_file' => '4.3'

Definition at line 178 of file Config.php.

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

Definition at line 161 of file Config.php.

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

Definition at line 253 of file Config.php.

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

Definition at line 264 of file Config.php.

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

Definition at line 271 of file Config.php.


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