aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/cache.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-11-04 10:45:40 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-11-04 10:45:40 +0000
commit47b33b9b54610ddf676201acb408bef691c7eac4 (patch)
treeb00c8d264fa0b9cfec9b802ade97a87dfa759baf /engine/lib/cache.php
parente9a37af94c1cb294f561305c94d4e00e0bc49990 (diff)
downloadelgg-47b33b9b54610ddf676201acb408bef691c7eac4.tar.gz
elgg-47b33b9b54610ddf676201acb408bef691c7eac4.tar.bz2
Moved caching to function so it can be easily replaced
git-svn-id: https://code.elgg.org/elgg/trunk@2390 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/cache.php')
-rw-r--r--engine/lib/cache.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/engine/lib/cache.php b/engine/lib/cache.php
index 399552785..7523a0a68 100644
--- a/engine/lib/cache.php
+++ b/engine/lib/cache.php
@@ -167,7 +167,7 @@
*
* @var unknown_type
*/
- private static $__cache;
+ public static $__cache;
/**
* ID of a cache to use.
@@ -385,4 +385,26 @@
}
}
}
+
+
+ /**
+ * A simple function that selects the default caching engine.
+ *
+ * This function provides a central way to get a cache for storing local variables.
+ *
+ * TODO: Do this better & allow plugin overrides.
+ *
+ * @param string $namespace Define which memory space to use.
+ */
+ function select_default_memcache($namespace = "default")
+ {
+ // hook out to the world ? (can't if using as object cache)
+
+ // if nothing then use shared memory cache.
+
+ // TODO: Use memcache if available?
+
+ return new ElggStaticVariableCache($namespace);
+
+ }
?> \ No newline at end of file