Elgg  Version 3.0
update_advanced.php
Go to the documentation of this file.
1 <?php
13 if (!$site) {
14  throw new InstallationException("The system is missing an ElggSite entity!");
15 }
16 if (!($site instanceof ElggSite)) {
17  throw new InstallationException("Passing a non-ElggSite to an ElggSite constructor!");
18 }
19 
20 if (!_elgg_config()->hasInitialValue('simplecache_enabled')) {
21  if ('on' === get_input('simplecache_enabled')) {
23  } else {
25  }
26 }
27 
28 if ('on' === get_input('cache_symlink_enabled')) {
29  if (!_elgg_symlink_cache()) {
30  register_error(elgg_echo('installation:cache_symlink:error'));
31  }
32 }
33 
34 elgg_save_config('simplecache_minify_js', 'on' === get_input('simplecache_minify_js'));
35 elgg_save_config('simplecache_minify_css', 'on' === get_input('simplecache_minify_css'));
36 
37 if ('on' === get_input('system_cache_enabled')) {
39 } else {
41 }
42 
43 elgg_save_config('default_access', (int) get_input('default_access', ACCESS_PRIVATE));
44 
45 $user_default_access = ('on' === get_input('allow_user_default_access'));
46 elgg_save_config('allow_user_default_access', $user_default_access);
47 
48 if (!_elgg_config()->hasInitialValue('debug')) {
49  $debug = get_input('debug');
50  if ($debug) {
51  elgg_save_config('debug', $debug);
52  } else {
53  elgg_remove_config('debug');
54  }
55 }
56 
57 $remove_branding = ('on' === get_input('remove_branding', false));
58 elgg_save_config('remove_branding', $remove_branding);
59 
60 $disable_rss = ('on' === get_input('disable_rss', false));
61 elgg_save_config('disable_rss', $disable_rss);
62 
63 $friendly_time_number_of_days = get_input('friendly_time_number_of_days', 30);
66 }
67 elgg_save_config('friendly_time_number_of_days', (int) $friendly_time_number_of_days);
68 
69 if (!$site->save()) {
70  return elgg_error_response(elgg_echo('admin:configuration:fail'));
71 }
72 
73 return elgg_ok_response('', elgg_echo('admin:configuration:success'));
elgg_enable_system_cache()
Enables the system disk cache.
Definition: cache.php:80
_elgg_symlink_cache()
Symlinks /cache directory to views simplecache directory.
Definition: cache.php:265
elgg_disable_system_cache()
Disables the system disk cache.
Definition: cache.php:92
$disable_rss
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_save_config($name, $value)
Save a configuration setting.
const ACCESS_PRIVATE
Definition: constants.php:12
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
$friendly_time_number_of_days
elgg_error_response($error= '', $forward_url=REFERRER, $status_code=ELGG_HTTP_OK)
Prepare an error response to be returned by a page or an action handler.
if(!_elgg_config() ->hasInitialValue('debug')) $remove_branding
elgg_get_site_entity()
Get the current site entity.
Definition: entities.php:130
elgg_ok_response($content= '', $message= '', $forward_url=null, $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
_elgg_config()
Get the Elgg config service.
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:391
elgg_disable_simplecache()
Disables the simple cache.
Definition: cache.php:175
$user_default_access
elgg_enable_simplecache()
Enables the simple cache.
Definition: cache.php:162
elgg_remove_config($name)
Removes a config setting.