aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/cache.php16
-rw-r--r--engine/lib/configuration.php8
-rw-r--r--engine/lib/upgrades/2012012100-1.8.3-system_cache-93100e7d55a24a11.php13
3 files changed, 25 insertions, 12 deletions
diff --git a/engine/lib/cache.php b/engine/lib/cache.php
index b563f5ab0..75183d23a 100644
--- a/engine/lib/cache.php
+++ b/engine/lib/cache.php
@@ -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();
}
diff --git a/engine/lib/configuration.php b/engine/lib/configuration.php
index cccd69105..772c24930 100644
--- a/engine/lib/configuration.php
+++ b/engine/lib/configuration.php
@@ -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
index 000000000..3a9aae2a1
--- /dev/null
+++ b/engine/lib/upgrades/2012012100-1.8.3-system_cache-93100e7d55a24a11.php
@@ -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);