ashleydawson/doctrine-flysystem-bundle
MultiBundle for autoloading).oneup/flysystem-bundle: ~1.0 is outdated (latest is ~3.0).ashleydawson/multibundle is abandoned (use Symfony’s native autoloading instead).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Deprecated Symfony 2 | Critical | Isolate in a legacy module or fork. |
| Schema Migration | High | Test doctrine:schema:update thoroughly. |
| File Handling Events | Medium | Validate event listeners in CI. |
| Performance | Medium | Benchmark file operations (e.g., S3 latency). |
| Security | Medium | Sanitize fileStoragePath to prevent path traversal. |
move_uploaded_file() calls).Product, User).composer require ashleydawson/doctrine-flysystem-bundle:0.8.*
config/bundles.php (Symfony 4+) or AppKernel.php:
return [
Oneup\FlysystemBundle\OneupFlysystemBundle::class,
AshleyDawson\DoctrineFlysystemBundle\AshleyDawsonDoctrineFlysystemBundle::class,
];
config/packages/oneup_flysystem.yaml:
oneup_flysystem:
adapters:
local_adapter:
local:
directory: "%kernel.project_dir%/var/files"
filesystems:
local_fs:
adapter: local_adapter
mount: "local_filesystem"
StorableTrait to target entities (e.g., Product.php):
use AshleyDawson\DoctrineFlysystemBundle\ORM\StorableTrait;
class Product {
use StorableTrait;
// ...
public function getFilesystemMountPrefix() { return 'local_filesystem'; }
}
php bin/console doctrine:schema:update --force
uploaded_file).PRE_STORE) for custom logic (e.g., path hashing).Product, User).move_uploaded_file()).ashleydawson.doctrine_flysystem_bundle.* listeners for logging.prePersist, preUpdate to inspect file operations.fileStoragePath to avoid overwrites.file_name, file_storage_path.| Scenario | Impact | Mitigation |
|---|---|---|
| Filesystem unwriteable | Uploads fail silently. | Add event listeners for error logging. |
| Database corruption | File metadata lost (files remain). | Implement backup/recovery for metadata. |
| Symfony cache invalidation | Configuration changes ignored. | Clear cache after config updates. |
| Path traversal | Malicious file paths. | Sanitize fileStoragePath in events. |
PRE_STORE/POST_STORE.How can I help you explore Laravel packages today?