rosell-dk / file-util
Functions for dealing with files and paths
Installs: 3 629 949
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- php: >=5.4
- rosell-dk/exec-with-fallback: ^1.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.11
- mikey179/vfsstream: ^1.6
- phpstan/phpstan: ^1.5
- phpunit/phpunit: ^9.3
- squizlabs/php_codesniffer: 3.*
This package is auto-updated.
Last update: 2024-09-19 17:05:58 UTC
README
Just a bunch of handy methods for dealing with files and paths:
-
FileExists::fileExists($path):
A well-behaved version of file_exists that throws upon failure rather than emitting a warning -
FileExists::fileExistsTryHarder($path):
Also well-behaved. Tries FileExists::fileExists(). In case of failure, tries exec()-based implementation -
PathValidator::checkPath($path):
Check if path looks valid and doesn't contain suspecious patterns -
PathValidator::checkFilePathIsRegularFile($path):
Check if path points to a regular file (and doesnt match suspecious patterns)