Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 1.74 KB

Installation.md

File metadata and controls

54 lines (38 loc) · 1.74 KB

Installation

Make sure you've checked the requirements first!

Using Composer

Installing the plugin via Composer is very simple, just run in your project folder:

composer require burzum/file-storage:3.0.*@dev

CakePHP Bootstrap

Add the following part to your applications config/bootstrap.php.

use Cake\Event\EventManager;
use Burzum\FileStorage\Lib\FileStorageUtils;
use Burzum\FileStorage\Lib\StorageManager;
use Burzum\FileStorage\Event\ImageProcessingListener;
use Burzum\FileStorage\Event\LocalFileStorageListener;

// Only required if you're *NOT* using composer or another autoloader!
spl_autoload_register(__NAMESPACE__ .'\FileStorageUtils::gaufretteLoader');

$listener = new LocalFileStorageListener();
EventManager::instance()->on($listener);

// For automated image processing you'll have to attach this listener as well
$listener = new ImageProcessingListener();
EventManager::instance()->on($listener);

Adapter Specific Configuration

Depending on the storage backend of your choice, for example Amazon S3 or Dropbox, you'll very likely need additional vendor libs and extended adapter configuration.

Please see the Specific Adapter Configuration page of the documentation for more information about then. It is also worth checking the Gaufrette documentation for additonal adapters.

Running Tests

The plugin tests are set up in a way that you can run them without putting the plugin into a CakePHP3 application. All you need to do is to go into the FileStorage folder and run these commands:

cd <file-storage-plugin-folder>
composer install
phpunit