Download the PHP package sgh/comparable-filesystem without Composer
On this page you can find all versions of the php package sgh/comparable-filesystem. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sgh/comparable-filesystem
More information about sgh/comparable-filesystem
Files in sgh/comparable-filesystem
Package comparable-filesystem
Short Description Provides Comparators for the file system.
License MIT
Homepage https://github.com/schmengler/comparable-filesystem
Informations about the package comparable-filesystem
Comparable-Filesystem
This package provides Comparators for the file system, i.e. for SplFileInfo objects. They can be used with the sorting and comparing tools in the Comparable package.
Requirements
The package requires PHP 5.4 or later and the Comparable package in version 1.0 or later.
Install
Via Composer
Usage
The following comparators are available:
- FileATimeComparator
- FileCTimeComparator
- FileMTimeComparator
- FileNameComparator
- FileSizeComparator
- FileTypeComparator
You can use all the methods in \SGH\Comparable\SortFunctions
and \SGH\Comparable\SetFunctions
with the comparators.
If you prefer, you can also use the factory method ::callback()
to retrieve a comparison callback, that can be used
in any function that expects a user defined comparison callback:
usort($arrayOfFiles, \SGH\Comparable\Filesystem\Comparator\FileSizeComparator::callback());
Testing
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Fabian Schmengler(https://github.com/schmengler)
- All Contributors
License
The MIT License (MIT). Please see License File for more information.