blackhole cache storage adapter #4512

Merged
merged 2 commits into from May 23, 2013

Projects

None yet

3 participants

@marc-mabe
Zend Framework member

This PR implements a black hole storage adapter (like in #4196) but doesn't extends AbstractAdapter so there is no overhead and it implements all interfaces to make it possible as a replacement in all cases.

Because it doesn't extend AbstractAdapter it has no plugin system implemented and configuring plugins together with this adapter will result in an exception.

@prolic

Just curious: How to use the blackhole adapter, when I need plugins in a real world application. How can I replace this with a blackhole adapter?

@marc-mabe
Zend Framework member

@prolic What do you mean with "I need plugins"? Plugins exists to add functionalities (like the Serializer) or to influence behavior of a storage (like the ExceptionHandler). The plugin system isn't part of the storage interface as plugins doesn't change basics of a key-value storage.

Applications should depend of a public (and well defined) API which will be the case here. If there is a very special case your application requires a behavior you should use the Capabilities of the storage to know if that storage will be ok. If the BlackHole storage will not you have to write your own. If you have a behavior not listed within the Capabilities you should create an issue.

... you need do remove the plugins - key of your configuration to instantiate the black hole storage using the factory.

@prolic

Thanks for your explanations.

@weierophinney weierophinney commented on the diff May 23, 2013
library/Zend/Cache/Storage/Adapter/BlackHole.php
+ * Constructor
+ *
+ * @param null|array|Traversable|AdapterOptions $options
+ */
+ public function __construct($options = null)
+ {
+ if ($options) {
+ $this->setOptions($options);
+ }
+ }
+
+ /**
+ * Set options.
+ *
+ * @param array|Traversable|Adapter\AdapterOptions $options
+ * @return StorageInterface Fluent interface
@weierophinney
weierophinney May 23, 2013

change to @return self

@weierophinney weierophinney added a commit that referenced this pull request May 23, 2013
@weierophinney weierophinney [#4512] CS fixes
- trailing whitespace
71996ce
@weierophinney weierophinney added a commit that referenced this pull request May 23, 2013
@weierophinney weierophinney Merge branch 'feature/4512' into develop
Close #4512
4549dd2
@weierophinney weierophinney merged commit 289af44 into zendframework:develop May 23, 2013

1 check failed

Details default The Travis CI build failed
@weierophinney weierophinney added a commit to zendframework/zend-cache that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge pull request zendframework/zendframework#4512 from marc-mabe/fe…
…ature/blackhole-cache-storage

blackhole cache storage adapter
b4482e6
@weierophinney weierophinney added a commit to zendframework/zend-cache that referenced this pull request May 15, 2015
@weierophinney weierophinney [zendframework/zendframework#4512] CS fixes
- trailing whitespace
6d46c37
@weierophinney weierophinney added a commit to zendframework/zend-cache that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'feature/4512' into develop c25c382
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment