lifephp / utils
These are PHP Utils from LIFE.
v4.1.1
2026-09-07 22:26 UTC
Requires
- php: >=8.5
- ext-mbstring: *
- ext-posix: *
- ext-zlib: *
Requires (Dev)
- lifephp/coding-standards: ^2.2
- mockery/mockery: ^1.6
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^13.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
LIFE PHP Utils
LIFE PHP Utils are tools for you, to make your work easier in PHP.
Usage
Best way to install lifephp/utils is via Composer:
composer require lifephp/utils
What's inside
| Class | Purpose |
|---|---|
FileSystem | Atomic & safe file operations — openAtomic() / closeAtomic() streaming (incl. gzip), saveAtomic(), safeWrite() / safeRead(), loadAtomic(), requireAtomic(), abortAtomic(), removeAtomic(), plus normalizePath(), createDir(), chmod(). |
FileObject | SplFileObject extension with transparent gzip (.gz) read/write and temp-file handling. |
FileInfo | SplFileInfo extension — normalized extension, chmod(), openFile(). |
Convertors | strToScalar() string-to-scalar coercion, isEnclosed(). |
Paginator | Offset / page-count / page-bounds helper. |
Html | htmlToText(). |
ExceptionHelper | getLastError() — last PHP error as a string. |
StaticClassTrait | Marks a class as non-instantiable. |
Exceptions (LifePHP\Utils\Exceptions): IOException, InvalidArgumentException, MemberAccessException, RuntimeException.
Documentation
Detailed docs live in /.docs.
Versions
| State | Version | Branch | PHP |
|---|---|---|---|
| stable | ^4.0.0 | PHP8.5 | >=8.5 |
| stable | ^3.3.0 | PHP8.4 | >=8.4 |
Development
These are actual code maintainers:
Conclusion
This package requires PHP 8.5, and it is property of LifePHP © 2024-2026