Class Filesystem

Summary

Fully Qualified Name: Zend\Cache\Storage\Adapter\Filesystem
Extends: AbstractAdapter
Implements: AvailableSpaceCapableInterface, ClearByNamespaceInterface, ClearByPrefixInterface, ClearExpiredInterface, FlushableInterface, IterableInterface, OptimizableInterface, TaggableInterface, TotalSpaceCapableInterface

Description

Methods

Name Description Defined By
__construct() Constructor AbstractAdapter
__destruct() Destructor AbstractAdapter
addItem() Add an item. Filesystem
addItems() Add multiple items. Filesystem
addPlugin() Register a plugin AbstractAdapter
checkAndSetItem() Set an item only if token matches Filesystem
clearByNamespace() Remove items by given namespace Filesystem
clearByPrefix() Remove items matching given prefix Filesystem
clearByTags() Remove items matching given tags. Filesystem
clearExpired() Remove expired items Filesystem
decrementItem() Decrement an item. AbstractAdapter
decrementItems() Decrement multiple items. AbstractAdapter
flush() Flush the whole storage Filesystem
getAvailableSpace() Get available space in bytes Filesystem
getCaching() Get caching enabled. AbstractAdapter
getCapabilities() Get capabilities of this adapter AbstractAdapter
getEventManager() Get the event manager AbstractAdapter
getItem() Get an item. Filesystem
getItems() Get multiple items. Filesystem
getIterator() Get the storage iterator Filesystem
getMetadata() Get metadata Filesystem
getMetadatas() Get metadatas Filesystem
getOptions() Get options. Filesystem
getPluginRegistry() Return registry of plugins AbstractAdapter
getTags() Get tags of an item by given key Filesystem
getTotalSpace() Get total space in bytes Filesystem
hasItem() Test if an item exists. Filesystem
hasItems() Test multiple items. Filesystem
hasPlugin() Check if a plugin is registered AbstractAdapter
incrementItem() Increment an item. AbstractAdapter
incrementItems() Increment multiple items. AbstractAdapter
optimize() Optimize the storage Filesystem
removeItem() Remove an item. Filesystem
removeItems() Remove multiple items. Filesystem
removePlugin() Unregister an already registered plugin AbstractAdapter
replaceItem() Replace an existing item. Filesystem
replaceItems() Replace multiple existing items. Filesystem
setCaching() Enable/Disable caching. AbstractAdapter
setItem() Store an item. Filesystem
setItems() Store multiple items. Filesystem
setOptions() Set options. Filesystem
setTags() Set tags to an item by given key. Filesystem
touchItem() Reset lifetime of an item Filesystem
touchItems() Reset lifetime of multiple items. Filesystem

Method Details

__construct()

Constructor

Parameter Name Type Description
$options null|array|\Traversable|\AdapterOptions

Returns:

__destruct()

Destructor

detach all registered plugins to free event handles of event manager

Returns: void

addItem()

Add an item.

Parameter Name Type Description
$key string
$value mixed

Returns: bool

addItems()

Add multiple items.

Parameter Name Type Description
$keyValuePairs array

Returns: bool

addPlugin()

Register a plugin

Parameter Name Type Description
$plugin \Plugin\PluginInterface
$priority int

Returns: \AbstractAdapter Provides a fluent interface

checkAndSetItem()

Set an item only if token matches

It uses the token received from getItem() to check if the item has changed before overwriting it.

Parameter Name Type Description
$token mixed
$key string
$value mixed

Returns: bool

clearByNamespace()

Remove items by given namespace

Parameter Name Type Description
$namespace string

Returns: bool

clearByPrefix()

Remove items matching given prefix

Parameter Name Type Description
$prefix string

Returns: bool

clearByTags()

Remove items matching given tags.

If $disjunction only one of the given tags must match else all given tags must match.

Parameter Name Type Description
$tags string[]
$disjunction bool

Returns: bool

clearExpired()

Remove expired items

Returns: bool

decrementItem()

Decrement an item.

Parameter Name Type Description
$key string
$value int

Returns: int|bool The new value on success, false on failure

decrementItems()

Decrement multiple items.

Parameter Name Type Description
$keyValuePairs array

Returns: array Associative array of keys and new values

flush()

Flush the whole storage

Returns: bool

getAvailableSpace()

Get available space in bytes

Returns: float

getCaching()

Get caching enabled.

Alias of getWritable and getReadable.

Returns: bool

getCapabilities()

Get capabilities of this adapter

Returns: \Capabilities

getEventManager()

Get the event manager

Returns: \EventManagerInterface

getItem()

Get an item.

Parameter Name Type Description
$key string
$success bool
$casToken mixed

Returns: mixed Data on success, null on failure

getItems()

Get multiple items.

Parameter Name Type Description
$keys array

Returns: array Associative array of keys and values

getIterator()

Get the storage iterator

Returns: \FilesystemIterator

getMetadata()

Get metadata

Parameter Name Type Description
$key string

Returns: array|bool Metadata on success, false on failure

getMetadatas()

Get metadatas

Parameter Name Type Description
$keys array
$options array

Returns: array Associative array of keys and metadata

getOptions()

Get options.

Returns: \FilesystemOptions

getPluginRegistry()

Return registry of plugins

Returns: \SplObjectStorage

getTags()

Get tags of an item by given key

Parameter Name Type Description
$key string

Returns: string[]|bool

getTotalSpace()

Get total space in bytes

Returns: int|float

hasItem()

Test if an item exists.

Parameter Name Type Description
$key string

Returns: bool

hasItems()

Test multiple items.

Parameter Name Type Description
$keys array

Returns: array Array of found keys

hasPlugin()

Check if a plugin is registered

Parameter Name Type Description
$plugin \Plugin\PluginInterface

Returns: bool

incrementItem()

Increment an item.

Parameter Name Type Description
$key string
$value int

Returns: int|bool The new value on success, false on failure

incrementItems()

Increment multiple items.

Parameter Name Type Description
$keyValuePairs array

Returns: array Associative array of keys and new values

optimize()

Optimize the storage

Returns: bool

removeItem()

Remove an item.

Parameter Name Type Description
$key string

Returns: bool

removeItems()

Remove multiple items.

Parameter Name Type Description
$keys array

Returns: array Array of not removed keys

removePlugin()

Unregister an already registered plugin

Parameter Name Type Description
$plugin \Plugin\PluginInterface

Returns: \AbstractAdapter Provides a fluent interface

replaceItem()

Replace an existing item.

Parameter Name Type Description
$key string
$value mixed

Returns: bool

replaceItems()

Replace multiple existing items.

Parameter Name Type Description
$keyValuePairs array

Returns: bool

setCaching()

Enable/Disable caching.

Alias of setWritable and setReadable.

Parameter Name Type Description
$flag bool

Returns: \AbstractAdapter Provides a fluent interface

setItem()

Store an item.

Parameter Name Type Description
$key string
$value mixed

Returns: bool

setItems()

Store multiple items.

Parameter Name Type Description
$keyValuePairs array

Returns: array Array of not stored keys

setOptions()

Set options.

Parameter Name Type Description
$options array|\Traversable|\FilesystemOptions

Returns: \Filesystem

setTags()

Set tags to an item by given key.

An empty array will remove all tags.

Parameter Name Type Description
$key string
$tags string[]

Returns: bool

touchItem()

Reset lifetime of an item

Parameter Name Type Description
$key string

Returns: bool

touchItems()

Reset lifetime of multiple items.

Parameter Name Type Description
$keys array

Returns: array Array of not updated keys

Top