diff options
author | cash <cash.costello@gmail.com> | 2012-02-04 13:05:31 -0500 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2012-02-04 13:05:31 -0500 |
commit | 601ec5ccf5eb6940ca468b31e1b400412697c8cb (patch) | |
tree | 639b9d1d3591d61c86808a60fe354bce811ce52e /engine/lib/cache.php | |
parent | 76d089fe3662a7051258d6d1843a1167ea8017b1 (diff) | |
parent | 06ba6ccfb8bb5a8da8464d8f86454b468744c9cc (diff) | |
download | elgg-601ec5ccf5eb6940ca468b31e1b400412697c8cb.tar.gz elgg-601ec5ccf5eb6940ca468b31e1b400412697c8cb.tar.bz2 |
Merge pull request #156 from cash/cache_lang
Fixes #2877 Adds language string caching to system cache
Diffstat (limited to 'engine/lib/cache.php')
-rw-r--r-- | engine/lib/cache.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/engine/lib/cache.php b/engine/lib/cache.php index d4cd6b460..c117b9ec9 100644 --- a/engine/lib/cache.php +++ b/engine/lib/cache.php @@ -35,17 +35,11 @@ function elgg_get_system_cache() { /** * Reset the system cache by deleting the caches * - * @return bool + * @return void */ function elgg_reset_system_cache() { $cache = elgg_get_system_cache(); - - $result = true; - $cache_types = array('view_locations', 'view_types'); - foreach ($cache_types as $type) { - $result = $result && $cache->delete($type); - } - return $result; + $cache->clear(); } /** @@ -446,6 +440,12 @@ function _elgg_cache_init() { elgg_save_system_cache('view_locations', serialize($CONFIG->views->locations)); elgg_save_system_cache('view_types', serialize($CONFIG->view_types)); } + + if ($CONFIG->system_cache_enabled && !$CONFIG->i18n_loaded_from_cache) { + foreach ($CONFIG->translations as $lang => $map) { + elgg_save_system_cache("$lang.php", serialize($map)); + } + } } elgg_register_event_handler('ready', 'system', '_elgg_cache_init'); |