PHP code example of twistor / flysystem-stream-wrapper

1. Go to this page and download the library: Download twistor/flysystem-stream-wrapper 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-stream-wrapper example snippets


use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
use Twistor\FlysystemStreamWrapper;

// Get a Filesystem object.
$filesystem = new Filesystem(new Local('/some/path'));

FlysystemStreamWrapper::register('fly', $filesystem);

// Then you can use it like so.
file_put_contents('fly://filename.txt', $content);

mkdir('fly://happy_thoughts');

FlysystemStreamWrapper::unregister('fly');