matraux / filesystem
A PHP 8.4+ library for object-oriented file and folder manipulation with support for PSR-7 and Nette\Http\FileUpload.
1.2.1
2025-08-15 12:16 UTC
Requires
- php: ^8.4
- nette/utils: ^4.0
Requires (Dev)
- contributte/qa: ^0.3.2
- nette/http: ^3.3
- nette/neon: ^3.4
- nette/tester: ^2.4
- phpstan/phpstan: ^2.1
- psr/http-message: 1.1
- tracy/tracy: ^2.10
Suggests
- nette/http: Required only if you use HTTP-specific features like Request, Session etc.
- psr/http-message: Required only if you use PSR HTTP message features.
README
Introduction
A PHP 8.4+ library that simplifies file and folder operations using an object-oriented API. Supports renaming, moving, streaming, and deletion with optional integration for PSR-7 and Nette\Http\FileUpload.
Features
- File and folder manipulation with fluent API
- Relative and absolute path resolution
- File iteration via chunks (stream-style)
- Automatic cleanup of temporary files
- PSR-7 stream support
Psr\Http\Message\StreamInterface
- Nette FileUpload support
Nette\Http\FileUpload
- Easy extension via inheritance
Installation
composer require matraux/filesystem
Requirements
version | PHP | Note |
---|---|---|
1.0.0 | 8.3+ | Initial commit |
1.0.9 | 8.3+ | Cache optimization |
1.1.1 | 8.4+ | Property accessor |
1.1.2 | 8.4+ | Quality Assurance |
1.1.4 | 8.4+ | Docs update |
1.2.1 | 8.4+ | Performance boost via cache |
Examples
See File for advanced instructions.
use Matraux\FileSystem\File\File; $file = File::fromPath('C:\Users\MATRAUX\Webs\Resources\FileSystem\log.txt'); echo $file->name; // "log.txt"
See Folder for advanced instructions.
use Matraux\FileSystem\Folder\Folder; $folder = Folder::create()->addPath('backup'); echo $folder->absolute; // "C:\Users\MATRAUX\Webs\Resources\FileSystem\backup"
Development
See Development for debug, test instructions, static analysis, and coding standards.
Support
For bug reports and feature requests, please use the issue tracker.