Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/becklyn/ddd-file-store
A file store abstraction using the Becklyn DDD framework
https://github.com/becklyn/ddd-file-store
ddd ddd-architecture php symfony symfony-bundle
Last synced: 4 days ago
JSON representation
A file store abstraction using the Becklyn DDD framework
- Host: GitHub
- URL: https://github.com/becklyn/ddd-file-store
- Owner: Becklyn
- Created: 2022-01-27T15:17:09.000Z (almost 3 years ago)
- Default Branch: 4.x
- Last Pushed: 2023-05-17T08:55:17.000Z (over 1 year ago)
- Last Synced: 2024-11-08T07:44:30.369Z (11 days ago)
- Topics: ddd, ddd-architecture, php, symfony, symfony-bundle
- Language: PHP
- Homepage:
- Size: 127 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Becklyn DDD FileStore
This library provides file storage capabilities using the Becklyn DDD framework.
## Requirements
Command handlers and event subscribers must be enabled in the project. See becklyn/ddd-symfony-bridge documentation for how to set this up.## Installation
- Run `composer require becklyn/ddd-file-store`
- Add the following to bundles.php:
```
Becklyn\Ddd\FileStore\BecklynFileStoreBundle::class => ['all' => true],
```
- There is a doctrine migration provided. Execute it by running `php bin/console doctrine:migrations:migrate`
- Add the following to services.yaml if the command handlers should log errors:
```
becklyn_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 }
```## How To
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.## 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
```### Available Options
#### filesystem.base_path
- Type: string
- Default: '%kernel_project_root%/var/becklyn-files'
This is the folder where files will be saved to.