opensoft / storage-bundle
An opinionated file based storage system with database level file tracking.
Installs: 15 582
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 7
Open Issues: 0
Language:JavaScript
Type:symfony-bundle
Requires
- php: >=7.2
- ext-fileinfo: ^1.0
- doctrine/orm: ^2.5
- guzzlehttp/psr7: ^1.4.1
- knplabs/knp-paginator-bundle: ^2.5
- league/flysystem: ^1.0
- league/flysystem-aws-s3-v3: ^1.0
- lexik/form-filter-bundle: ^5.0
- psr/http-message: ^1.0
- symfony/asset: ^3.0|^4.0
- symfony/form: ^3.0|^4.0
- symfony/framework-bundle: ^3.0|^4.0
- symfony/security: ^3.0|^4.0
- symfony/validator: ^3.0|^4.0
- symfony/var-dumper: ^3.0|^4.0
- twig/twig: ^1.25|^2.0
Requires (Dev)
- aws/aws-sdk-php: ^3.29
- phpunit/phpunit: ^7.5
- zendframework/zenddiagnostics: ^1.0
This package is auto-updated.
Last update: 2024-10-28 21:19:25 UTC
README
Rationale
Many solutions for file storage already exist within the Symfony Bundle ecosystem, yet we found them all lacking some combination of requirements that we would need for our use cases. As part of our core business, we store and process many different kinds of files for customers involved in printing. Due to this requirement, we needed a system that accomplished the following considerations:
- A solid abstration layer for writing files to storage locations. Those storage locations should be either local or cloud based.
- Database level tracking for all our files. We should be able to easily query how many, what type, their sizes, which storage location they were stored in.
- Strong FK relationships between normal database objects and these stored files. This allows us to know exact how each file is linked to other relationships in the database, allowing for cascade related behaviors associated with those files. It also helps us prevent orphaned storage files that aren't linked properly to anything.
- A storage file write, deletion and movement policy between different storage locations over time.
- A "permanent url" concept that can resolve URL's to the stored files, no matter which storage system they exist on.
To accomplish this goal, we've designed the OpensoftStorageBundle to handle these use cases for us. It combines tools from knplabs/gaufrette, Doctrine entites for Storages, StorageFiles, and StoragePolicies, some administrative screens to create, update, review, and look at stored files, and some doctrine listeners
Your application then has access to a storage_manager
service which handles most of these use cases for storing new files
into the storage engine.
Documentation
Documentation for the bundle can be found in Resources/doc
License
This bundle is licensed under the permissive MIT license. We welcome pull requests to improve it!