Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Functions | Variables
configuration.php File Reference

Go to the source code of this file.

Functions

 elgg_get_site_url ($site_guid=0)
 Get the URL for the current (or specified) site. More...
 
 elgg_get_plugins_path ()
 Get the plugin path for this installation. More...
 
 elgg_get_data_path ()
 Get the data directory path for this installation. More...
 
 elgg_get_cache_path ()
 Get the cache directory path for this installation. More...
 
 elgg_get_root_path ()
 Get the root directory path for this installation. More...
 
 elgg_get_engine_path ()
 /path/to/elgg/engine More...
 
 elgg_get_config ($name, $site_guid=0)
 Get an Elgg configuration value. More...
 
 elgg_set_config ($name, $value)
 Set an Elgg configuration value. More...
 
 elgg_save_config ($name, $value, $site_guid=0)
 Save a configuration setting. More...
 
 datalist_get ($name)
 Get the value of a datalist element. More...
 
 datalist_set ($name, $value)
 Set the value for a datalist element. More...
 
 run_function_once ($functionname, $timelastupdatedcheck=0)
 Run a function one time per installation. More...
 
 unset_config ($name, $site_guid=0)
 Removes a config setting. More...
 
 set_config ($name, $value, $site_guid=0)
 Add or update a config setting. More...
 
 get_config ($name, $site_guid=0)
 Gets a configuration value. More...
 
 _elgg_config_test ($hook, $type, $tests)
 private More...
 
 elgg_get_icon_sizes ($entity_type=null, $entity_subtype=null, $type= 'icon')
 Returns a configuration array of icon sizes. More...
 

Variables

return function (\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks)
 

Function Documentation

_elgg_config_test (   $hook,
  $type,
  $tests 
)

private

Definition at line 275 of file configuration.php.

datalist_get (   $name)

Get the value of a datalist element.

Plugin authors should use elgg_get_config() and pass null for the site GUID.

Definition at line 150 of file configuration.php.

datalist_set (   $name,
  $value 
)

Set the value for a datalist element.

Plugin authors should use elgg_save_config() and pass null for the site GUID.

Warning
Names should be selected so as not to collide with the names for the site config.
Values set through datalist_set() are not available in $CONFIG until next page load.
Parameters
string$nameThe name of the datalist
string$valueThe new value
Returns
bool private

Definition at line 171 of file configuration.php.

elgg_get_cache_path ( )

Get the cache directory path for this installation.

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

Returns
string

Definition at line 58 of file configuration.php.

elgg_get_config (   $name,
  $site_guid = 0 
)

Get an Elgg configuration value.

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
Since
1.8.0

Definition at line 96 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 47 of file configuration.php.

elgg_get_engine_path ( )

/path/to/elgg/engine

No trailing slash

Returns
string

Definition at line 83 of file configuration.php.

elgg_get_icon_sizes (   $entity_type = null,
  $entity_subtype = null,
  $type = 'icon' 
)

Returns a configuration array of icon sizes.

Parameters
string$entity_typeEntity type
string$entity_subtypeEntity subtype
string$typeThe name of the icon. e.g., 'icon', 'cover_photo'
Returns
array

Definition at line 288 of file configuration.php.

elgg_get_plugins_path ( )

Get the plugin path for this installation.

Returns
string
Since
1.8.0

Definition at line 37 of file configuration.php.

elgg_get_root_path ( )

Get the root directory path for this installation.

Note: This is not the same as the Elgg root! In the Elgg 1.x series, Elgg was always at the install root, but as of 2.0, Elgg can be installed as a composer dependency, so you cannot assume that it the install root anymore.

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_guidThe GUID of the site whose URL we want to grab
Returns
string
Since
1.8.0

Definition at line 27 of file configuration.php.

elgg_save_config (   $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
Since
1.8.0

Definition at line 133 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$nameName of the configuration value
mixed$valueValue
Returns
void
Since
1.8.0

Definition at line 119 of file configuration.php.

get_config (   $name,
  $site_guid = 0 
)

Gets a configuration value.

Plugin authors should use elgg_get_config().

Definition at line 268 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 202 of file configuration.php.

set_config (   $name,
  $value,
  $site_guid = 0 
)

Add or update a config setting.

Plugin authors should use elgg_set_config().

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

Warning
Names should be selected so as not to collide with the names for the datalist (application configuration)

Definition at line 248 of file configuration.php.

unset_config (   $name,
  $site_guid = 0 
)

Removes a config setting.

Note
Internal: These settings are stored in the dbprefix_config table and read during system boot into $CONFIG.
Parameters
string$nameThe name of the field.
int$site_guidOptionally, the GUID of the site (default: current site).
Returns
bool Success or failure
See Also
get_config()
set_config()

Definition at line 220 of file configuration.php.

Variable Documentation

Definition at line 292 of file configuration.php.