PHP code example of burzum / storage-factory

1. Go to this page and download the library: Download burzum/storage-factory 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/ */

    

burzum / storage-factory example snippets


$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',
));

$flysystemLocalFSAdapter = StorageFactory::get('LocalGaufrette');
$gaufretteLocalFSAdapter = StorageFactory::get('LocalFlysystem');

// 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);