aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-20 23:16:46 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-20 23:16:46 +0000
commit32394a4b178c9e580a2d0ab9f7a3bcc35defb40c (patch)
treee68e093c9e2a80dffbb263d5f1e32bb4d6792bec /engine
parentaba238f57753f391bb15cf43bc5ff23cb943e470 (diff)
downloadelgg-32394a4b178c9e580a2d0ab9f7a3bcc35defb40c.tar.gz
elgg-32394a4b178c9e580a2d0ab9f7a3bcc35defb40c.tar.bz2
Refs #2410 - merged [7024] into trunk from 1.7 branch
git-svn-id: http://code.elgg.org/elgg/trunk@7109 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/views.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/engine/lib/views.php b/engine/lib/views.php
index 6afcc5b76..cceb71c55 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -545,6 +545,29 @@ function elgg_view_disable_simplecache() {
}
}
+/**
+ * Invalidates all cached views in the simplecache
+ *
+ * @since 1.7.4
+ */
+function elgg_invalidate_simplecache() {
+ global $CONFIG;
+
+ $return = TRUE;
+
+ if ($handle = opendir($CONFIG->dataroot . 'views_simplecache')) {
+ while (false !== ($file = readdir($handle))) {
+ if ($file != "." && $file != "..") {
+ $return = $return && unlink($CONFIG->dataroot.'views_simplecache/'.$file);
+ }
+ }
+ closedir($handle);
+ } else {
+ $return = FALSE;
+ }
+
+ return $return;
+}
/**
* Returns the name of views for in a directory.