170 return _elgg_services()->datalist->runFunctionOnce($functionname, $timelastupdatedcheck);
253 $CONFIG->site_guid = (int)
datalist_get(
'default_site');
254 $CONFIG->site_id = $CONFIG->site_guid;
255 $CONFIG->site =
_elgg_services()->entityTable->get($CONFIG->site_guid,
'site');
256 if (!$CONFIG->site) {
257 throw new \InstallationException(
"Unable to handle this request. This site is not configured or the database is down.");
260 $CONFIG->wwwroot = $CONFIG->site->url;
261 $CONFIG->sitename = $CONFIG->site->name;
262 $CONFIG->sitedescription = $CONFIG->site->description;
263 $CONFIG->siteemail = $CONFIG->site->email;
264 $CONFIG->url = $CONFIG->wwwroot;
269 $CONFIG->site_config_loaded =
true;
271 if (!empty($CONFIG->debug)) {
289 $install_root = str_replace(
"\\",
"/", dirname(dirname(dirname(__FILE__))));
291 'path' =>
"$install_root/",
292 'view_path' =>
"$install_root/views/",
293 'plugins_path' =>
"$install_root/mod/",
297 'viewpath' =>
"$install_root/views/",
298 'pluginspath' =>
"$install_root/mod/",
302 if (empty($CONFIG->$name)) {
308 if (!isset($CONFIG->cookies)) {
309 $CONFIG->cookies = array();
311 if (!isset($CONFIG->cookies[
'session'])) {
312 $CONFIG->cookies[
'session'] = array();
314 $session_defaults = session_get_cookie_params();
315 $session_defaults[
'name'] =
'Elgg';
316 $CONFIG->cookies[
'session'] = array_merge($session_defaults, $CONFIG->cookies[
'session']);
317 if (!isset($CONFIG->cookies[
'remember_me'])) {
318 $CONFIG->cookies[
'remember_me'] = array();
320 $session_defaults[
'name'] =
'elggperm';
321 $session_defaults[
'expire'] = strtotime(
"+30 days");
322 $CONFIG->cookies[
'remember_me'] = array_merge($session_defaults, $CONFIG->cookies[
'remember_me']);
329 if (isset($CONFIG->dataroot)) {
331 $CONFIG->dataroot_in_settings =
true;
337 $CONFIG->dataroot_in_settings =
false;
339 if (isset($CONFIG->simplecache_enabled)) {
340 $CONFIG->simplecache_enabled_in_settings =
true;
342 $simplecache_enabled =
datalist_get(
'simplecache_enabled');
343 if ($simplecache_enabled !==
false) {
344 $CONFIG->simplecache_enabled = $simplecache_enabled;
346 $CONFIG->simplecache_enabled = 1;
348 $CONFIG->simplecache_enabled_in_settings =
false;
351 $system_cache_enabled =
datalist_get(
'system_cache_enabled');
352 if ($system_cache_enabled !==
false) {
353 $CONFIG->system_cache_enabled = $system_cache_enabled;
355 $CONFIG->system_cache_enabled = 1;
359 $CONFIG->lastcache = (int)
datalist_get(
"simplecache_lastupdate");
361 $CONFIG->i18n_loaded_from_cache =
false;
364 $CONFIG->entity_types = array(
'group',
'object',
'site',
'user');
372 $tests[] =
"{$CONFIG->path}engine/tests/ElggCoreConfigTest.php";
377 $hooks->registerHandler(
'unit_test',
'system',
'_elgg_config_test');
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
if($guid==elgg_get_logged_in_user_guid()) $name
unset_config($name, $site_guid=0)
Removes a config setting.
elgg_save_config($name, $value, $site_guid=0)
Save a configuration setting.
sanitise_filepath($path, $append_slash=true)
Sanitise file paths ensuring that they begin and end with slashes etc.
get_config($name, $site_guid=0)
Gets a configuration value.
_elgg_config_test($hook, $type, $tests)
private
_elgg_load_site_config()
Loads configuration related to this site.
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 global
Pointer to the global context.
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
run_function_once($functionname, $timelastupdatedcheck=0)
Run a function one time per installation.
elgg_get_plugins_path()
Get the plugin path for this installation.
is_memcache_available()
Return true if memcache is available and configured.
elgg_get_data_path()
Get the data directory path for this installation.
_elgg_load_application_config()
Loads configuration related to Elgg as an application.
set_config($name, $value, $site_guid=0)
Add or update a config setting.