Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Public Attributes | Protected Attributes | List of all members
ezpRestCacheStorageCluster Class Reference
Inheritance diagram for ezpRestCacheStorageCluster:

## Public Member Functions
| __construct ( $location, $options=array())
| store ( $id, $data, $attributes=array())
| restore ( $id, $attributes=array(), $search=false)
| clusterRetrieve ( $file, $mtime, $args)
| delete ( $id=null, $attributes=array(), $search=false)
| countDataItems ( $id=null, $attributes=array())
| getRemainingLifetime ( $id, $attributes=array())
| abortCacheGeneration ()

## Public Attributes
| $isCacheEnabled = true

## Protected Attributes
| $clusterCacheFile

## Detailed Description

Definition at line 11 of file cluster.php.

## Constructor & Destructor Documentation

## ◆ __construct()

ezpRestCacheStorageCluster::__construct | ( |  | $location,
|  |  | $options = `array()`
| ) |  |

Creates a new cache storage for a given location through Exponential cluster mechanism Options can contain the 'ttl' ( Time-To-Life ). This is per default set to 1 day.

Parameters

  string | $location | Path to the cache location inside the cluster
  | array(string=>string) | $options Options for the cache.

Definition at line 38 of file cluster.php.

References $location, $options, eZSys\cacheDirectory(), file_exists(), eZDir\mkdir(), and properties.

## Member Function Documentation

## ◆ abortCacheGeneration()

ezpRestCacheStorageCluster::abortCacheGeneration | ( |  | ) |

Aborts current cache generation Useful in case of a problem during generation of content (ie. exception)

Exceptions

  ezpCacheClusterException |

Definition at line 242 of file cluster.php.

## ◆ clusterRetrieve()

ezpRestCacheStorageCluster::clusterRetrieve | ( |  | $file,
|  |  | $mtime,
|  |  | $args
| ) |  |

Retrieve callback for cluster processCache() method

Parameters

  string | $file | Filepath
  int | $mtime | File modification time
  array | $args | Extra args passed to the cluster processCache() method

Returns
  string

Definition at line 142 of file cluster.php.

References $file.

## ◆ countDataItems()

ezpRestCacheStorageCluster::countDataItems | ( |  | $id = `null`,
|  |  | $attributes = `array()`
| ) |  |

Return the number of items in the cache matching a certain criteria.

This method determines if cache data described by the given ID and/or attributes exists. It returns the number of cache data items found.

Parameters

  string | $id | The item ID.
  | array(string=>string) | $attributes Attributes that describe the item

Returns
  int The number of cache data items found matching the criteria

Definition at line 192 of file cluster.php.

References $id, eZClusterFileHandler\instance(), and properties.

## ◆ delete()

ezpRestCacheStorageCluster::delete | ( |  | $id = `null`,
|  |  | $attributes = `array()`,
|  |  | $search = `false`
| ) |  |

Delete data from the cache.

Purges the cached data for a given ID and or attributes. Using an ID purges only the cache data for just this ID.

Additional attributes provided will matched additionally. This can give you an immense speed improvement against just searching for ID ( see ezcCacheStorage::restore() ).

If you only provide attributes for deletion of cache data, all cache data matching these attributes will be purged.

Parameters

  string | $id | The item ID.
  | array(string=>string) | $attributes Attributes that describe the cached data.
  bool | $search | Whether to search for items if not found directly. Default is false.

Definition at line 167 of file cluster.php.

References $id, eZClusterFileHandler\instance(), and properties.

## ◆ getRemainingLifetime()

ezpRestCacheStorageCluster::getRemainingLifetime | ( |  | $id,
|  |  | $attributes = `array()`
| ) |  |

Returns the time ( in seconds ) that remains for a cache object, before it gets outdated. In case the cache object is already outdated or does not exist, this method returns 0.

Parameters

  string | $id | The item ID.
  | array(string=>string) | $attributes Attributes that describe the @access public

Returns
  int The remaining lifetime ( 0 if nonexists or outdated ).

Definition at line 215 of file cluster.php.

References $id, eZClusterFileHandler\instance(), and properties.

## ◆ restore()

ezpRestCacheStorageCluster::restore | ( |  | $id,
|  |  | $attributes = `array()`,
|  |  | $search = `false`
| ) |  |

Restore data from the cache.

Restores the data associated with the given cache and returns it. Please see ezcCacheStorage::store() for more detailed information of cachable datatypes.

During access to cached data the caches are automatically expired. This means, that the ezcCacheStorage object checks before returning the data if it's still actual. If the cache has expired, data will be deleted and false is returned.

You should always provide the attributes you assigned, although the cache storages must be able to find a cache ID even without them. BEWARE: Finding cache data only by ID can be much slower than finding it by ID and attributes.

Parameters

  string | $id | The item ID.
  | array(string=>string) | $attributes Attributes that describe the cached data.
  bool | $search | Whether to search for items if not found directly. Default is false.

Returns
  mixed The cached data on success, otherwise false.

Definition at line 106 of file cluster.php.

References $id, $result, eZClusterFileHandler\instance(), and properties.

## ◆ store()

ezpRestCacheStorageCluster::store | ( |  | $id,
|  |  | $data,
|  |  | $attributes = `array()`
| ) |  |

(non-PHPdoc)

See also
  lib/ezc/Cache/src/storage/ezcCacheStorageFile::store()

Definition at line 61 of file cluster.php.

References $id, eZClusterFileHandler\instance(), and properties.

## Member Data Documentation

## ◆ $clusterCacheFile

ezpRestCacheStorageCluster::$clusterCacheFile
| protected

Definition at line 28 of file cluster.php.

## ◆ $isCacheEnabled

ezpRestCacheStorageCluster::$isCacheEnabled = true

Definition at line 21 of file cluster.php.

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

- cluster.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.