twistor / flysystem-passthrough-adapter
A simple adapter that wraps another adapter.
Installs: 24 711
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- league/flysystem: ~1.0
Requires (Dev)
- league/flysystem-memory: ^1.0
- phpunit/phpunit: ~4.1
This package is auto-updated.
Last update: 2024-10-26 10:37:40 UTC
README
Installation
composer require twistor/flysystem-passthrough-adapter
Usage
This package doesn't do anything on its own. It provides a base class that simplifies the creation of adapters that wrap other adapters.
To use it, subclass \Twistor\Flysystem\PassthroughAdapter and override any methods.
<?php use League\Flysystem\AdapterInterface; use Twistor\Flysystem\PassthroughAdapter; class UppercaseAdapter extends PassthroughAdapter { /** * Constructs an UppercaseAdapter. * * @param AdapterInterface $adapter */ public function __construct(AdapterInterface $adapter) { parent::__construct($adapter); } /** * @inheritdoc */ public function read($path) { $result = $this->getAdapter()->read($path); if ($result === false) { return false; } $result['contents'] = strtoupper($result['contents']); return $result; } }