Elgg  Version 2.3
Public Member Functions | List of all members
Elgg\Services\Config Interface Reference

Describes an object that manages Elgg configuration values. More...

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

Public Member Functions

 getSiteUrl ($site_guid=0)
 Get the URL for the current (or specified) site. More...
 
 getPluginsPath ()
 Get the plugin path for this installation. More...
 
 getDataPath ()
 Get the data directory path for this installation. More...
 
 getCachePath ()
 Get the cache directory path for this installation. More...
 
 get ($name, $site_guid=0)
 Get an Elgg configuration value, possibly loading it from the DB's config table. More...
 
 getVolatile ($name)
 Get a config value for the current site if it's already loaded. More...
 
 set ($name, $value)
 Set an Elgg configuration value. More...
 
 save ($name, $value, $site_guid=0)
 Save a configuration setting. More...
 
 loadSettingsFile ()
 Merge the settings file into the storage object. More...
 

Detailed Description

Describes an object that manages Elgg configuration values.

Definition at line 7 of file Config.php.

Member Function Documentation

Elgg\Services\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

Implemented in Elgg\Config.

Elgg\Services\Config::getCachePath ( )

Get the cache directory path for this installation.

If not set in settings.php, the data path will be returned.

Returns
string

Implemented in Elgg\Config.

Elgg\Services\Config::getDataPath ( )

Get the data directory path for this installation.

Returns
string

Implemented in Elgg\Config.

Elgg\Services\Config::getPluginsPath ( )

Get the plugin path for this installation.

Returns
string

Implemented in Elgg\Config.

Elgg\Services\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

Implemented in Elgg\Config.

Elgg\Services\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

Implemented in Elgg\Config.

Elgg\Services\Config::loadSettingsFile ( )

Merge the settings file into the storage object.

A particular location can be specified via $CONFIG->Config_file

To skip settings loading, set $CONFIG->Config_file to false

Returns
void

Implemented in Elgg\Config.

Elgg\Services\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

Implemented in Elgg\Config.

Elgg\Services\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

Implemented in Elgg\Config.


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