$contents
$contents : array
cache for contents
Memcache CacheResource CacheResource Implementation based on the KeyValueStore API to use memcache as the storage resource for Smarty's output caching.
Note that memcache has a limitation of 256 characters per cache-key. To avoid complications all cache-keys are translated to a sha1 hash.
populate(\Smarty_Template_Cached $cached, \Smarty_Internal_Template $_template) : void
populate Cached Object with meta data from Resource
\Smarty_Template_Cached | $cached | cached object |
\Smarty_Internal_Template | $_template | template object |
populateTimestamp(\Smarty_Template_Cached $cached) : void
populate Cached Object with timestamp and exists from Resource
\Smarty_Template_Cached | $cached |
process(\Smarty_Internal_Template $_template, \Smarty_Template_Cached $cached = null, boolean $update = false) : boolean
Read the cached template and process header
\Smarty_Internal_Template | $_template | template object |
\Smarty_Template_Cached | $cached | cached object |
boolean | $update | flag if called because cache update |
true or false if the cached content does not exist
writeCachedContent(\Smarty_Internal_Template $_template, string $content) : boolean
Write the rendered template output to cache
\Smarty_Internal_Template | $_template | template object |
string | $content | content to cache |
success
readCachedContent(\Smarty_Internal_Template $_template) : string
Read cached template from cache
\Smarty_Internal_Template | $_template | template object |
content
clearAll(\Smarty $smarty, integer $exp_time = null) : integer
Empty cache
\Smarty | $smarty | Smarty object |
integer | $exp_time | expiration time (number of seconds, not timestamp) |
number of cache files deleted
clear(\Smarty $smarty, string $resource_name, string $cache_id, string $compile_id, integer $exp_time) : integer
Empty cache for a specific template
\Smarty | $smarty | Smarty object |
string | $resource_name | template name |
string | $cache_id | cache id |
string | $compile_id | compile id |
integer | $exp_time | expiration time (number of seconds, not timestamp) |
number of cache files deleted
hasLock(\Smarty $smarty, \Smarty_Template_Cached $cached) : boolean
Check is cache is locked for this template
\Smarty | $smarty | |
\Smarty_Template_Cached | $cached |
acquireLock(\Smarty $smarty, \Smarty_Template_Cached $cached) : boolean
Lock cache for this template
\Smarty | $smarty | |
\Smarty_Template_Cached | $cached |
releaseLock(\Smarty $smarty, \Smarty_Template_Cached $cached) : boolean
Unlock cache for this template
\Smarty | $smarty | |
\Smarty_Template_Cached | $cached |
getCachedContent(\Smarty_Internal_Template $_template) : null|string
Return cached content
\Smarty_Internal_Template | $_template | template object |
locked(\Smarty $smarty, \Smarty_Template_Cached $cached) : boolean|null
\Smarty | $smarty | |
\Smarty_Template_Cached | $cached |
load(\Smarty $smarty, string $type = null) : \Smarty_CacheResource
Load Cache Resource Handler
\Smarty | $smarty | Smarty object |
string | $type | name of the cache resource |
Cache Resource Handler
getTemplateUid(\Smarty $smarty, string $resource_name) : string
Get template's unique ID
\Smarty | $smarty | Smarty object |
string | $resource_name | template name |
filepath of cache file
fetch(string $cid, string $resource_name = null, string $cache_id = null, string $compile_id = null, string $content = null, $timestamp = null, string $resource_uid = null) : boolean
Fetch and prepare a cache object.
string | $cid | CacheID to fetch |
string | $resource_name | template name |
string | $cache_id | cache id |
string | $compile_id | compile id |
string | $content | cached content |
$timestamp | ||
string | $resource_uid | resource's uid |
success
invalidate(string $cid = null, string $resource_name = null, string $cache_id = null, string $compile_id = null, string $resource_uid = null) : void
Invalidate CacheID
string | $cid | CacheID |
string | $resource_name | template name |
string | $cache_id | cache id |
string | $compile_id | compile id |
string | $resource_uid | source's uid |
getLatestInvalidationTimestamp(string $cid, string $resource_name = null, string $cache_id = null, string $compile_id = null, string $resource_uid = null) : float
Determine the latest timestamp known to the invalidation chain
string | $cid | CacheID to determine latest invalidation timestamp of |
string | $resource_name | template name |
string | $cache_id | cache id |
string | $compile_id | compile id |
string | $resource_uid | source's filepath |
the microtime the CacheID was invalidated
listInvalidationKeys(string $cid, string $resource_name = null, string $cache_id = null, string $compile_id = null, string $resource_uid = null) : array
Translate a CacheID into the list of applicable InvalidationKeys.
Splits "some|chain|into|an|array" into array( '#clearAll#', 'some', 'some|chain', 'some|chain|into', ... )
string | $cid | CacheID to translate |
string | $resource_name | template name |
string | $cache_id | cache id |
string | $compile_id | compile id |
string | $resource_uid | source's filepath |
list of InvalidationKeys