Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | List of all members
Elgg\Config Class Reference

Access to configuration values. More...

Inheritance diagram for Elgg\Config:
Elgg\Services\Config

Public Member Functions

 __construct (\stdClass $config=null, $set_global=true)
 Constructor. More...
 
 getSiteUrl ($site_guid=0)
 {Get the URL for the current (or specified) site.
Parameters
int$site_guidThe GUID of the site whose URL we want to grab
Returns
string
} More...
 
 getPluginsPath ()
 {Get the plugin path for this installation.
Returns
string
} More...
 
 getCookieConfig ()
 Set up and return the cookie configuration array resolved from settings.php. More...
 
 getDataPath ()
 {Get the data directory path for this installation.
Returns
string
} More...
 
 getCachePath ()
 {Get the cache directory path for this installation.If not set in settings.php, the data path will be returned.
Returns
string
} More...
 
 get ($name, $site_guid=0)
 {Get an Elgg configuration value, possibly loading it from the DB's config table.Before application boot, it may be unsafe to call get() for some values. You should use getVolatile() before system boot.
Parameters
string$nameName of the configuration value
int$site_guidnull for installation setting, 0 for default site
Returns
mixed Configuration value or null if it does not exist
} More...
 
 getVolatile ($name)
 {Get a config value for the current site if it's already loaded.This should be used instead of reading directly from global $CONFIG.
Parameters
string$nameName of the configuration value
Returns
mixed Returns null if value isn't set
} More...
 
 set ($name, $value)
 {Set an Elgg configuration value.
Warning
This does not persist the configuration setting. Use elgg_save_config()
Parameters
string$nameName of the configuration value
mixed$valueValue
Returns
void
} More...
 
 save ($name, $value, $site_guid=0)
 {Save a configuration setting.
Parameters
string$nameConfiguration name (cannot be greater than 255 characters)
mixed$valueConfiguration value. Should be string for installation setting
int$site_guidnull for installation setting, 0 for default site
Returns
bool
} More...
 
 loadSettingsFile ()
 {Merge the settings file into the storage object.A particular location can be specified via $CONFIG->Config_fileTo skip settings loading, set $CONFIG->Config_file to false
Returns
void
} More...
 
 getStorageObject ()
 Get the raw object used for storage. More...
 

Detailed Description

Access to configuration values.

Since
1.10.0

Definition at line 11 of file Config.php.

Constructor & Destructor Documentation

Elgg\Config::__construct ( \stdClass  $config = null,
  $set_global = true 
)

Constructor.

Configuration values.

The $CONFIG global contains configuration values required for running Elgg as defined in the settings.php file.

Plugin authors are encouraged to use elgg_get_config() instead of accessing the global directly.

See Also
elgg_get_config()
engine/settings.php $CONFIG

Definition at line 37 of file Config.php.

Member Function Documentation

Elgg\Config::get (   $name,
  $site_guid = 0 
)

{Get an Elgg configuration value, possibly loading it from the DB's config table.Before application boot, it may be unsafe to call get() for some values. You should use getVolatile() before system boot.

Parameters
string$nameName of the configuration value
int$site_guidnull for installation setting, 0 for default site
Returns
mixed Configuration value or null if it does not exist
}

Implements Elgg\Services\Config.

Definition at line 151 of file Config.php.

Elgg\Config::getCachePath ( )

{Get the cache directory path for this installation.If not set in settings.php, the data path will be returned.

Returns
string
}

Implements Elgg\Services\Config.

Definition at line 138 of file Config.php.

Elgg\Config::getCookieConfig ( )

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

Returns
array

Definition at line 93 of file Config.php.

Elgg\Config::getDataPath ( )

{Get the data directory path for this installation.

Returns
string
}

Implements Elgg\Services\Config.

Definition at line 127 of file Config.php.

Elgg\Config::getPluginsPath ( )

{Get the plugin path for this installation.

Returns
string
}

Implements Elgg\Services\Config.

Definition at line 84 of file Config.php.

Elgg\Config::getSiteUrl (   $site_guid = 0)

{Get the URL for the current (or specified) site.

Parameters
int$site_guidThe GUID of the site whose URL we want to grab
Returns
string
}

Implements Elgg\Services\Config.

Definition at line 66 of file Config.php.

Elgg\Config::getStorageObject ( )

Get the raw object used for storage.

We need this, for now, to construct some services.

Definition at line 312 of file Config.php.

Elgg\Config::getVolatile (   $name)

{Get a config value for the current site if it's already loaded.This should be used instead of reading directly from global $CONFIG.

Parameters
string$nameName of the configuration value
Returns
mixed Returns null if value isn't set
}

Implements Elgg\Services\Config.

Definition at line 191 of file Config.php.

Elgg\Config::loadSettingsFile ( )

{Merge the settings file into the storage object.A particular location can be specified via $CONFIG->Config_fileTo skip settings loading, set $CONFIG->Config_file to false

Returns
void
}

Implements Elgg\Services\Config.

Definition at line 236 of file Config.php.

Elgg\Config::save (   $name,
  $value,
  $site_guid = 0 
)

{Save a configuration setting.

Parameters
string$nameConfiguration name (cannot be greater than 255 characters)
mixed$valueConfiguration value. Should be string for installation setting
int$site_guidnull for installation setting, 0 for default site
Returns
bool
}

Implements Elgg\Services\Config.

Definition at line 206 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 of the configuration value
mixed$valueValue
Returns
void
}

Implements Elgg\Services\Config.

Definition at line 198 of file Config.php.


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