|
Open Journal Systems
3.3.0
|
Public Member Functions | |
| __construct ($context, $cacheId, $fallback) | |
| close () | |
| flush () | |
| get ($id) | |
| getCache ($id) | |
| getCacheId () | |
| getCacheTime () | |
| getContext () | |
| set ($id, $value) | |
| setCache ($id, $value) | |
| setEntireCache ($contents) | |
Data Fields | |
| $cacheId | |
| $cacheMiss | |
| $context | |
| $fallback | |
Provides implementation-independent caching. Although this class is intended to be overridden with a more specific implementation, it can be used as the null cache.
Definition at line 23 of file GenericCache.inc.php.
| GenericCache::__construct | ( | $context, | |
| $cacheId, | |||
| $fallback | |||
| ) |
Instantiate a cache.
Reimplemented in APCCache, and XCacheCache.
Definition at line 50 of file GenericCache.inc.php.
| GenericCache::close | ( | ) |
Close the cache. (Optionally overridden by subclasses.)
Reimplemented in MemcacheCache.
Definition at line 115 of file GenericCache.inc.php.
| GenericCache::flush | ( | ) |
Flush the cache.
Reimplemented in MemcacheCache, APCCache, and XCacheCache.
Definition at line 79 of file GenericCache.inc.php.
Referenced by setEntireCache().
| GenericCache::get | ( | $id | ) |
Get an object from cache, using the fallback if necessary.
Definition at line 60 of file GenericCache.inc.php.
References getCache().
| GenericCache::getCache | ( | $id | ) |
Get an object from the cache. This function should be overridden by subclasses.
| $id |
Reimplemented in MemcacheCache, XCacheCache, and APCCache.
Definition at line 99 of file GenericCache.inc.php.
References $cacheMiss.
Referenced by get().
| GenericCache::getCacheId | ( | ) |
Get the cache ID within its context
Definition at line 128 of file GenericCache.inc.php.
References $cacheId.
Referenced by XCacheCache\flush(), APCCache\flush(), APCCache\getCache(), XCacheCache\getCache(), MemcacheCache\getCache(), APCCache\setCache(), and XCacheCache\setCache().
| GenericCache::getCacheTime | ( | ) |
Get the time at which the data was cached.
Reimplemented in MemcacheCache, APCCache, and XCacheCache.
Definition at line 135 of file GenericCache.inc.php.
| GenericCache::getContext | ( | ) |
Get the context.
Definition at line 121 of file GenericCache.inc.php.
References $context.
Referenced by XCacheCache\flush(), APCCache\flush(), APCCache\getCache(), XCacheCache\getCache(), MemcacheCache\getCache(), APCCache\setCache(), and XCacheCache\setCache().
| GenericCache::set | ( | $id, | |
| $value | |||
| ) |
Set an object in the cache. This function should be overridden by subclasses.
Definition at line 72 of file GenericCache.inc.php.
References setCache().
| GenericCache::setCache | ( | $id, | |
| $value | |||
| ) |
Set an object in the cache. This function should be overridden by subclasses.
| $id | |
| $value |
Reimplemented in MemcacheCache, XCacheCache, and APCCache.
Definition at line 109 of file GenericCache.inc.php.
Referenced by set(), and setEntireCache().
| GenericCache::setEntireCache | ( | $contents | ) |
Set the entire contents of the cache. May (should) be overridden by subclasses.
| $array | array of id -> value pairs |
Reimplemented in MemcacheCache, APCCache, and XCacheCache.
Definition at line 87 of file GenericCache.inc.php.
References flush(), and setCache().
| GenericCache::$cacheId |
The ID of this particular cache within the context
Definition at line 33 of file GenericCache.inc.php.
Referenced by XCacheCache\__construct(), APCCache\__construct(), MemcacheCache\__construct(), __construct(), and getCacheId().
| GenericCache::$cacheMiss |
Definition at line 35 of file GenericCache.inc.php.
Referenced by APCCache\getCache(), XCacheCache\getCache(), MemcacheCache\getCache(), and getCache().
| GenericCache::$context |
The unique string identifying the context of this cache. Must be suitable for a filename.
Definition at line 28 of file GenericCache.inc.php.
Referenced by XCacheCache\__construct(), APCCache\__construct(), MemcacheCache\__construct(), __construct(), and getContext().
| GenericCache::$fallback |
The getter fallback callback (for a cache miss) This function is called with two parameters:
Definition at line 45 of file GenericCache.inc.php.
Referenced by XCacheCache\__construct(), APCCache\__construct(), MemcacheCache\__construct(), and __construct().