aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-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.