diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-28 19:17:36 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-28 19:17:36 +0000 |
commit | 7ddd9521b3f3a397da3b0a6b56238d31414eb4be (patch) | |
tree | 6eb6a9a51db5fa0f5d3cc2ec6de29b9e258b12a1 /engine/classes/ElggStaticVariableCache.php | |
parent | bd3484417d170e62bc94e9db81d4ad37e8ddee6a (diff) | |
download | elgg-7ddd9521b3f3a397da3b0a6b56238d31414eb4be.tar.gz elgg-7ddd9521b3f3a397da3b0a6b56238d31414eb4be.tar.bz2 |
Standardized code in all of core, not including language files, tests, or core mods.
git-svn-id: http://code.elgg.org/elgg/trunk@7124 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes/ElggStaticVariableCache.php')
-rw-r--r-- | engine/classes/ElggStaticVariableCache.php | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/engine/classes/ElggStaticVariableCache.php b/engine/classes/ElggStaticVariableCache.php index 85facf7a7..a846ab60f 100644 --- a/engine/classes/ElggStaticVariableCache.php +++ b/engine/classes/ElggStaticVariableCache.php @@ -1,11 +1,11 @@ <?php /** * ElggStaticVariableCache - * Dummy cache which stores values in a static array. Using this makes future replacements to other caching back - * ends (eg memcache) much easier. + * Dummy cache which stores values in a static array. Using this makes future + * replacements to other caching back ends (eg memcache) much easier. * - * @package Elgg - * @subpackage API + * @package Elgg.Core + * @subpackage Cache */ class ElggStaticVariableCache extends ElggSharedMemoryCache { /** @@ -18,15 +18,25 @@ class ElggStaticVariableCache extends ElggSharedMemoryCache { /** * Create the variable cache. * - * This function creates a variable cache in a static variable in memory, optionally with a given namespace (to avoid overlap). + * This function creates a variable cache in a static variable in + * memory, optionally with a given namespace (to avoid overlap). * - * @param string $namespace The namespace for this cache to write to - note, namespaces of the same name are shared! + * @param string $namespace The namespace for this cache to write to + * note, namespaces of the same name are shared! */ function __construct($namespace = 'default') { $this->setNamespace($namespace); $this->clear(); } + /** + * Save a key + * + * @param string $key Name + * @param string $data Value + * + * @return boolean + */ public function save($key, $data) { $namespace = $this->getNamespace(); @@ -35,6 +45,15 @@ class ElggStaticVariableCache extends ElggSharedMemoryCache { return true; } + /** + * Load a key + * + * @param string $key Name + * @param int $offset Offset + * @param int $limit Limit + * + * @return string + */ public function load($key, $offset = 0, $limit = null) { $namespace = $this->getNamespace(); @@ -45,6 +64,13 @@ class ElggStaticVariableCache extends ElggSharedMemoryCache { return false; } + /** + * Invalidate a given key. + * + * @param string $key Name + * + * @return bool + */ public function delete($key) { $namespace = $this->getNamespace(); @@ -53,6 +79,11 @@ class ElggStaticVariableCache extends ElggSharedMemoryCache { return true; } + /** + * This was probably meant to delete everything? + * + * @return void + */ public function clear() { $namespace = $this->getNamespace(); |