Flysystem passthrough adapter
, (*1)
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., (*2)
To use it, subclass \Twistor\Flysystem\PassthroughAdapter and override any
methods., (*3)
```php
<?php, (*4)
use League\Flysystem\AdapterInterface;
use Twistor\Flysystem\PassthroughAdapter;, (*5)
class UppercaseAdapter extends PassthroughAdapter
{
/**
* Constructs an UppercaseAdapter.
*
* @param AdapterInterface $adapter
*/
public function __construct(AdapterInterface $adapter)
{
parent::__construct($adapter);
}, (*6)
/**
* @inheritdoc
*/
public function read($path)
{
$result = $this->getAdapter()->read($path);
if ($result === false) {
return false;
}
$result['contents'] = strtoupper($result['contents']);
return $result;
}
}, (*7)