aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-04-08 16:05:28 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-04-08 16:05:28 +0000
commit75868f14ba9fd4df6925d03bf614405413800f72 (patch)
tree0aa4e57b6fee5eaab9dc84b7c16389ba0c613177 /engine/lib/elgglib.php
parentf4829462077dff01b34343fee26b97500b2e5139 (diff)
downloadelgg-75868f14ba9fd4df6925d03bf614405413800f72.tar.gz
elgg-75868f14ba9fd4df6925d03bf614405413800f72.tar.bz2
Refs #968 & #946: Tidied filepath cache stuff by placing them in function calls.
git-svn-id: https://code.elgg.org/elgg/trunk@3194 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php52
1 files changed, 36 insertions, 16 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 524fb548a..872e95c56 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -302,18 +302,6 @@
// Start the output buffer, find the requested view file, and execute it
ob_start();
- // Attempt to cache views [EXPERIMENTAL]
- /*if (ob_get_level()==1) {
- $view_hash = elgg_get_viewhash($view, $vars);
- $view_cache = elgg_get_filepath_cache();
- $cached_view = $view_cache->load($view_hash);
-
- if ($cached_view) {
- ob_get_clean();
- return $cached_view;
- }
- }*/
-
foreach($viewlist as $priority => $view) {
$view_location = elgg_get_view_location($view, $viewtype);
@@ -337,10 +325,6 @@
}
- // Cache view [EXPERIMENTAL]
- //if (ob_get_level()==1) // Only cache top level view
- // $view_cache->save($view_hash, $content);
-
// Save the output buffer into the $content variable
$content = ob_get_clean();
@@ -497,6 +481,42 @@
}
/**
+ * Function which resets the file path cache.
+ *
+ */
+ function elgg_filepath_cache_reset()
+ {
+ $cache = elgg_get_filepath_cache();
+ return $cache->delete('view_paths');
+ }
+
+ /**
+ * Saves a filepath cache.
+ *
+ * @param mixed $data
+ */
+ function elgg_filepath_cache_save($data)
+ {
+ $cache = elgg_get_filepath_cache();
+ return $cache->save('view_paths', $data);
+ }
+
+ /**
+ * Retrieve the contents of the filepath cache.
+ *
+ */
+ function elgg_filepath_cache_load()
+ {
+ $cache = elgg_get_filepath_cache();
+ $cached_view_paths = $cache->load('view_paths');
+
+ if ($cached_view_paths)
+ return $cached_view_paths;
+
+ return NULL;
+ }
+
+ /**
* Internal function for retrieving views used by elgg_view_tree
*
* @param unknown_type $dir