extends |
Smarty_CacheResource_Custom |
---|
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;
Methods | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
public
|
__construct()
Smarty_CacheResource_Mysql constructor.
|
# | ||||||||||||
protected
|
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
fetch cached content and its modification time from data source Parameters
Implements |
# | ||||||||||||
protected
|
fetchTimestamp(string $id, string $name, string $cache_id, string $compile_id): integer|boolean
Fetch cached content's modification timestamp from data source
Fetch cached content's modification timestamp from data source Parameters
Returnstimestamp (epoch) the template was modified, or false if not found Overrides |
# | ||||||||||||
protected
|
save(string $id, string $name, string $cache_id, string $compile_id, integer|null $exp_time, string $content): boolean
Save content to cache
Save content to cache Parameters
Returnssuccess Implements |
# | ||||||||||||
protected
|
delete(string $name, string $cache_id, string $compile_id, integer|null $exp_time): integer
Delete content from cache
Delete content from cache Parameters
Returnsnumber of deleted caches Implements |
# |
Methods inherited from Smarty_CacheResource_Custom |
---|
populate(), populateTimestamp(), process(), writeCachedContent(), readCachedContent(), clearAll(), clear(), hasLock(), acquireLock(), releaseLock() |
Methods inherited from Smarty_CacheResource |
---|
getCachedContent(), locked(), load() |
Properties | |||
---|---|---|---|
protected
|
PDO
|
$db
|
# |
protected
|
PDOStatement
|
$fetch
|
# |
protected
|
PDOStatement
|
$fetchTimestamp
|
# |
protected
|
PDOStatement
|
$save
|
# |
Properties inherited from Smarty_CacheResource |
---|
$sysplugins |