fidry/filesystem
A tiny wrapper around Symfony Filesystem offering a FileSystem interface and utilities for path escaping, real and normalized paths, and temporary files and directories, including support for custom stream wrappers.
2.0.1 delta: Adds Symfony 8 support (#67). No breaking changes, no deprecations, no API additions. This is a dependency-compatibility release that materially changes the package's forward-compatibility profile and its versioning story.
^7.0 || ^8.0) means a single package version serves Laravel 11/12 today (Symfony 7) and the next Laravel major (Symfony 8) without a coordinated upgrade — valuable for multi-app or multi-version monorepos.escapePath, realPath, normalizedRealPath), temporary file/directory utilities (tmpFile, tmpDir), and read-only filesystem modes—useful for testing, sandboxing, or security-sensitive operations.FileSystemTestCase, SplFileInfoFactory, and SplFileInfoBuilder simplify unit/integration testing, especially for file-heavy workflows (e.g., migrations, exports).Storage facade, FilesystemManager).tmpFile/tmpDir may duplicate Laravel’s storage_path() + tempnam() patterns. Assess redundancy before adoption.createMock()).2.0.1 patch is a semver-smell. It signals relaxed release discipline — treat the version number as advisory and read the changelog on every bump rather than assuming patch = safe.FileSystem interface can be bound to Laravel’s IoC, replacing or extending Symfony’s Filesystem component.FS static class could wrap a facade (e.g., Filesystem::class), though static usage is discouraged in Laravel.Storage facade for filesystem operations, but lacks cloud storage (S3, etc.) support—unlike Flysystem.^8.0 bump, which would silently drop Laravel 11/12 support.FileSystemTestCase, SplFileInfoBuilder) before rolling out core filesystem methods.SplFileInfo::getContents()), but Laravel’s Storage facade already mitigates this via read().escapePath) may conflict with Laravel’s str() helpers or Path facade.tmpFile/tmpDir could clash with Laravel’s storage_path('app') or sys_get_temp_dir() patterns.createFinder() extends Symfony’s Finder, but Laravel’s Illuminate\Support\Facades\File uses a different API.Finder internals). Dev/prod environments running different PHP versions may silently exercise different Symfony majors.SplFileInfo builders may require refactoring existing mocks in test suites.escapePath/realPath could introduce inconsistencies if not uniformly applied across the codebase.ReadOnlyFileSystem may not align with Laravel’s eager-loading or caching behaviors.Storage facade, File helper, or Path facade already cover 80% of the package’s utility?FileSystemTestCase/SplFileInfoBuilder reduce test maintenance costs significantly?escapePath) a recurring issue in your deployment pipeline?^7.0 || ^8.0, or did 2.0.1 replace ^7.0 with ^8.0? The latter would break Laravel 11/12 installs despite the patch version.SplFileInfo with SplFileInfoBuilder/SplFileInfoFactory.escapePath/realPath in CLI commands or deployment scripts.ReadOnlyFileSystem for read-heavy operations (e.g., analytics, reporting).tmpFile/tmpDir for large file processing (e.g., exports, backups).FileSystem interface to a concrete implementation (e.g., NativeFileSystem or a custom wrapper).FS static class for one-off filesystem tasks.createFinder() for file-watching logic (e.g., filesystem.updated events).Storage facade for the same operations (e.g., use Storage::disk()->exists() instead of isReadable()).FS static class in production code; prefer dependency injection.composer.json for the symfony/filesystem and php constraints.^7.0 and ^8.0 are permitted and that Symfony 6 removal (if any) does not affect your Laravel version.composer why symfony/filesystem on your target hosts before upgrading.SplFileInfo mocks in tests with SplFileInfoBuilder.FileSystemTestCase for file-heavy test suites (e.g., migrations, imports).Filesystem component with Fidry\FileSystem\FileSystem in service bindings.escapePath/realPath for cross-platform consistency.ReadOnlyFileSystem for read-only operations (e.g., API responses, cached data).tmpFile/tmpDir for temporary file operations in jobs/queues.Filesystem component, now spanning Symfony 7 and 8.readFile() may shadow Laravel’s Storage::read() if not namespaced carefully.escapePath doesn’t conflict with Path::make() or str() helpers.Storage:: methods for disk operations to avoid duplication.ext-mbstring (fixed in v1.2.2+), which is enabled by default in Laravel.| Priority | Task | Dependencies |
|---|---|---|
| High | Verify 2.0.1 constraint is a Symfony 7/8 union, not a hard ^8.0. |
None |
| High | Replace SplFileInfo mocks in tests with SplFileInfoBuilder. |
None |
| High | Bind FileSystem interface to Laravel’s IoC. |
Symfony Filesystem component |
| Medium | Update path-handling logic to use escapePath/realPath. |
Cross-platform path issues identified |
| Medium | Align PHP version across dev/CI/prod to avoid Symfony-major drift. | Host/PHP upgrade plan |
| Low | Replace tempnam() with tmpFile/tmpDir in jobs/commands. |
Existing temp file logic |
| Low | Implement ReadOnlyFileSystem for read-heavy operations. |
Testing validation |
SplFileInfoBuilder) cut down on mock setup time.escapePath/realPath reduce path-related bugs in deployments.composer.json and CI pipelines.SplFileInfo::getContents()) are deprecated; monitor Laravel’s alignment.Storage adapters (e.g., S3, FTP).tmpFile/tmpDir could strain disk I/O under high concurrency (e.g., bulk exports).How can I help you explore Laravel packages today?