$sysplugins
$sysplugins : array
resource types provided by the core
MySQL CacheResource CacheResource Implementation based on the Custom API to use MySQL as the storage resource for Smarty's output caching.
Table definition:
CREATE TABLE IF NOT EXISTS `output_cache` ( `id` CHAR(40) NOT NULL COMMENT 'sha1 hash', `name` VARCHAR(250) NOT NULL, `cache_id` VARCHAR(250) NULL DEFAULT NULL, `compile_id` VARCHAR(250) NULL DEFAULT NULL, `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `content` LONGTEXT NOT NULL, PRIMARY KEY (`id`), INDEX(`name`), INDEX(`cache_id`), INDEX(`compile_id`), INDEX(`modified`) ) ENGINE = InnoDB;
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
fetch(string $id, string $name, string $cache_id, string $compile_id, string $content, integer $mtime) : void
fetch cached content and its modification time from data source
string | $id | unique cache content identifier |
string | $name | template name |
string | $cache_id | cache id |
string | $compile_id | compile id |
string | $content | cached content |
integer | $mtime | cache modification timestamp (epoch) |
fetchTimestamp(string $id, string $name, string $cache_id, string $compile_id) : integer|boolean
Fetch cached content's modification timestamp from data source
Only implement it if modification times can be accessed faster than loading the complete cached content.}}
string | $id | unique cache content identifier |
string | $name | template name |
string | $cache_id | cache id |
string | $compile_id | compile id |
timestamp (epoch) the template was modified, or false if not found
save(string $id, string $name, string $cache_id, string $compile_id, integer|null $exp_time, string $content) : boolean
Save content to cache
string | $id | unique cache content identifier |
string | $name | template name |
string | $cache_id | cache id |
string | $compile_id | compile id |
integer|null | $exp_time | seconds till expiration time in seconds or null |
string | $content | content to cache |
success
delete(string $name, string $cache_id, string $compile_id, integer|null $exp_time) : integer
Delete content from cache
string | $name | template name |
string | $cache_id | cache id |
string | $compile_id | compile id |
integer|null | $exp_time | seconds till expiration or null |
number of deleted caches