From 32394a4b178c9e580a2d0ab9f7a3bcc35defb40c Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 20 Oct 2010 23:16:46 +0000 Subject: 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 --- engine/lib/views.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'engine/lib/views.php') 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. -- cgit v1.2.3