Download the PHP package likeajohny/php-fs without Composer
On this page you can find all versions of the php package likeajohny/php-fs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download likeajohny/php-fs
More information about likeajohny/php-fs
Files in likeajohny/php-fs
Package php-fs
Short Description Tools to help you get around the filesystem with PHP.
License MIT
Informations about the package php-fs
PHP FS (Filesystem Helpers)
A lightweight, production-ready PHP library for filesystem operations with proper validation, error handling, and comprehensive features.
Features
- Static utility classes - Clean, simple API with no instantiation required
- Proper exception hierarchy - Granular exception types for precise error handling
- Memory-efficient operations - Stream-based operations for large files
- File locking - Concurrent access protection
- Atomic writes - Prevent partial writes on failure
- Symbolic link support - Create, read, and manipulate symlinks
- Path utilities - Safe path manipulation and traversal prevention
- Dry-run mode - Preview destructive operations before executing
Requirements
- PHP 8.0+
- ext-fileinfo
Install
Quick Start
API Reference
File Class
Constants
Basic Operations
Advanced Operations
Streaming Operations
Symbolic Links
Directory Class
Constants
Basic Operations
Listing Operations
Symbolic Links
Path Class
Exception Hierarchy
The library provides a granular exception hierarchy for precise error handling:
Exception Factory Methods
Catching Specific Exceptions
Dry-Run Mode
Preview destructive operations before executing them:
Examples
Memory-Efficient Large File Processing
Concurrent File Access
Atomic Configuration Updates
Safe Path Handling
Finding Files with Filters
Migration Guide
Permission Defaults Change
Version 3.0 changes default file permissions from 0766 to 0644 and directory permissions from 0766 to 0755. This is the standard Unix convention.
If you rely on the old defaults, explicitly pass the permissions:
Return Types
Directory::copy()now returnsbool(wasvoid)Directory::empty()now returnsbool(wasvoid)File::append()now returns only bytes written (not total file size)
Testing
Contributing
Issues and pull requests are welcome at https://github.com/likeajohny/php-fs
License
MIT
All versions of php-fs with dependencies
ext-fileinfo Version *