]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
better location for system cache in data directory
authorCash Costello <cash.costello@gmail.com>
Sat, 21 Jan 2012 18:03:47 +0000 (13:03 -0500)
committerCash Costello <cash.costello@gmail.com>
Sat, 21 Jan 2012 18:03:47 +0000 (13:03 -0500)
engine/lib/cache.php
engine/lib/plugins.php

index 75183d23a1b1e9529e8c55ed352af193d65b250a..cfda26e52c1cb223fbb9ebef45b1dc185b37c04b 100644 (file)
@@ -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;
 }
 
 /**
index bbec52c2eb0969dea042ecf49028c6236449e2bf..d9c7b321b870da8da06916b5d01dafdb61420585 100644 (file)
@@ -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));
        }