engine/lib/configuration.php File Reference

Go to the source code of this file.

Namespaces

namespace  Elgg::Core
 

Activate a plugin or plugins.


Functions

 elgg_get_site_url ($site_guid=0)
 Get the URL for the current (or specified) site.
 elgg_get_plugins_path ()
 Get the plugin path for this installation.
 elgg_get_data_path ()
 Get the data directory path for this installation.
 elgg_get_root_path ()
 Get the root directory path for this installation.
 elgg_get_config ($name, $site_guid=0)
 Get an Elgg configuration value.
 elgg_set_config ($name, $value)
 Set an Elgg configuration value.
 elgg_save_config ($name, $value, $site_guid=0)
 Save a configuration setting.
 verify_installation ()
 Check that installation has completed and the database is populated.
 datalist_get ($name)
 Get the value of a datalist element.
 datalist_set ($name, $value)
 Set the value for a datalist element.
 run_function_once ($functionname, $timelastupdatedcheck=0)
 Run a function one time per installation.
 unset_config ($name, $site_guid=0)
 Removes a config setting.
 set_config ($name, $value, $site_guid=0)
 Add or update a config setting.
 get_config ($name, $site_guid=0)
 Gets a configuration value.
 get_all_config ($site_guid=0)
 Loads all configuration values from the dbprefix_config table into $CONFIG.
 _elgg_load_site_config ()
 Loads configuration related to this site.
 _elgg_load_application_config ()
 Loads configuration related to Elgg as an application.

Variables

 $DATALIST_CACHE = array()
 An array of key value pairs from the datalists table.

Function Documentation

_elgg_load_application_config (  ) 

Loads configuration related to Elgg as an application.

This loads from the datalists database table private

Definition at line 578 of file configuration.php.

_elgg_load_site_config (  ) 

Loads configuration related to this site.

This loads from the config database table and the site entity private

Definition at line 551 of file configuration.php.

datalist_get ( name  ) 

Get the value of a datalist element.

Definition at line 226 of file configuration.php.

datalist_set ( name,
value 
)

Set the value for a datalist element.

Parameters:
string $name The name of the datalist
string $value The new value
Returns:
bool private

Definition at line 287 of file configuration.php.

elgg_get_config ( name,
site_guid = 0 
)

Get an Elgg configuration value.

Parameters:
string $name Name of the configuration value
int $site_guid NULL for installation setting, 0 for default site
Returns:
mixed Configuration value or null if it does not exist
Since:
1.8.0

Definition at line 86 of file configuration.php.

elgg_get_data_path (  ) 

Get the data directory path for this installation.

Returns:
string
Since:
1.8.0

Definition at line 61 of file configuration.php.

elgg_get_plugins_path (  ) 

Get the plugin path for this installation.

Returns:
string
Since:
1.8.0

Definition at line 50 of file configuration.php.

elgg_get_root_path (  ) 

Get the root directory path for this installation.

Returns:
string
Since:
1.8.0

Definition at line 72 of file configuration.php.

elgg_get_site_url ( site_guid = 0  ) 

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

Parameters:
int $site_guid The GUID of the site whose URL we want to grab
Returns:
string
Since:
1.8.0

Definition at line 28 of file configuration.php.

elgg_save_config ( name,
value,
site_guid = 0 
)

Save a configuration setting.

Parameters:
string $name Configuration name (cannot be greater than 255 characters)
mixed $value Configuration value. Should be string for installation setting
int $site_guid NULL for installation setting, 0 for default site
Returns:
bool
Since:
1.8.0

Definition at line 149 of file configuration.php.

elgg_set_config ( name,
value 
)

Set an Elgg configuration value.

Warning:
This does not persist the configuration setting. Use elgg_save_config()
Parameters:
string $name Name of the configuration value
mixed $value Value
Returns:
void
Since:
1.8.0

Definition at line 131 of file configuration.php.

get_all_config ( site_guid = 0  ) 

Loads all configuration values from the dbprefix_config table into $CONFIG.

Parameters:
int $site_guid Optionally, the GUID of the site (current site is assumed by default)
Returns:
bool private

Definition at line 524 of file configuration.php.

get_config ( name,
site_guid = 0 
)

Gets a configuration value.

Definition at line 460 of file configuration.php.

run_function_once ( functionname,
timelastupdatedcheck = 0 
)

Run a function one time per installation.

If you pass a timestamp as the second argument, it will run the function only if (i) it has never been run before or (ii) the timestamp is >= the last time it was run.

Warning:
Functions are determined by their name. If you change the name of a function it will be run again.

Use $timelastupdatedcheck in your plugins init function to perform automated upgrades. Schedule a function to run once and pass the timestamp of the new release. This will cause the run once function to be run on all installations. To perform additional upgrades, create new functions for each release.

Warning:
The function name cannot be longer than 255 characters long due to the current schema for the datalist table.

Definition at line 347 of file configuration.php.

set_config ( name,
value,
site_guid = 0 
)

Add or update a config setting.

If the config name already exists, it will be updated to the new value.

Definition at line 418 of file configuration.php.

unset_config ( name,
site_guid = 0 
)

Removes a config setting.

Definition at line 381 of file configuration.php.

verify_installation (  ) 

Check that installation has completed and the database is populated.

Exceptions:
InstallationException|DatabaseException 
Returns:
void private

Definition at line 181 of file configuration.php.


Variable Documentation

$DATALIST_CACHE = array()

An array of key value pairs from the datalists table.

Used as a cache in datalist functions.

array $DATALIST_CACHE

Definition at line 213 of file configuration.php.

 All Classes Namespaces Files Functions Variables Enumerations
Generated on Sun May 19 00:01:33 2013 for Elgg by  doxygen 1.6.3