barryvdh / elfinder-flysystem-driver

elFinder driver for Flysystem
184 stars 41 forks source link

correction for flysysrtem cached cache adapter #24

Closed nao-pon closed 8 years ago

nao-pon commented 8 years ago

add a new option "fscache" of elFinder volume root options

$client = new \Google_Client();
$client->setClientId('xxxxxxxxxxxx');
$client->setClientSecret('xxxxxxxxxxxx');
$client->refreshToken('xxxxxxxxxxxx');

$service = new \Google_Service_Drive($client);

$gdrive = new \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter($service,
'root', [ 'useHasDir' => true ]);

$local = new \League\Flysystem\Adapter\Local('./flycache');
$cache = new \League\Flysystem\Cached\Storage\Adapter($local, 'gdcache',
300);

$adapter = new \League\Flysystem\Cached\CachedAdapter(
    $gdrive,
    $cache
);

$filesystem = new \League\Flysystem\Filesystem($adapter);

$elFinderVolumeOpts = [
    'driver' => 'Flysystem',
    'filesystem' => $filesystem,
    'fscache' => $cache // pass to elFinderFlysystemDriver
]

Thanks!

nao-pon commented 8 years ago

So quickly! Thanks!