File

Extends \Joomla\Cache\Cache

Filesystem cache driver for the Joomla Framework.

deprecated

Supported options:

  • ttl (integer) : The default number of seconds for the cache life.
  • file.locking (boolean) :
  • file.path : The path for cache files.
since

1.0

deprecated

The joomla/cache package is deprecated

Methods

__construct

Constructor.

__construct(mixed $options = array()) 
inherited
since

1.0

throws

\RuntimeException

Arguments

$options

mixedAn options array, or an object that implements \ArrayAccess

checkFilePath

Check that the file path is a directory and writable.

checkFilePath(string $filePath) : boolean
since

1.0

throws

\RuntimeExceptionif the file path is invalid.

Arguments

$filePath

stringA file path.

Response

booleanThe method will always return true, if it returns.

clear

This will wipe out the entire cache's keys

clear() : boolean
inherited abstract
since

1.0

Response

booleanThe result of the clear operation.

exists

Method to determine whether a storage entry has been set for a key.

exists(string $key) : boolean
inherited abstract
since

1.0

Arguments

$key

stringThe storage entry identifier.

Response

boolean

fetchStreamUri

Get the full stream URI for the cache entry.

fetchStreamUri(string $key) : string
since

1.0

throws

\RuntimeExceptionif the cache path is invalid.

Arguments

$key

stringThe storage entry identifier.

Response

stringThe full stream URI for the cache entry.

get

Get cached data by id. If the cached data has expired then the cached data will be removed and false will be returned.

get(string $key) : \Psr\Cache\CacheItemInterface
inherited abstract
since

1.0

Arguments

$key

stringThe cache data id.

Response

\Psr\Cache\CacheItemInterfaceCached data string if it exists.

getMultiple

Obtain multiple CacheItems by their unique keys.

getMultiple(array $keys) : array
inherited
since

1.0

Arguments

$keys

arrayA list of keys that can obtained in a single operation.

Response

arrayAn associative array of CacheItem objects keyed on the cache key.

getOption

Get an option from the Cache instance.

getOption(string $key) : mixed
inherited
since

1.0

Arguments

$key

stringThe name of the option to get.

Response

mixedThe option value.

isExpired

Check whether or not the cached data by id has expired.

isExpired(string $key) : boolean
since

1.0

Arguments

$key

stringThe storage entry identifier.

Response

booleanTrue if the data has expired.

remove

Delete a cached data entry by id.

remove(string $key) : boolean
inherited abstract
since

1.0

Arguments

$key

stringThe cache data id.

Response

boolean

removeMultiple

Remove multiple cache items in a single operation.

removeMultiple(array $keys) : array
inherited
since

1.0

Arguments

$keys

arrayThe array of keys to be removed.

Response

arrayAn associative array of 'key' => result, elements. Each array row has the key being deleted and the result of that operation. The result will be a boolean of true or false representing if the cache item was removed or not

set

Store the cached data by id.

set(string $key, mixed $data, integer $ttl = null) : boolean
inherited abstract
since

1.0

Arguments

$key

stringThe cache data id

$data

mixedThe data to store

$ttl

integerThe number of seconds before the stored data expires.

Response

boolean

setMultiple

Persisting a set of key => value pairs in the cache, with an optional TTL.

setMultiple(array $items, null|integer $ttl = null) : boolean
inherited
since

1.0

Arguments

$items

arrayAn array of key => value pairs for a multiple-set operation.

$ttl

null|integerOptional. The TTL value of this item. If no value is sent and the driver supports TTL then the library may set a default value for it or let the driver take care of that.

Response

booleanThe result of the multiple-set operation.

setOption

Set an option for the Cache instance.

setOption(string $key, mixed $value) : \Joomla\Cache\Cache
inherited
since

1.0

Arguments

$key

stringThe name of the option to set.

$value

mixedThe option value to set.

Response

\Joomla\Cache\CacheThis object for method chaining.

Properties

options

The options for the cache object.

inherited
since

1.0

Type(s)

\ArrayAccess