The Hubzilla
 All Classes Namespaces Files Functions Variables Pages
Zotlabs\Lib\Config Class Reference

Static Public Member Functions

static Load ($family)
 Loads the hub's configuration from database to a cached storage. More...
 
static Set ($family, $key, $value)
 Sets a configuration value for the hub. More...
 
static Get ($family, $key, $default=false)
 Get a particular config variable given the category name ($family) and a key. More...
 
static Delete ($family, $key)
 Deletes the given key from the hub's configuration database. More...
 

Static Private Member Functions

static get_from_storage ($family, $key)
 Returns a value directly from the database configuration storage. More...
 

Member Function Documentation

static Zotlabs\Lib\Config::Delete (   $family,
  $key 
)
static

Deletes the given key from the hub's configuration database.

Removes the configured value from the stored cache in App::$config[$family] and removes it from the database.

Parameters
string$familyThe category of the configuration value
string$keyThe configuration key to delete
Returns
mixed

Referenced by del_config().

static Zotlabs\Lib\Config::Get (   $family,
  $key,
  $default = false 
)
static

Get a particular config variable given the category name ($family) and a key.

Get a particular config variable from the given category ($family) and the $key from a cached storage in App::$config[$family]. If a key is found in the DB but does not exist in local config cache, pull it into the cache so we do not have to hit the DB again for this item.

Returns false if not set.

Parameters
string$familyThe category of the configuration value
string$keyThe configuration key to query
string$default(optional) default false
Returns
mixed Return value or false on error or if not set

Referenced by get_config().

static Zotlabs\Lib\Config::get_from_storage (   $family,
  $key 
)
staticprivate

Returns a value directly from the database configuration storage.

This function queries directly the database and bypasses the chached storage from get_config($family, $key).

Parameters
string$familyThe category of the configuration value
string$keyThe configuration key to query
Returns
mixed
static Zotlabs\Lib\Config::Load (   $family)
static

Loads the hub's configuration from database to a cached storage.

Retrieve a category ($family) of config variables from database to a cached storage in the global App::$config[$family].

Parameters
string$familyThe category of the configuration value

Referenced by Zotlabs\Lib\DB_Upgrade\__construct(), and load_config().

static Zotlabs\Lib\Config::Set (   $family,
  $key,
  $value 
)
static

Sets a configuration value for the hub.

Stores a config value ($value) in the category ($family) under the key ($key).

Parameters
string$familyThe category of the configuration value
string$keyThe configuration key to set
mixed$valueThe value to store in the configuration
Returns
mixed Return the set value, or false if the database update failed

Referenced by set_config().


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