This library provides file storage capabilities using the Becklyn DDD framework.
Command handlers and event subscribers must be enabled in the project. See becklyn/ddd-symfony-bridge documentation for how to set this up.
composer require becklyn/ddd-file-storeBecklyn\Ddd\FileStore\BecklynFileStoreBundle::class => ['all' => true],
php bin/console doctrine:migrations:migratebecklyn_ddd.file_store.handler.create_file:
class: Becklyn\Ddd\FileStore\Application\CreateFileHandler
arguments:
$logger: '@YOUR_PSR_LOGGER_INTERFACE_COMPLIANT_SERVICE_HERE'
tags:
- { name: command_handler, register_public_methods: true }
becklyn_ddd.file_store.handler.replace_file_contents:
class: Becklyn\Ddd\FileStore\Application\ReplaceFileContentsHandler
arguments:
$logger: '@YOUR_PSR_LOGGER_INTERFACE_COMPLIANT_SERVICE_HERE'
tags:
- { name: command_handler, register_public_methods: true }
Files are saved to the file store by dispatching CreateFileCommand and ReplaceFileContentsCommand through the command bus. Files are read by using the load method of the FileManager class. Files are deleted by dispatching DeleteFileCommand through the command bus. Files created by the library will be stored to %kernel_project_root%/var/becklyn-files folder by default. This can be changed through configuration.
To change the values of configuration options from their defaults, create a becklyn_ddd.file_store.yaml file in the config/packages folder with the following contents:
becklyn_ddd.file_store:
option_name: value
option_namespace_1:
namespaced_option_name: value
This is the folder where files will be saved to.
How can I help you explore Laravel packages today?