PHP code example of twistor / flysystem-memory-adapter
1. Go to this page and download the library: Download twistor/flysystem-memory-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-memory-adapter example snippets
use League\Flysystem\Filesystem;
use Twistor\Flysystem\MemoryAdapter;
$filesystem = new Filesystem(new MemoryAdapter());
$filesystem->write('new_file.txt', 'yay a new text file!');
$contents = $filesystem->read('new_file.txt');
// If you have existing test files, you can populate the memory adapter from a
// filesystem path.
$adapter = MemoryAdapter::createFromPath('path/to/some/folder');
// Or, you can use an existing filesystem, and convert it.
$adapter = MemoryAdapter::createFromFilesystem($filesystem);