aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-01-21 13:03:47 -0500
committerCash Costello <cash.costello@gmail.com>2012-01-21 13:03:47 -0500
commitb466d3e188a001f8d7ede1afbf3927c6dbdeae15 (patch)
tree2a94a7b24561623894d2783156e826cee6cbd1ac
parent19a6962c819dc33a0967dcef56154f6930b52287 (diff)
downloadelgg-b466d3e188a001f8d7ede1afbf3927c6dbdeae15.tar.gz
elgg-b466d3e188a001f8d7ede1afbf3927c6dbdeae15.tar.bz2
better location for system cache in data directory
-rw-r--r--engine/lib/cache.php12
-rw-r--r--engine/lib/plugins.php4
2 files changed, 10 insertions, 6 deletions
diff --git a/engine/lib/cache.php b/engine/lib/cache.php
index 75183d23a..cfda26e52 100644
--- a/engine/lib/cache.php
+++ b/engine/lib/cache.php
@@ -26,7 +26,7 @@ function elgg_get_system_cache() {
static $FILE_PATH_CACHE;
if (!$FILE_PATH_CACHE) {
- $FILE_PATH_CACHE = new ElggFileCache($CONFIG->dataroot);
+ $FILE_PATH_CACHE = new ElggFileCache($CONFIG->dataroot . 'system_cache/');
}
return $FILE_PATH_CACHE;
@@ -39,9 +39,13 @@ function elgg_get_system_cache() {
*/
function elgg_reset_system_cache() {
$cache = elgg_get_system_cache();
- $view_types_result = $cache->delete('view_types');
- $views_result = $cache->delete('views');
- return $view_types_result && $views_result;
+
+ $result = true;
+ $cache_types = array('view_paths', 'view_types');
+ foreach ($cache_types as $type) {
+ $result = $result && $cache->delete($type);
+ }
+ return $result;
}
/**
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index bbec52c2e..d9c7b321b 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -302,7 +302,7 @@ function elgg_load_plugins() {
}
// Load view caches if available
- $cached_view_paths = elgg_load_system_cache('views');
+ $cached_view_paths = elgg_load_system_cache('view_paths');
$cached_view_types = elgg_load_system_cache('view_types');
$cached_view_info = is_string($cached_view_paths) && is_string($cached_view_types);
@@ -334,7 +334,7 @@ function elgg_load_plugins() {
// Cache results
if (!$cached_view_info) {
- elgg_save_system_cache('views', serialize($CONFIG->views));
+ elgg_save_system_cache('view_paths', serialize($CONFIG->views));
elgg_save_system_cache('view_types', serialize($CONFIG->view_types));
}