aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 1b2629a22..5571339cd 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -496,6 +496,21 @@
}
/**
+ * This is a factory function which produces an ElggCache object suitable for caching file load paths.
+ *
+ * TODO: Can this be done in a cleaner way?
+ * TODO: Swap to memcache etc?
+ */
+ function elgg_get_filepath_cache()
+ {
+ global $CONFIG;
+ static $FILE_PATH_CACHE;
+ if (!$FILE_PATH_CACHE) $FILE_PATH_CACHE = new ElggFileCache($CONFIG->dataroot);
+
+ return $FILE_PATH_CACHE;
+ }
+
+ /**
* Internal function for retrieving views used by elgg_view_tree
*
* @param unknown_type $dir