chillerlan / php-filereader
A simple filereader. PHP 7.2+
Installs: 1 556
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: ^7.2
Requires (Dev)
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2024-12-07 16:09:29 UTC
README
A simple file/directory reader for all (well, most... ok. some.) of your file-reading needs.
Requirements
- PHP 7.2+
Documentation
Installation
requires composer
composer.json
(note: replace dev-master
with a version boundary)
{ "require": { "php": ">=7.2.0", "chillerlan/database": "dev-master" } }
Manual installation
Download the desired version of the package from master or release and extract the contents to your project folder. After that:
- run
composer install
to install the required dependencies and generate/vendor/autoload.php
. - if you use a custom autoloader, point the namespace
chillerlan\Filereader
to the foldersrc
of the package
Profit!
Usage
simple
You can just invoke one a FSDriverInterface
and use it right away:
use chillerlan\Filereader\Drivers\DiskDriver; $filereader = new DiskDriver; $filereader->isDir('/some/path');
advanced
$directory = new Directory($filereader, '/some/path'); /** @var \chillerlan\Filereader\File $file */ foreach($directory->read() as $file){ echo $file->name; // ... }