This library is a factory to instantiate storage adapters based on the Flysystem or Gaufrette library. It can deal with both! Migrating from one lib to another should be easy this way.
- PHP 5.4+
At least one of both:
- Gaufrette Library
- Flysystem Library
Configure the adapter instances:
$basePath = '/your/base/path'; StorageFactory::config('LocalGaufrette', array( 'adapterOptions' => [$basePath, true], 'adapterClass' => '\Gaufrette\Adapter\Local', 'class' => '\Gaufrette\Filesystem' )); StorageFactory::config('LocalFlysystem', array( 'adapterOptions' => [$basePath], 'engine' => StorageFactory::FLYSYSTEM_ENGINE, 'adapterClass' => 'Local', ));
And get instances of the adapters as you need them.
$flysystemLocalFSAdapter = StorageFactory::get('LocalGaufrette'); $gaufretteLocalFSAdapter = StorageFactory::get('LocalFlysystem');
Flush or renews adapter objects:
// Flushes a specific adapter based on the config name StorageFactory::flush('LocalGaufrette'); // Flushes ALL adapters StorageFactory::flush(); // Renews an adapter, set second arg to true StorageFactory::get('LocalGaufrette', true);
For bugs and feature requests, please use the issues section of this repository.
To contribute to this repository please follow a few basic rules.
- Pull requests must be send to the
- Contributions must follow the PSR2 coding standard recommendation.
- Unit tests are required.
Copyright 2012 - 2015, Florian Krämer
Licensed under The MIT License Redistributions of files must retain the above copyright notice.