PEEL Shopping
Open source ecommerce : PEEL Shopping
Public Member Functions | Protected Member Functions | Protected Attributes
Smarty_CacheResource_KeyValueStore Class Reference
Inheritance diagram for Smarty_CacheResource_KeyValueStore:
Smarty_CacheResource

Public Member Functions

 populate (Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)
 populate Cached Object with meta data from Resource More...
 
 populateTimestamp (Smarty_Template_Cached $cached)
 populate Cached Object with timestamp and exists from Resource More...
 
 process (Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null)
 Read the cached template and process the header. More...
 
 writeCachedContent (Smarty_Internal_Template $_template, $content)
 Write the rendered template output to cache. More...
 
 clearAll (Smarty $smarty, $exp_time=null)
 Empty cache. More...
 
 clear (Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
 Empty cache for a specific template. More...
 
 hasLock (Smarty $smarty, Smarty_Template_Cached $cached)
 Check is cache is locked for this template. More...
 
 acquireLock (Smarty $smarty, Smarty_Template_Cached $cached)
 Lock cache for this template. More...
 
 releaseLock (Smarty $smarty, Smarty_Template_Cached $cached)
 Unlock cache for this template. More...
 
- Public Member Functions inherited from Smarty_CacheResource
 populate (Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)
 populate Cached Object with meta data from Resource More...
 
 populateTimestamp (Smarty_Template_Cached $cached)
 populate Cached Object with timestamp and exists from Resource More...
 
 process (Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null)
 Read the cached template and process header. More...
 
 writeCachedContent (Smarty_Internal_Template $_template, $content)
 Write the rendered template output to cache. More...
 
 getCachedContent (Smarty_Internal_Template $_template)
 Return cached content. More...
 
 clearAll (Smarty $smarty, $exp_time=null)
 Empty cache. More...
 
 clear (Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
 Empty cache for a specific template. More...
 
 locked (Smarty $smarty, Smarty_Template_Cached $cached)
 
 hasLock (Smarty $smarty, Smarty_Template_Cached $cached)
 
 acquireLock (Smarty $smarty, Smarty_Template_Cached $cached)
 
 releaseLock (Smarty $smarty, Smarty_Template_Cached $cached)
 

Protected Member Functions

 getTemplateUid (Smarty $smarty, $resource_name, $cache_id, $compile_id)
 Get template's unique ID. More...
 
 sanitize ($string)
 Sanitize CacheID components. More...
 
 fetch ($cid, $resource_name=null, $cache_id=null, $compile_id=null, &$content=null, &$timestamp=null, $resource_uid=null)
 Fetch and prepare a cache object. More...
 
 addMetaTimestamp (&$content)
 Add current microtime to the beginning of $cache_content. More...
 
 getMetaTimestamp (&$content)
 Extract the timestamp the $content was cached. More...
 
 invalidate ($cid=null, $resource_name=null, $cache_id=null, $compile_id=null, $resource_uid=null)
 Invalidate CacheID. More...
 
 getLatestInvalidationTimestamp ($cid, $resource_name=null, $cache_id=null, $compile_id=null, $resource_uid=null)
 Determine the latest timestamp known to the invalidation chain. More...
 
 listInvalidationKeys ($cid, $resource_name=null, $cache_id=null, $compile_id=null, $resource_uid=null)
 Translate a CacheID into the list of applicable InvalidationKeys. More...
 
 read (array $keys)
 Read values for a set of keys from cache. More...
 
 write (array $keys, $expire=null)
 Save values for a set of keys to cache. More...
 
 delete (array $keys)
 Remove values from cache. More...
 
 purge ()
 Remove all values from cache. More...
 

Protected Attributes

 $contents = array()
 
 $timestamps = array()
 

Additional Inherited Members

- Static Public Member Functions inherited from Smarty_CacheResource
static load (Smarty $smarty, $type=null)
 Load Cache Resource Handler. More...
 
static invalidLoadedCache (Smarty $smarty)
 Invalid Loaded Cache Files. More...
 
- Static Public Attributes inherited from Smarty_CacheResource
static $resources = array()
 
- Static Protected Attributes inherited from Smarty_CacheResource
static $sysplugins
 

Detailed Description

Definition at line 34 of file smarty_cacheresource_keyvaluestore.php.

Member Function Documentation

acquireLock ( Smarty  $smarty,
Smarty_Template_Cached  $cached 
)

Lock cache for this template.

Parameters
Smarty$smartySmarty object
Smarty_Template_Cached$cachedcached object

Definition at line 406 of file smarty_cacheresource_keyvaluestore.php.

addMetaTimestamp ( $content)
protected

Add current microtime to the beginning of $cache_content.

{

Definition at line 246 of file smarty_cacheresource_keyvaluestore.php.

clear ( Smarty  $smarty,
  $resource_name,
  $cache_id,
  $compile_id,
  $exp_time 
)

Empty cache for a specific template.

{

Definition at line 154 of file smarty_cacheresource_keyvaluestore.php.

clearAll ( Smarty  $smarty,
  $exp_time = null 
)

Empty cache.

{

Definition at line 131 of file smarty_cacheresource_keyvaluestore.php.

delete ( array  $keys)
abstractprotected

Remove values from cache.

Parameters
array$keyslist of keys to delete
Returns
boolean true on success, false on failure
fetch (   $cid,
  $resource_name = null,
  $cache_id = null,
  $compile_id = null,
$content = null,
$timestamp = null,
  $resource_uid = null 
)
protected

Fetch and prepare a cache object.

Parameters
string$cidCacheID to fetch
string$resource_nametemplate name
string$cache_idcache id
string$compile_idcompile id
string$contentcached content
integer&$timestampcached timestamp (epoch)
string$resource_uidresource's uid
Returns
boolean success

Definition at line 222 of file smarty_cacheresource_keyvaluestore.php.

getLatestInvalidationTimestamp (   $cid,
  $resource_name = null,
  $cache_id = null,
  $compile_id = null,
  $resource_uid = null 
)
protected

Determine the latest timestamp known to the invalidation chain.

Parameters
string$cidCacheID to determine latest invalidation timestamp of
string$resource_nametemplate name
string$cache_idcache id
string$compile_idcompile id
string$resource_uidsource's filepath
Returns
float the microtime the CacheID was invalidated

Definition at line 314 of file smarty_cacheresource_keyvaluestore.php.

getMetaTimestamp ( $content)
protected

Extract the timestamp the $content was cached.

Parameters
string&$contentthe cached content
Returns
float the microtime the content was cached

Definition at line 259 of file smarty_cacheresource_keyvaluestore.php.

getTemplateUid ( Smarty  $smarty,
  $resource_name,
  $cache_id,
  $compile_id 
)
protected

Get template's unique ID.

Parameters
Smarty$smartySmarty object
string$resource_nametemplate name
string$cache_idcache id
string$compile_idcompile id
Returns
string filepath of cache file

Definition at line 171 of file smarty_cacheresource_keyvaluestore.php.

hasLock ( Smarty  $smarty,
Smarty_Template_Cached  $cached 
)

Check is cache is locked for this template.

Parameters
Smarty$smartySmarty object
Smarty_Template_Cached$cachedcached object
Returns
booelan true or false if cache is locked

Definition at line 393 of file smarty_cacheresource_keyvaluestore.php.

invalidate (   $cid = null,
  $resource_name = null,
  $cache_id = null,
  $compile_id = null,
  $resource_uid = null 
)
protected

Invalidate CacheID.

Parameters
string$cidCacheID
string$resource_nametemplate name
string$cache_idcache id
string$compile_idcompile id
string$resource_uidsource's uid
Returns
void

Definition at line 277 of file smarty_cacheresource_keyvaluestore.php.

listInvalidationKeys (   $cid,
  $resource_name = null,
  $cache_id = null,
  $compile_id = null,
  $resource_uid = null 
)
protected

Translate a CacheID into the list of applicable InvalidationKeys.

Splits "some|chain|into|an|array" into array( 'clearAll#', 'some', 'some|chain', 'some|chain|into', ... )

Parameters
string$cidCacheID to translate
string$resource_nametemplate name
string$cache_idcache id
string$compile_idcompile id
string$resource_uidsource's filepath
Returns
array list of InvalidationKeys $invalidationKeyPrefix to prepend to each InvalidationKey

Definition at line 347 of file smarty_cacheresource_keyvaluestore.php.

populate ( Smarty_Template_Cached  $cached,
Smarty_Internal_Template  $_template 
)

populate Cached Object with meta data from Resource

Parameters
Smarty_Template_Cached$cachedcached object
Smarty_Internal_Template$_templatetemplate object
Returns
void

Definition at line 54 of file smarty_cacheresource_keyvaluestore.php.

populateTimestamp ( Smarty_Template_Cached  $cached)

populate Cached Object with timestamp and exists from Resource

Parameters
Smarty_Template_Cached$cachedcached object
Returns
void

Definition at line 70 of file smarty_cacheresource_keyvaluestore.php.

process ( Smarty_Internal_Template  $_template,
Smarty_Template_Cached  $cached = null 
)

Read the cached template and process the header.

Parameters
Smarty_Internal_Template$_templatetemplate object
Smarty_Template_Cached$cachedcached object
Returns
booelan true or false if the cached content does not exist

Definition at line 87 of file smarty_cacheresource_keyvaluestore.php.

purge ( )
protected

Remove all values from cache.

Returns
boolean true on success, false on failure

Definition at line 456 of file smarty_cacheresource_keyvaluestore.php.

read ( array  $keys)
abstractprotected

Read values for a set of keys from cache.

Parameters
array$keyslist of keys to fetch
Returns
array list of values with the given keys used as indexes
releaseLock ( Smarty  $smarty,
Smarty_Template_Cached  $cached 
)

Unlock cache for this template.

Parameters
Smarty$smartySmarty object
Smarty_Template_Cached$cachedcached object

Definition at line 419 of file smarty_cacheresource_keyvaluestore.php.

sanitize (   $string)
protected

Sanitize CacheID components.

Parameters
string$stringCacheID component to sanitize
Returns
string sanitized CacheID component

Definition at line 200 of file smarty_cacheresource_keyvaluestore.php.

write ( array  $keys,
  $expire = null 
)
abstractprotected

Save values for a set of keys to cache.

Parameters
array$keyslist of values to save
int$expireexpiration time
Returns
boolean true on success, false on failure
writeCachedContent ( Smarty_Internal_Template  $_template,
  $content 
)

Write the rendered template output to cache.

Parameters
Smarty_Internal_Template$_templatetemplate object
string$contentcontent to cache
Returns
boolean success

Definition at line 114 of file smarty_cacheresource_keyvaluestore.php.

Field Documentation

$contents = array()
protected

Definition at line 40 of file smarty_cacheresource_keyvaluestore.php.

$timestamps = array()
protected

Definition at line 45 of file smarty_cacheresource_keyvaluestore.php.


The documentation for this class was generated from the following file:

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:43 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.