flaphl / filesystem
Filesystem abstractions pulled from Flaphl elements.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/flaphl/filesystem
Requires
- php: ^8.2
Requires (Dev)
- phpunit/phpunit: ^11.0 || ^12.0
README
Filesystem utilities pulled from Flaphl elements.
Installation
composer require flaphl/filesystem
Features
- Cross-platform compatibility - Works seamlessly on Windows, macOS, and Linux
- Comprehensive file operations - Read, write, copy, move, delete with proper error handling
- Directory management - Create, remove, mirror directories recursively
- Path utilities - Normalize, join, and manipulate file paths safely
- Security features - Path traversal protection and validation
- Exception-driven - Clear error reporting with typed exceptions
Basic Usage
use Flaphl\Element\Filesystem\Filesystem; use Flaphl\Element\Filesystem\Path; $fs = new Filesystem(); // Basic file operations $fs->writeFile('/path/to/file.txt', 'Hello World!'); $content = $fs->readFile('/path/to/file.txt'); // Directory operations $fs->mkdir('/path/to/directory'); $fs->copy('/source/directory', '/target/directory'); // Path utilities $normalized = Path::normalize('/path/../to/./file.txt'); // '/to/file.txt' $joined = Path::join('/base', 'subdir', 'file.txt'); // '/base/subdir/file.txt'