]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
switched the function names to system cache
authorCash Costello <cash.costello@gmail.com>
Sat, 21 Jan 2012 17:16:53 +0000 (12:16 -0500)
committerCash Costello <cash.costello@gmail.com>
Sat, 21 Jan 2012 17:16:53 +0000 (12:16 -0500)
13 files changed:
actions/admin/plugins/activate.php
actions/admin/plugins/activate_all.php
actions/admin/plugins/deactivate.php
actions/admin/plugins/deactivate_all.php
actions/admin/plugins/set_priority.php
actions/admin/site/flush_cache.php
actions/admin/site/update_advanced.php
engine/lib/cache.php
engine/lib/deprecated-1.8.php
engine/lib/plugins.php
engine/lib/upgrades/2011010101.php
mod/developers/actions/developers/settings.php
upgrade.php

index 224b5a2ae23d79673eb574ba1e1543ba911c52b8..286cf5a4fb1adbed44014e21848bde8fffe2e8bc 100644 (file)
@@ -38,7 +38,7 @@ foreach ($plugin_guids as $guid) {
 // don't regenerate the simplecache because the plugin won't be
 // loaded until next run.  Just invalidate and let it regenerate as needed
 elgg_invalidate_simplecache();
-elgg_filepath_cache_reset();
+elgg_reset_system_cache();
 
 if (count($activated_guids) === 1) {
        $url = 'admin/plugins';
index 19c142346c00070b22373aa4d24f8fa3efa4ebb8..4514ccbdf52be70bf8ff87b1ef3db25205717cd4 100644 (file)
@@ -28,6 +28,6 @@ foreach ($guids as $guid) {
 // don't regenerate the simplecache because the plugin won't be
 // loaded until next run.  Just invalidate and let it regnerate as needed
 elgg_invalidate_simplecache();
-elgg_filepath_cache_reset();
+elgg_reset_system_cache();
 
 forward(REFERER);
\ No newline at end of file
index 2ce796eff728f9f43cb6dc4255e910a34446a4e8..e7ce65625ebaeea64bafb39c8a18fef4abe5660b 100644 (file)
@@ -37,7 +37,7 @@ foreach ($plugin_guids as $guid) {
 // don't regenerate the simplecache because the plugin won't be
 // loaded until next run.  Just invalidate and let it regnerate as needed
 elgg_invalidate_simplecache();
-elgg_filepath_cache_reset();
+elgg_reset_system_cache();
 
 if (count($plugin_guids) == 1) {
        $url = 'admin/plugins';
index 479e9c60775ea52a509b8a9efeb7b9df59de0cf0..8b347a63312132adecc08eb9e09e8992918ac299 100644 (file)
@@ -28,6 +28,6 @@ foreach ($guids as $guid) {
 // don't regenerate the simplecache because the plugin won't be
 // loaded until next run.  Just invalidate and let it regnerate as needed
 elgg_invalidate_simplecache();
-elgg_filepath_cache_reset();
+elgg_reset_system_cache();
 
 forward(REFERER);
index 79b1c4c53430a9947adadb01f359cc7f888a353e..edd735371b2e91ef5164bcbd14ac89c01b367e82 100644 (file)
@@ -34,6 +34,6 @@ if ($plugin->setPriority($priority)) {
 // don't regenerate the simplecache because the plugin won't be
 // loaded until next run.  Just invalidate and let it regnerate as needed
 elgg_invalidate_simplecache();
-elgg_filepath_cache_reset();
+elgg_reset_system_cache();
 
 forward(REFERER);
\ No newline at end of file
index b81f5fc83014a2d20ec68231913938e7b746e83a..ebb8296c710c4980a4694bf54dfccecb6c2ad945 100644 (file)
@@ -4,7 +4,7 @@
  */
 
 elgg_invalidate_simplecache();
-elgg_filepath_cache_reset();
+elgg_reset_system_cache();
 
 system_message(elgg_echo('admin:cache:flushed'));
 forward(REFERER);
\ No newline at end of file
index 12c5542e7c4b7991bdf6799f6284564867306f6f..d4796ea7de7fc46ba44b4f8d90fc94c72035507f 100644 (file)
@@ -26,9 +26,9 @@ if ($site = elgg_get_site_entity()) {
        }
 
        if (get_input('viewpath_cache_enabled')) {
-               elgg_enable_filepath_cache();
+               elgg_enable_system_cache();
        } else {
-               elgg_disable_filepath_cache();
+               elgg_disable_system_cache();
        }
 
        set_config('default_access', get_input('default_access', ACCESS_PRIVATE), $site->getGUID());
index 47c3af73c7efbaf1feed6fffb497cfe569453929..b563f5ab0eac2b996eba5bac02698ebe9ddd4386 100644 (file)
 /* Filepath Cache */
 
 /**
- * Returns an ElggCache object suitable for caching view
- * file load paths to disk under $CONFIG->dataroot.
+ * Returns an ElggCache object suitable for caching system information
  *
  * @todo Can this be done in a cleaner way?
  * @todo Swap to memcache etc?
  *
- * @return ElggFileCache A cache object suitable for caching file load paths.
+ * @return ElggFileCache
  */
-function elgg_get_filepath_cache() {
+function elgg_get_system_cache() {
        global $CONFIG;
 
        /**
@@ -34,29 +33,29 @@ function elgg_get_filepath_cache() {
 }
 
 /**
- * Reset the file path cache.
+ * Reset the system cache by deleting the caches
  *
  * @return bool
  */
-function elgg_filepath_cache_reset() {
-       $cache = elgg_get_filepath_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;
 }
 
 /**
- * Saves a filepath cache.
+ * Saves a system cache.
  *
  * @param string $type The type or identifier of the cache
  * @param string $data The data to be saved
  * @return bool
  */
-function elgg_filepath_cache_save($type, $data) {
+function elgg_save_system_cache($type, $data) {
        global $CONFIG;
 
        if ($CONFIG->viewpath_cache_enabled) {
-               $cache = elgg_get_filepath_cache();
+               $cache = elgg_get_system_cache();
                return $cache->save($type, $data);
        }
 
@@ -64,16 +63,16 @@ function elgg_filepath_cache_save($type, $data) {
 }
 
 /**
- * Retrieve the contents of the filepath cache.
+ * Retrieve the contents of a system cache.
  *
  * @param string $type The type of cache to load
  * @return string
  */
-function elgg_filepath_cache_load($type) {
+function elgg_load_system_cache($type) {
        global $CONFIG;
 
        if ($CONFIG->viewpath_cache_enabled) {
-               $cache = elgg_get_filepath_cache();
+               $cache = elgg_get_system_cache();
                $cached_data = $cache->load($type);
 
                if ($cached_data) {
@@ -85,35 +84,74 @@ function elgg_filepath_cache_load($type) {
 }
 
 /**
- * Enables the views file paths disk cache.
+ * Enables the system disk cache.
  *
  * Uses the 'viewpath_cache_enabled' datalist with a boolean value.
- * Resets the views paths cache.
+ * Resets the system cache.
  *
  * @return void
  */
-function elgg_enable_filepath_cache() {
+function elgg_enable_system_cache() {
        global $CONFIG;
 
        datalist_set('viewpath_cache_enabled', 1);
        $CONFIG->viewpath_cache_enabled = 1;
-       elgg_filepath_cache_reset();
+       elgg_reset_system_cache();
 }
 
 /**
- * Disables the views file paths disk cache.
+ * Disables the system disk cache.
  *
  * Uses the 'viewpath_cache_enabled' datalist with a boolean value.
- * Resets the views paths cache.
+ * Resets the system cache.
  *
  * @return void
  */
-function elgg_disable_filepath_cache() {
+function elgg_disable_system_cache() {
        global $CONFIG;
 
        datalist_set('viewpath_cache_enabled', 0);
        $CONFIG->viewpath_cache_enabled = 0;
-       elgg_filepath_cache_reset();
+       elgg_reset_system_cache();
+}
+
+/** @todo deprecate in Elgg 1.9 **/
+
+/**
+ * @access private
+ */
+function elgg_get_filepath_cache() {
+       return elgg_get_system_cache();
+}
+/**
+ * @access private
+ */
+function elgg_filepath_cache_reset() {
+       return elgg_reset_system_cache();
+}
+/**
+ * @access private
+ */
+function elgg_filepath_cache_save($type, $data) {
+       return elgg_save_system_cache($type, $data);
+}
+/**
+ * @access private
+ */
+function elgg_filepath_cache_load($type) {
+       return elgg_load_system_cache($type);
+}
+/**
+ * @access private
+ */
+function elgg_enable_filepath_cache() {
+       return elgg_enable_system_cache();
+}
+/**
+ * @access private
+ */
+function elgg_disable_filepath_cache() {
+       return elgg_disable_system_cache();
 }
 
 /* Simplecache */
index e1866498b70af96e9843601c698dca7a9caca0d7..4b9d41543fa63a730b432a53b41eaaea3228a5a4 100644 (file)
@@ -1674,7 +1674,7 @@ function get_plugin_list() {
  * otherwise you may experience view display artifacts. Do this with the following code:
  *
  *             elgg_regenerate_simplecache();
- *             elgg_filepath_cache_reset();
+ *             elgg_reset_system_cache();
  *
  * @deprecated 1.8 Use elgg_generate_plugin_entities() and elgg_set_plugin_priorities()
  *
@@ -1841,7 +1841,7 @@ function get_installed_plugins($status = 'all') {
  * otherwise you may experience view display artifacts. Do this with the following code:
  *
  *             elgg_regenerate_simplecache();
- *             elgg_filepath_cache_reset();
+ *             elgg_reset_system_cache();
  *
  * @deprecated 1.8 Use ElggPlugin->activate()
  *
@@ -1882,7 +1882,7 @@ function enable_plugin($plugin, $site_guid = null) {
  * otherwise you may experience view display artifacts. Do this with the following code:
  *
  *             elgg_regenerate_simplecache();
- *             elgg_filepath_cache_reset();
+ *             elgg_reset_system_cache();
  *
  * @deprecated 1.8 Use ElggPlugin->deactivate()
  *
index 7968f4a6ea2f75564a0a2004773cb13ee5f55355..bbec52c2eb0969dea042ecf49028c6236449e2bf 100644 (file)
@@ -302,8 +302,8 @@ function elgg_load_plugins() {
        }
 
        // Load view caches if available
-       $cached_view_paths = elgg_filepath_cache_load('views');
-       $cached_view_types = elgg_filepath_cache_load('view_types');
+       $cached_view_paths = elgg_load_system_cache('views');
+       $cached_view_types = elgg_load_system_cache('view_types');
        $cached_view_info = is_string($cached_view_paths) && is_string($cached_view_types);
 
        if ($cached_view_info) {
@@ -334,8 +334,8 @@ function elgg_load_plugins() {
 
        // Cache results
        if (!$cached_view_info) {
-               elgg_filepath_cache_save('views', serialize($CONFIG->views));
-               elgg_filepath_cache_save('view_types', serialize($CONFIG->view_types));
+               elgg_save_system_cache('views', serialize($CONFIG->views));
+               elgg_save_system_cache('view_types', serialize($CONFIG->view_types));
        }
 
        return $return;
index b063c249bab79a1a4010bcf7085f777666f9acdd..a1ee92622c94cfd88ba8c020d2808483193f5cb1 100644 (file)
@@ -66,7 +66,7 @@ if ($old_enabled_plugins) {
 
 // invalidate caches
 elgg_invalidate_simplecache();
-elgg_filepath_cache_reset();
+elgg_reset_system_cache();
 
 // clean up.
 remove_metadata($site->guid, 'pluginorder');
index 811fd22c00950f2ba061f5f9aa04a441853091f4..6249821a22a5710e167490bc94a9da2b84bbe25c 100644 (file)
@@ -12,9 +12,9 @@ if (get_input('simple_cache')) {
 }
 
 if (get_input('view_path_cache')) {
-       elgg_enable_filepath_cache();
+       elgg_enable_system_cache();
 } else {
-       elgg_disable_filepath_cache();
+       elgg_disable_system_cache();
 }
 
 $debug = get_input('debug_level');
index ab769f54210a463944105a2f1dce1977a8ee91f6..3081f7a775b897abc8106389b78d42234aeb57ad 100644 (file)
@@ -25,7 +25,7 @@ if (get_input('upgrade') == 'upgrade') {
        }
        elgg_trigger_event('upgrade', 'system', null);
        elgg_invalidate_simplecache();
-       elgg_filepath_cache_reset();
+       elgg_reset_system_cache();
 } else {
        // if upgrading from < 1.8.0, check for the core view 'welcome' and bail if it's found.
        // see http://trac.elgg.org/ticket/3064