PHP code example of twistor / flysystem-passthrough-adapter

1. Go to this page and download the library: Download twistor/flysystem-passthrough-adapter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

twistor / flysystem-passthrough-adapter example snippets



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;
    }