PHP Class Smarty_CacheResource_Newscoop

Inheritance: extends Smarty_CacheResource_Custom
Show file Open project: sourcefabric/newscoop Class Usage Examples

Public Methods

Method Description
__construct ( )
populateTimestamp ( Smarty_Template_Cached $cached ) : void populate Cached Object with timestamp and exists from Resource
writeCachedContent ( Smarty_Internal_Template $_template, string $content ) : boolean Write the rendered template output to cache

Protected Methods

Method Description
delete ( string $tpl_name, string $cache_id, string $compile_id, integer | null $exp_time ) : integer Delete content from cache
fetch ( string $id, string $tpl_name, string $cache_id, string $compile_id, string &$content, integer &$mtime, integer $cacheLifetime ) : void fetch cached content and its modification time from data source
save ( string $id, string $tpl_name, string $cache_id, string $compile_id, integer | null $exp_time, string $content, array $campsiteVector = [] ) : boolean Save content to cache

Method Details

__construct() public method

public __construct ( )

delete() protected method

Delete content from cache
protected delete ( string $tpl_name, string $cache_id, string $compile_id, integer | null $exp_time ) : integer
$tpl_name string template name
$cache_id string cache id
$compile_id string compile id
$exp_time integer | null seconds till expiration time in seconds or null
return integer number of deleted caches

fetch() protected method

fetch cached content and its modification time from data source
protected fetch ( string $id, string $tpl_name, string $cache_id, string $compile_id, string &$content, integer &$mtime, integer $cacheLifetime ) : void
$id string unique cache content identifier
$tpl_name string template name
$cache_id string cache id
$compile_id string compile id
$content string cached content
$mtime integer cache modification timestamp (epoch)
$cacheLifetime integer cache lifetime in seconds
return void

populateTimestamp() public method

populate Cached Object with timestamp and exists from Resource
public populateTimestamp ( Smarty_Template_Cached $cached ) : void
$cached Smarty_Template_Cached
return void

save() protected method

Save content to cache
protected save ( string $id, string $tpl_name, string $cache_id, string $compile_id, integer | null $exp_time, string $content, array $campsiteVector = [] ) : boolean
$id string unique cache content identifier
$tpl_name string template name
$cache_id string cache id
$compile_id string compile id
$exp_time integer | null seconds till expiration or null
$content string content to cache
$campsiteVector array Newscoop's CampsiteVector for defining which page is being cached
return boolean success

writeCachedContent() public method

Write the rendered template output to cache
public writeCachedContent ( Smarty_Internal_Template $_template, string $content ) : boolean
$_template Smarty_Internal_Template template object
$content string content to cache
return boolean success