Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend\Cache Component Proposal

Proposed Component Name Zend\Cache
Developer Notes\Cache
Proposers Marc Bennewitz
Pádraic Brady ?
Zend Liaison TBD
Revision 1.0 - 7 March 2010: Initial Draft.
2.0 - 17 Jun 2010: finish proposal (wiki revision: 15)

Table of Contents

1. Overview

The current Zend_Cache component is very inflexible with it's Frontend/Backend structure. It's not possible to merge different frontens together (e.g. MasterFile and Page cache). Furthermore, few advantages of some cache storage systems are not derived by Zend_Cache. E.g. some storage systems can handle different data-types but Zend_Cache only permit strings.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will break bc 100% !!!!!
  • This components will read & write data from cache storage engines using only interface.
  • Adapters will not implement special functionalities directly to the storage engines (like serialization) to keep performance
    but implements a plugin structure to dynamically add/configure/re-order such functionalities.
  • Plugins will not store any data directly to a storage engine. A storage adapter will be used.
  • This component will add some special cache patterns using a different API (like PageCache).

4. Dependencies on Other Framework Components


  • Zend\Loader\PluginLoader
  • Zend\Exception


  • Storage\Plugin\Serialize


  • Storage\Plugin\Filter
  • Storage\Plugin\KeyFilter


5. Theory of Operation

Storage Adapter:
The storage adapters are classes of wrappers of the existing storage engines usable for caching (Memcache, Database, Filesystem ...).
They all implement an interface to get a consistent API but only reflect supported facilities of the used storage engine.

Storage Plugins:
Precisely because the storage adapters supports different facilities you can add facilities belated with the storage plugins.
(e.g. tag support, automatic serialize). The storage plugins have the same API as the storage adapters and therefor implement
an interface extending the adapters interface. Where ever a storage adapter is required you can set an instance of a storage plugin and you can merge all storage plugins as you like. The storage plugins self don't store any data - they need a storage adapter as storage engine.

A special storage plugin is the base storage class (Zend\Cache\Storage). It implements additional methods for simpler handling lists of
plugins within the own object.

Special Cache Patterns:
Some special cache patterns shouldn't use the standard cache API. They are: Output, Page, Function, Class, Callback and Capture.
These caches only implement a very simple pattern interface which only defines how options have to be set.

6. Milestones / Tasks

  • Milestone 1: [DONE] Finish proposal
  • Milestone 2: [DONE] Working prototype
  • Milestone 3: Prototype checked into the incubator
  • Milestone 4: Unit tests exist finished and component is working
  • Milestone 5: Initial documentation exists
  • Milestone 6: Changed related components
  • Milestone 7: Moved to core.

7. Class Index

Storage Adapter:

  • namespace Zend\Cache\Storage
  • interface Adaptable
  • abstract Adapter\AbstractAdapter implements Adaptable
  • class Adapter\Memory extends Adapter\AbstractAdapter
  • class Adapter\Memcached extends Adapter\AbstractAdapter
  • class Adapter\APC extends Adapter\AbstractAdapter
  • class Adapter\WinCache extends Adapter\AbstractAdapter
  • class Adapter\Xcache extends Adapter\AbstractAdapter
  • class Adapter\ZendServerSHM extends Adapter\AbstractAdapter
  • class Adapter\ZendServerDisk extends Adapter\AbstractAdapter
  • class Adapter\ZendPlatform extends Adapter\AbstractAdapter
  • class Adapter\Database extends Adapter\AbstractAdapter
  • class Adapter\Filesystem extends Adapter\AbstractAdapter

Storage Plugins:

  • namespace Zend\Cache\Storage
  • interface Pluggable extends Adaptable
  • abstract Plugin\AbstractPlugin implements Pluggable
  • class BlackHole extends Plugin\AbstractPlugin
  • class ClearByFactor extends Plugin\AbstractPlugin
  • class ExceptionHandler extends Plugin\AbstractPlugin
  • class Filter extends Plugin\AbstractPlugin
  • class IgnoreUserAbort extends Plugin\AbstractPlugin
  • class KeyFilter extends Plugin\AbstractPlugin
  • class Levels extends Plugin\AbstractPlugin
  • class MasterFile extends Plugin\AbstractPlugin
  • class OptimizeByFactor extends Plugin\AbstractPlugin
  • class Reluctant extends Plugin\AbstractPlugin
  • class Serialize extends Plugin\AbstractPlugin
  • class Prefix extends Plugin\AbstractPlugin
  • class Serialize extends Plugin\AbstractPlugin
  • class StoreTimes extends Plugin\AbstractPlugin
  • class Tagging extends Plugin\AbstractPlugin
  • class WriteControl extends Plugin\AbstractPlugin
  • use \Zend\Cache
  • class Cache\Storage extends Plugin\AbstractPlugin

Special Cache Patterns:

  • namesapce Zend\Cache
  • class PatternFactory
  • interface Pattern
  • abstract Pattern\AbstractPattern implements Pattern
  • class Pattern\CallbackCache extends Pattern\AbstractPattern
  • class Pattern\ClassCache extends Pattern\AbstractPattern
  • class Pattern\FunctionCache extends Pattern\AbstractPattern
  • class Pattern\OutputCache extends Pattern\AbstractPattern
  • class Pattern\PageCache extends Pattern\AbstractPattern
  • class Pattern\CaptureCache extends Pattern\AbstractPattern


  • namesapce Zend\Cache
  • class Manager


  • namesapce Zend\Cache
  • interface Exception extends \Zend\Exception
  • class RuntimeException extends \InvalidArgumentException implements Exception
  • class InvalidArgumentException extends \InvalidArgumentException implements Exception
  • class UnexpectedValueException extends \UnexpectedValueException implements Exception
  • class LoaderException extends \Exception implements Exception
  • class BadMethodCallException extends \BadMethodCallException implements Exception

8. Use Cases

9. Class Skeletons


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.