]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4180 finished conversion to system cache by converting datalist/CONFIG var...
authorCash Costello <cash.costello@gmail.com>
Sat, 21 Jan 2012 17:44:55 +0000 (12:44 -0500)
committerCash Costello <cash.costello@gmail.com>
Sat, 21 Jan 2012 17:44:55 +0000 (12:44 -0500)
documentation/info/config.php
engine/lib/cache.php
engine/lib/configuration.php
engine/lib/upgrades/2012012100-1.8.3-system_cache-93100e7d55a24a11.php [new file with mode: 0644]
install/ElggInstaller.php
mod/developers/views/default/admin/developers/settings.php
version.php
views/default/forms/admin/site/update_advanced.php

index 19e76c8aeb39d826848b0fc0ce93005ec999d16e..b454284777ff36c15e7d75e1bda640195e7df0dd 100644 (file)
@@ -218,11 +218,11 @@ $CONFIG->dataroot;
 $CONFIG->simplecache_enabled;
 
 /**
- * Is view paths cache enabled
+ * Is the system cache enabled
  *
- * @global string $CONFIG->viewpath_cache_enabled
+ * @global string $CONFIG->system_cache_enabled
  */
-$CONFIG->viewpath_cache_enabled;
+$CONFIG->system_cache_enabled;
 
 /**
  * The site description from the current site object.
index b563f5ab0eac2b996eba5bac02698ebe9ddd4386..75183d23a1b1e9529e8c55ed352af193d65b250a 100644 (file)
@@ -54,7 +54,7 @@ function elgg_reset_system_cache() {
 function elgg_save_system_cache($type, $data) {
        global $CONFIG;
 
-       if ($CONFIG->viewpath_cache_enabled) {
+       if ($CONFIG->system_cache_enabled) {
                $cache = elgg_get_system_cache();
                return $cache->save($type, $data);
        }
@@ -71,7 +71,7 @@ function elgg_save_system_cache($type, $data) {
 function elgg_load_system_cache($type) {
        global $CONFIG;
 
-       if ($CONFIG->viewpath_cache_enabled) {
+       if ($CONFIG->system_cache_enabled) {
                $cache = elgg_get_system_cache();
                $cached_data = $cache->load($type);
 
@@ -86,7 +86,7 @@ function elgg_load_system_cache($type) {
 /**
  * Enables the system disk cache.
  *
- * Uses the 'viewpath_cache_enabled' datalist with a boolean value.
+ * Uses the 'system_cache_enabled' datalist with a boolean value.
  * Resets the system cache.
  *
  * @return void
@@ -94,15 +94,15 @@ function elgg_load_system_cache($type) {
 function elgg_enable_system_cache() {
        global $CONFIG;
 
-       datalist_set('viewpath_cache_enabled', 1);
-       $CONFIG->viewpath_cache_enabled = 1;
+       datalist_set('system_cache_enabled', 1);
+       $CONFIG->system_cache_enabled = 1;
        elgg_reset_system_cache();
 }
 
 /**
  * Disables the system disk cache.
  *
- * Uses the 'viewpath_cache_enabled' datalist with a boolean value.
+ * Uses the 'system_cache_enabled' datalist with a boolean value.
  * Resets the system cache.
  *
  * @return void
@@ -110,8 +110,8 @@ function elgg_enable_system_cache() {
 function elgg_disable_system_cache() {
        global $CONFIG;
 
-       datalist_set('viewpath_cache_enabled', 0);
-       $CONFIG->viewpath_cache_enabled = 0;
+       datalist_set('system_cache_enabled', 0);
+       $CONFIG->system_cache_enabled = 0;
        elgg_reset_system_cache();
 }
 
index cccd69105b5559bfdb865a9645dec6c86098fb8e..772c24930449f42a65bcb349c9bba443373c4098 100644 (file)
@@ -599,11 +599,11 @@ function _elgg_load_application_config() {
        } else {
                $CONFIG->simplecache_enabled = 1;
        }
-       $viewpath_cache_enabled = datalist_get('viewpath_cache_enabled');
-       if ($viewpath_cache_enabled !== false) {
-               $CONFIG->viewpath_cache_enabled = $viewpath_cache_enabled;
+       $system_cache_enabled = datalist_get('system_cache_enabled');
+       if ($system_cache_enabled !== false) {
+               $CONFIG->system_cache_enabled = $system_cache_enabled;
        } else {
-               $CONFIG->viewpath_cache_enabled = 1;
+               $CONFIG->system_cache_enabled = 1;
        }
 
        // initialize context here so it is set before the get_input call
diff --git a/engine/lib/upgrades/2012012100-1.8.3-system_cache-93100e7d55a24a11.php b/engine/lib/upgrades/2012012100-1.8.3-system_cache-93100e7d55a24a11.php
new file mode 100644 (file)
index 0000000..3a9aae2
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Elgg 1.8.3 upgrade 2012012100
+ * system_cache
+ *
+ * Convert viewpath cache to system cache
+ */
+
+$value = datalist_get('viewpath_cache_enabled');
+datalist_set('system_cache_enabled', $value);
+
+$query = "DELETE FROM {$CONFIG->dbprefix}datalists WHERE name='viewpath_cache_enabled'";
+delete_data($query);
index d556ba74426137b48a2c302129dacf79433e647c..0e75ed008bcf7fa54c3a0a99fa4ac537788b0a0f 100644 (file)
@@ -1401,7 +1401,7 @@ class ElggInstaller {
                datalist_set('default_site', $site->getGUID());
                datalist_set('version', get_version());
                datalist_set('simplecache_enabled', 1);
-               datalist_set('viewpath_cache_enabled', 1);
+               datalist_set('system_cache_enabled', 1);
 
                // new installations have run all the upgrades
                $upgrades = elgg_get_upgrade_files($submissionVars['path'] . 'engine/lib/upgrades/');
index 519364fe1c1a2105b8dd275a6d94a5cf8bb49d14..459cbabada566bb76dae2b3320f7523052557eb2 100644 (file)
@@ -13,7 +13,7 @@ $data = array(
        'system_cache' => array(
                'type' => 'checkbox',
                'value' => 1,
-               'checked' => elgg_get_config('viewpath_cache_enabled') == 1,
+               'checked' => elgg_get_config('system_cache_enabled') == 1,
        ),
 
        'display_errors' => array(
index 540fecac6f7bdb4a9f5121adfecce72bb0c1d561..dc6897c1843a454c52d91f0d2c14e6116ffbacca 100644 (file)
@@ -11,7 +11,7 @@
 
 // YYYYMMDD = Elgg Date
 // XX = Interim incrementer
-$version = 2012012000;
+$version = 2012012100;
 
 // Human-friendly version name
 $release = '1.8.3';
index 786feb10166ba336bef6dd19d1a98d2916a81c34..b935090f08b3d85ecefb3c3789c335b7c50592e4 100644 (file)
@@ -44,7 +44,7 @@ $form_body .= "<div>" . elgg_echo('installation:systemcache:description') . "<br
 $form_body .= elgg_view("input/checkboxes", array(
        'options' => array(elgg_echo('installation:systemcache:label') => elgg_echo('installation:systemcache:label')),
        'name' => 'system_cache_enabled',
-       'value' => (elgg_get_config('viewpath_cache_enabled') ? elgg_echo('installation:systemcache:label') : ""),
+       'value' => (elgg_get_config('system_cache_enabled') ? elgg_echo('installation:systemcache:label') : ""),
 )) . "</div>";
 
 $debug_options = array('0' => elgg_echo('installation:debug:none'), 'ERROR' => elgg_echo('installation:debug:error'), 'WARNING' => elgg_echo('installation:debug:warning'), 'NOTICE' => elgg_echo('installation:debug:notice'));