X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fdrush%2Fdrush%2Flib%2FDrush%2FConfig%2FStorageWrapper.php;fp=vendor%2Fdrush%2Fdrush%2Flib%2FDrush%2FConfig%2FStorageWrapper.php;h=26b43742b370692c6d84d794d3e0d85f1345af39;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/vendor/drush/drush/lib/Drush/Config/StorageWrapper.php b/vendor/drush/drush/lib/Drush/Config/StorageWrapper.php new file mode 100644 index 000000000..26b43742b --- /dev/null +++ b/vendor/drush/drush/lib/Drush/Config/StorageWrapper.php @@ -0,0 +1,141 @@ +storage = $storage; + $this->filters = is_array($filterOrFilters) ? $filterOrFilters : array($filterOrFilters); + } + + /** + * {@inheritdoc} + */ + public function exists($name) { + return $this->storage->exists($name); + } + + /** + * {@inheritdoc} + */ + public function read($name) { + $data = $this->storage->read($name); + + foreach ($this->filters as $filter) { + $data = $filter->filterRead($name, $data); + } + + return $data; + } + + /** + * {@inheritdoc} + */ + public function readMultiple(array $names) { + $dataList = $this->storage->readMultiple($names); + $result = array(); + + foreach ($dataList as $name => $data) { + foreach ($this->filters as $filter) { + $data = $filter->filterRead($name, $data); + } + $result[$name] = $data; + } + + return $result; + } + + /** + * {@inheritdoc} + */ + public function write($name, array $data) { + foreach ($this->filters as $filter) { + $data = $filter->filterWrite($name, $data, $this->storage); + } + + return $this->storage->write($name, $data); + } + + /** + * {@inheritdoc} + */ + public function delete($name) { + return $this->storage->delete($name); + } + + /** + * {@inheritdoc} + */ + public function rename($name, $new_name) { + return $this->storage->rename($name, $new_name); + } + + /** + * {@inheritdoc} + */ + public function encode($data) { + return $this->storage->encode($data); + } + + /** + * {@inheritdoc} + */ + public function decode($raw) { + return $this->storage->decode($raw); + } + + /** + * {@inheritdoc} + */ + public function listAll($prefix = '') { + return $this->storage->listAll($prefix); + } + + /** + * {@inheritdoc} + */ + public function deleteAll($prefix = '') { + return $this->storage->deleteAll($prefix); + } + + /** + * {@inheritdoc} + */ + public function createCollection($collection) { + return $this->storage->createCollection($collection); + } + + /** + * {@inheritdoc} + */ + public function getAllCollectionNames() { + return $this->storage->getAllCollectionNames(); + } + + /** + * {@inheritdoc} + */ + public function getCollectionName() { + return $this->storage->getCollectionName(); + } + +}