Elgg  Version 2.3
configuration.php
Go to the documentation of this file.
1 <?php
19 
27 function elgg_get_site_url($site_guid = 0) {
28  return _elgg_services()->config->getSiteUrl($site_guid);
29 }
30 
38  return _elgg_services()->config->getPluginsPath();
39 }
40 
47 function elgg_get_data_path() {
48  return _elgg_services()->config->getDataPath();
49 }
50 
58 function elgg_get_cache_path() {
59  return _elgg_services()->config->getCachePath();
60 }
61 
72 function elgg_get_root_path() {
73  return Directory\Local::root()->getPath('/');
74 }
75 
84  return dirname(__DIR__);
85 }
86 
96 function elgg_get_config($name, $site_guid = 0) {
97  if ($name === 'siteemail') {
98  $msg = 'The config value "siteemail" is deprecated. Use elgg_get_site_entity()->email';
99  elgg_deprecated_notice($msg, '2.1');
100  } else if ($name == 'icon_sizes') {
101  $msg = 'The config value "icon_sizes" is deprecated. Use elgg_get_icon_sizes()';
102  elgg_deprecated_notice($msg, '2.2');
103  }
104 
105  return _elgg_services()->config->get($name, $site_guid);
106 }
107 
120  return _elgg_services()->config->set($name, $value);
121 }
122 
133 function elgg_save_config($name, $value, $site_guid = 0) {
134  return _elgg_services()->config->save($name, $value, $site_guid);
135 }
136 
150 function datalist_get($name) {
151  return _elgg_services()->datalist->get($name);
152 }
153 
172  return _elgg_services()->datalist->set($name, $value);
173 }
174 
202 function run_function_once($functionname, $timelastupdatedcheck = 0) {
203  return _elgg_services()->datalist->runFunctionOnce($functionname, $timelastupdatedcheck);
204 }
205 
220 function unset_config($name, $site_guid = 0) {
221  return _elgg_services()->configTable->remove($name, $site_guid);
222 }
223 
248 function set_config($name, $value, $site_guid = 0) {
249  return _elgg_services()->configTable->set($name, $value, $site_guid);
250 }
251 
268 function get_config($name, $site_guid = 0) {
269  return _elgg_services()->configTable->get($name, $site_guid);
270 }
271 
275 function _elgg_config_test($hook, $type, $tests) {
276  $tests[] = \Elgg\Application::elggDir()->getPath("engine/tests/ElggCoreConfigTest.php");
277  return $tests;
278 }
279 
288 function elgg_get_icon_sizes($entity_type = null, $entity_subtype = null, $type = 'icon') {
289  return _elgg_services()->iconService->getSizes($entity_type, $entity_subtype, $type);
290 }
291 
292 return function(\Elgg\EventsService $events, \Elgg\HooksRegistrationService $hooks) {
293  $hooks->registerHandler('unit_test', 'system', '_elgg_config_test');
294 };
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
if($guid==elgg_get_logged_in_user_guid()) $name
Definition: delete.php:21
unset_config($name, $site_guid=0)
Removes a config setting.
elgg_save_config($name, $value, $site_guid=0)
Save a configuration setting.
elgg_get_icon_sizes($entity_type=null, $entity_subtype=null, $type= 'icon')
Returns a configuration array of icon sizes.
get_config($name, $site_guid=0)
Gets a configuration value.
$value
Definition: longtext.php:42
_elgg_config_test($hook, $type, $tests)
private
elgg_get_cache_path()
Get the cache directory path for this installation.
datalist_get($name)
Get the value of a datalist element.
elgg_set_config($name, $value)
Set an Elgg configuration value.
datalist_set($name, $value)
Set the value for a datalist element.
elgg_get_root_path()
Get the root directory path for this installation.
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
Definition: elgglib.php:1098
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
Definition: autoloader.php:17
run_function_once($functionname, $timelastupdatedcheck=0)
Run a function one time per installation.
static elggDir()
Returns a directory that points to the root of Elgg, but not necessarily the install root...
elgg_get_engine_path()
/path/to/elgg/engine
elgg_get_plugins_path()
Get the plugin path for this installation.
elgg_get_data_path()
Get the data directory path for this installation.
http free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:5
if(!$display_name) $type
Definition: delete.php:27
set_config($name, $value, $site_guid=0)
Add or update a config setting.