XOOPS  2.6.0
Xoops\Core\Cache\Access Class Reference

Public Member Functions

 __construct (PoolInterface $pool)
 
 cacheRead ($cacheKey, $regenFunction, $ttl=null, $args=null)
 
 clear ()
 
 delete ($key)
 
 garbageCollect ()
 
 pool ()
 
 read ($key)
 
 write ($key, $value, $ttl=null)
 

Protected Attributes

 $pool = null
 

Detailed Description

Definition at line 28 of file Access.php.

Constructor & Destructor Documentation

Xoops\Core\Cache\Access::__construct ( PoolInterface  $pool)

__construct

Parameters
typePoolInterface $pool cache pool to use for this cache instance

Definition at line 42 of file Access.php.

References Xoops\Core\Cache\Access\$pool, and Xoops\Core\Cache\Access\pool().

Here is the call graph for this function:

Member Function Documentation

Xoops\Core\Cache\Access::cacheRead (   $cacheKey,
  $regenFunction,
  $ttl = null,
  $args = null 
)

cache block wrapper using Invalidation::PRECOMPUTE

If the cache read for $key is a miss, call the $regenFunction to update it. With the PRECOMPUTE strategy, it will trigger a miss on a read on one caller before the cache expires, so it will be done in advance.

Parameters
string|string[]$cacheKey Identifier for the cache item
callable$regenFunctionfunction to generate cached content
int | DateTime | null$ttltime to live, number ofseconds as integer, DateTime to expire at a specific time, or null for default
mixed...$args variable argument list for $regenFunction
Returns
mixed

Definition at line 107 of file Access.php.

References Xoops\Core\Cache\Access\pool().

Here is the call graph for this function:

Xoops\Core\Cache\Access::clear ( )

clear all keys and data from the cache.

Returns
boolean True if the cache was successfully cleared, false otherwise

Definition at line 154 of file Access.php.

References Xoops\Core\Cache\Access\pool().

Here is the call graph for this function:

Xoops\Core\Cache\Access::delete (   $key)

Delete a key from the cache.

Parameters
string|string[]$key Identifier for the cache item
Returns
boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed

Definition at line 85 of file Access.php.

References Xoops\Core\Cache\Access\pool().

Here is the call graph for this function:

Xoops\Core\Cache\Access::garbageCollect ( )

Garbage collection - remove all expired and deleted data

Returns
void

Definition at line 144 of file Access.php.

References Xoops\Core\Cache\Access\pool().

Here is the call graph for this function:

Xoops\Core\Cache\Access::pool ( )

direct access to pool

WARNING: this is intended for diagnostics and similar advanced uses. Depending on direct access to the pool may break future compatibility.

Returns
PoolInterface the current pool

Definition at line 167 of file Access.php.

References Xoops\Core\Cache\Access\$pool.

Referenced by Xoops\Core\Cache\Access\__construct(), Xoops\Core\Cache\Access\cacheRead(), Xoops\Core\Cache\Access\clear(), Xoops\Core\Cache\Access\delete(), Xoops\Core\Cache\Access\garbageCollect(), Xoops\Core\Cache\Access\read(), and Xoops\Core\Cache\Access\write().

Here is the caller graph for this function:

Xoops\Core\Cache\Access::read (   $key)

Read a key from the cache.

Parameters
string|string[]$key Identifier for the cache item
Returns
mixed The cached data

Definition at line 71 of file Access.php.

References NONE, and Xoops\Core\Cache\Access\pool().

Here is the call graph for this function:

Xoops\Core\Cache\Access::write (   $key,
  $value,
  $ttl = null 
)

Write data for key into cache.

Parameters
string|string[]$key Identifier for the cache item
mixed$valueData to be cached - anything except a resource
int | DateTime | null$ttltime to live, integer for ttl in seconds, DateTime object to expire at a specific time, or null for
Returns
boolean True if the data was successfully cached, false on failure

Definition at line 58 of file Access.php.

References Xoops\Core\Cache\Access\pool().

Here is the call graph for this function:

Member Data Documentation

Xoops\Core\Cache\Access::$pool = null
protected

Definition at line 35 of file Access.php.

Referenced by Xoops\Core\Cache\Access\__construct(), and Xoops\Core\Cache\Access\pool().


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