public interface iCache

interface.cache.php #12

This interface is to be implemented by Extensions who wish to provide cacheable objects for Symphony to use.

Methods

void delete(string $hash)

Given the hash of a cacheable object, remove it from tbl_cache regardless of if it has expired or not. If no $hash is given, this removes all cache objects from tbl_cache that have expired. After removing, the function uses the __optimise function

Parameters
  • $hash stringThe hash of the Cached object, as defined by the user

See Also
static string getName()

Returns the human readable name of this cache type. This is displayed in the system preferences cache options.

array|boolean read(string $hash)

Given the hash of a some data, check to see whether it exists in tbl_cache. If no cached object is found, this function will return false, otherwise the cached object will be returned as an array.

Parameters
  • $hash stringThe hash of the Cached object, as defined by the user

Returns

An associative array of the cached object including the creation time, expiry time, the hash and the data. If the object is not found, false will be returned.

array settings()

This function returns all the settings of the current Cache instance.

Returns

An associative array of settings for this cache where the key is getClass and the value is an associative array of settings, key being the setting name, value being, the value

boolean write(string $hash, string $data, integer $ttl)

This function will compress data for storage in tbl_cache. It is left to the user to define a unique hash for this data so that it can be retrieved in the future. Optionally, a $ttl parameter can be passed for this data. If this is omitted, it data is considered to be valid forever. This function utilizes the Mutex class to act as a crude locking mechanism.

Parameters
  • $hash stringThe hash of the Cached object, as defined by the user

  • $data stringThe data to be cached, this will be compressed prior to saving.

  • $ttl integerA integer representing how long the data should be valid for in minutes. By default this is null, meaning the data is valid forever

Returns

If an error occurs, this function will return false otherwise true

See Also

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details