|
|
Cache storage plugins are objects to add missing functionality or to influence behavior of a storage adapter.
The plugins listen to events the adapter triggers and can change called method arguments
(*.post - events), skipping and directly return a result (using
stopPropagation), changing the result (with
setResult of
Zend\Cache\Storage\PostEvent) and catching exceptions (with
Zend\Cache\Storage\ExceptionEvent).
Storage plugins can either be created from
Zend\Cache\StorageFactory with the
pluginFactory, or by simply instantiating one of the
Zend\Cache\Storage\Plugin\*classes.
To make life easier, the Zend\Cache\StorageFactory comes with the
method factory to create an adapter and all given plugins at
once.
use Zend\Cache\StorageFactory;
// Via factory:
$cache = StorageFactory::factory(array(
'adapter' => 'filesystem',
'plugins' => array('serializer'),
));
// Alternately:
$cache = StorageFactory::adapterFactory('filesystem');
$plugin = StorageFactory::pluginFactory('serializer');
$cache->addPlugin($plugin);
// Or manually:
$cache = new Zend\Cache\Storage\Adapter\Filesystem();
$plugin = new Zend\Cache\Storage\Plugin\Serializer();
$cache->addPlugin($plugin);
Set the automatic clearing factor. Used by the
ClearByFactor plugin.
Implements a fluent interface.
Returns int
Flag indicating whether or not to clear by namespace. Used by the
ClearByFactor plugin.
Implements a fluent interface.
Returns bool
Set callback to call on intercepted exception. Used by the
ExceptionHandler plugin.
Implements a fluent interface.
Returns null|callable
Set automatic optimizing factor. Used by the
OptimizeByFactor plugin.
Implements a fluent interface.
Returns int
Set serializer adapter to use. Used by Serializer
plugin.
Implements a fluent interface.
Returns Zend\Serializer\Adapter
Set configuration options for instantiating a serializer adapter. Used by
the Serializer plugin.
Implements a fluent interface.
Returns array
Set flag indicating we should re-throw exceptions. Used by the
ExceptionHandler plugin.
Implements a fluent interface.
Returns bool
Set options
Implements a fluent interface.
Get options
Returns PluginOptions
Defined by Zend\EventManager\ListenerAggregate,
attach one or more listeners.
Returns void
Defined by Zend\EventManager\ListenerAggregate,
detach all previously attached listeners.
Returns void
|
|
Copyright © 2005-2011 Zend Technologies Inc (compiled by mikaelkael with ZFDocumentor - GIT c517eb0).

