cleverage/flysystem-process-bundle
Integrates the Flysystem filesystem abstraction library into CleverAge's ProcessBundle for Symfony, letting process workflows read from and write to local or remote storage adapters. Part of the CleverAge process-bundle project and licensed under MIT.
Architecture Fit
The flysystem-process-bundle (v3.2) remains well-aligned with Laravel/PHP ecosystems using Flysystem for file storage abstraction, particularly for file processing pipelines (image/video manipulation, PDF generation). Its Symfony Process integration makes it a strong fit for Laravel applications that shell out to CLI tooling inside queue workers or Artisan commands. The bundle's task-based design (FileFetchTask, ListContentTask, RemoveFileTask) abstracts "fetch → process → store → clean up" behind a unified API, reducing vendor lock-in and custom glue code.
v3.2 does not alter the architectural surface. It is a correctness release: the changes are confined to the FileFetchTask and RemoveFileTask implementations plus expanded test coverage (bundle wiring, DI extension, local storage). No new extension points, no API removals, and no new dependencies. From an architecture standpoint the only signal is a positive one — the previously untested DI/extension layer is now covered, which reduces the risk of service wiring subtly breaking across Laravel container bindings.
Integration Feasibility
symfony/process, symfony/filesystem) providing the bridge. Flysystem adapter support keeps it compatible with Laravel's Storage facade and third-party adapters (S3, GCS).FileFetchTask semantics rather than its signature, existing custom task subclasses continue to work — but any subclass overriding fetch behaviour should be re-validated against the corrected input-iteration logic.^3.0 constraint already admits v3.2. Adoption requires only a Composer update and regression run — no code changes.Technical Risk
ignore_missing is now honoured for input files; previously a missing input threw UnableToReadFile. Pipelines that relied on that exception as a signal (e.g., a try/catch used for detection) will now silently skip.file_pattern, every input is now processed rather than only the first. Expect higher volume and longer task runtimes where duplicate inputs were previously (accidentally) suppressed.0 is no longer treated as "no file" by FileFetchTask/RemoveFileTask.Storage disk handoff) rather than the task internals.RemoveFileTask now logs a missing file as not found rather than deleted, and the deletion-failure message is corrected. Any dashboard, alert rule, or log-based metric keyed on the old message text must be updated — this is the most likely silent breakage in a mature deployment.Key Questions
symfony/process v8.x)?UnableToReadFile being thrown for missing inputs (now suppressed by ignore_missing)?RemoveFileTask?Stack Fit
cleverage/flysystem-process-bundle:^3.0, resolving to v3.2) and bind Symfony services to Laravel's container (e.g., ProcessRunner as a singleton). v3.2's DI-extension tests make this wiring materially safer to rely on.Storage facade to build Flysystem adapters, then wrap them with the bundle's processed filesystem.use Cleverage\ProcessBundle\Process\ProcessRunner;
use Illuminate\Support\Facades\Storage;
$filesystem = Storage::disk('local')->getAdapter()->getFilesystem();
$processedFs = new ProcessedFilesystem($filesystem, new ProcessRunner());
ignore_missing propagation, falsy filenames, and removal logging — all cases a bespoke implementation would have to handle independently.Migration Path
composer.json for Symfony 7.x dependencies and PHP version floor.UnableToReadFile handlers, duplicate-path assumptions, and string matches on RemoveFileTask log messages.cleverage/flysystem-process-bundle v3.2 (no code change required under ^3.0).Process instantiations with the bundle's builder/runner for consistency.ignore_missing both enabled and disabled, duplicate input paths, file_pattern with multiple inputs, and a file named 0.RemoveFileTask messages.Compatibility
ProcessedFilesystem integrates with Laravel's FilesystemManager for dynamic disk switching.ShouldQueue) using the bundle should inject ProcessRunner and the bundle's tasks rather than constructing processes inline.FileFetchTask, re-check subclass behaviour against the corrected per-input iteration.Process methods (e.g., mustRun()).league/flysystem-s3) may need updates for Symfony 8.x StreamWrapper changes.Sequencing
^3.0 constraint resolves to v3.2.Maintenance
Process stability (signal handling, cleanup) continues to reduce operational overhead.ignore_missing and log wording means documentation and runbooks need a small but real refresh.Support
dd() for process inspection.failed_jobs table to track failed process-based jobs.RemoveFileTask messages: missing files now surface as not found, and deletion failures carry corrected text.Scaling
Process optimisations (reduced fork overhead) improve batch throughput.afterCommit() hooks to clean up temp files post-processing; the corrected RemoveFileTask list-of-paths support allows consolidating cleanup into fewer invocations.Failure Modes
| Scenario | Mitigation Strategy |
|---|---|
| PHP 8.5 deprecation warnings | Enable strict_types=1 in Laravel and suppress non-critical warnings via .env. |
| Process timeouts | Implement exponential backoff in Laravel jobs using ProcessRunner. |
| Symfony 8.x dependency conflicts | Pin symfony/process to a compatible version if bundle updates are unstable. |
| Missing input silently skipped post-v3.2 | Audit ignore_missing usage; add explicit pre-flight file existence checks where absence must fail fast. |
| Increased job duration after duplicate fix | Re-baseline timeouts and worker concurrency; de-duplicate inputs upstream if volume was unintended. |
| Stale log-based alerts after v3.2 | Update dashboards/parsers for revised RemoveFileTask not-found and deletion-failure messages. |
| File corruption during processing | Use Flysystem checksum validation and Storage events for rollback. |
| Queue worker crashes | Deploy Supervisor config with process_name tags for process-heavy jobs. |
Ramp-Up
Process differences (constructor, event system) for developers.ignore_missing for inputs, per-input processing with file_pattern, duplicate paths processed, 0-named files valid, removal logging changes.ServiceProvider vs. PackageServiceProvider.Events system (e.g., filesystem.processed).How can I help you explore Laravel packages today?