public static function createFromFilesystem(FilesystemInterface $filesystem)
    {
        $filesystem->addPlugin(new ListWith());

        $adapter = new static();
        $config = new Config();

        foreach ($filesystem->listWith(['timestamp', 'visibility'], '', true) as $meta) {
            if ($meta['type'] === 'dir') {
                $adapter->createDir($meta['path'], $config);
                continue;
            }

            $adapter->write($meta['path'], (string) $filesystem->read($meta['path']), $config);
            $adapter->setVisibility($meta['path'], $meta['visibility']);
            $adapter->setTimestamp($meta['path'], $meta['timestamp']);
        }

        return $adapter;
    }
public static function createFromFilesystem(FilesystemInterface $filesystem)
    {
        $filesystem->addPlugin(new ListWith());

        $adapter = new static();
        $config = new Config();

        foreach ($filesystem->listWith(['timestamp', 'visibility'], '', true) as $meta) {
            if ($meta['type'] === 'dir') {
                $adapter->createDir($meta['path'], $config);
                continue;
            }

            $adapter->write($meta['path'], (string) $filesystem->read($meta['path']), $config);
            $adapter->setVisibility($meta['path'], $meta['visibility']);
            $adapter->setTimestamp($meta['path'], $meta['timestamp']);
        }

        return $adapter;
    }
public static function createFromFilesystem ( FilesystemInterface $ filesystem ) { $ filesystem -> addPlugin ( new ListWith ( ) ) ; $ adapter = new static ( ) ; $ config = new Config ( ) ; foreach ( $ filesystem -> listWith ( [ 'timestamp' , 'visibility' ] , '' , true ) as $ meta ) { if ( $ meta [ 'type' ] === 'dir' ) { $ adapter -> createDir ( $ meta [ 'path' ] , $ config ) ; continue ; } $ adapter -> write ( $ meta [ 'path' ] , ( string ) $ filesystem -> read ( $ meta [ 'path' ] ) , $ config ) ; $ adapter -> setVisibility ( $ meta [ 'path' ] , $ meta [ 'visibility' ] ) ; $ adapter -> setTimestamp ( $ meta [ 'path' ] , $ meta [ 'timestamp' ] ) ; } return $ adapter ; }
Creates a Memory adapter from a Flysystem filesystem.

@param FilesystemInterface $filesystem The Flysystem filesystem.

@return self A new memory adapter.
Creates a Memory adapter from a Flysystem filesystem .