PHP Interface Elgg\Services\Config

Datei anzeigen Open project: elgg/elgg

Public Methods

Method Description
get ( string $name ) : mixed Get an Elgg configuration value, possibly loading it from the DB's config table
getCachePath ( ) : string Get the cache directory path for this installation
getDataPath ( ) : string Get the data directory path for this installation
getPluginsPath ( ) : string Get the plugin path for this installation
getSiteUrl ( ) : string Get the URL for the current (or specified) site
getVolatile ( string $name ) : mixed Get a config value for the current site if it's already loaded. This should be used instead of reading directly from global $CONFIG.
loadSettingsFile ( ) : void Merge the settings file into the storage object
remove ( string $name ) : boolean Removes a configuration setting
save ( string $name, mixed $value ) : boolean Save a configuration setting
set ( string $name, mixed $value ) : void Set an Elgg configuration value

Method Details

get() public method

Before application boot, it may be unsafe to call get() for some values. You should use getVolatile() before system boot.
public get ( string $name ) : mixed
$name string Name of the configuration value
return mixed Configuration value or null if it does not exist

getCachePath() public method

If not set in settings.php, the data path will be returned.
public getCachePath ( ) : string
return string

getDataPath() public method

Get the data directory path for this installation
public getDataPath ( ) : string
return string

getPluginsPath() public method

Get the plugin path for this installation
public getPluginsPath ( ) : string
return string

getSiteUrl() public method

Get the URL for the current (or specified) site
public getSiteUrl ( ) : string
return string

getVolatile() public method

Get a config value for the current site if it's already loaded. This should be used instead of reading directly from global $CONFIG.
public getVolatile ( string $name ) : mixed
$name string Name of the configuration value
return mixed Returns null if value isn't set

loadSettingsFile() public method

A particular location can be specified via $CONFIG->Config_file To skip settings loading, set $CONFIG->Config_file to false
public loadSettingsFile ( ) : void
return void

remove() public method

Removes a configuration setting
public remove ( string $name ) : boolean
$name string Configuration name
return boolean

save() public method

Save a configuration setting
public save ( string $name, mixed $value ) : boolean
$name string Configuration name (cannot be greater than 255 characters)
$value mixed Configuration value. Should be string for installation setting
return boolean

set() public method

Set an Elgg configuration value
public set ( string $name, mixed $value ) : void
$name string Name of the configuration value
$value mixed Value
return void