ILIAS
release_8 Revision v8.19-1-g4e8f2f9140c
|
Public Member Functions | |
__construct (Filesystem $filesystem) | |
files () | |
directories () | |
allTypes () | |
exclude (array $directories) | |
in (array $directories) | |
depth ($level) | |
Adds tests for the directory depth. More... | |
date (string $date) | |
Adds tests for file dates. More... | |
size ($sizes) | |
Adds tests for file sizes. More... | |
reverseSorting () | |
ignoreVCS (bool $ignoreVCS) | |
addVCSPattern (array $pattern) | |
sort (Closure $closure) | |
Sorts files and directories by an anonymous function. More... | |
sortByName (bool $useNaturalSort=false) | |
sortByType () | |
sortByTime () | |
append (iterable $iterator) | |
Appends an existing set of files/directories to the finder. More... | |
getIterator () | |
count () | |
Protected Attributes | |
array | $dirs = [] |
Private Member Functions | |
searchInDirectory (string $dir) | |
Private Attributes | |
const | IGNORE_VCS_FILES = 1 |
const | IGNORE_DOT_FILES = 2 |
ILIAS Filesystem Filesystem | $filesystem |
array | $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg'] |
array | $iterators = [] |
array | $exclude = [] |
int | $ignore = 0 |
int | $mode = Iterator\FileTypeFilterIterator::ALL |
bool | $reverseSorting = false |
array | $dates = [] |
array | $sizes = [] |
array | $depths = [] |
$sort = SortableIterator::SORT_BY_NONE | |
Definition at line 44 of file Finder.php.
ILIAS\Filesystem\Finder\Finder::__construct | ( | Filesystem | $filesystem | ) |
Definition at line 70 of file Finder.php.
References ILIAS\Filesystem\Finder\Finder\$filesystem, and ILIAS\Repository\filesystem().
ILIAS\Filesystem\Finder\Finder::addVCSPattern | ( | array | $pattern | ) |
string[] | $pattern |
InvalidArgumentException |
Definition at line 244 of file Finder.php.
ILIAS\Filesystem\Finder\Finder::allTypes | ( | ) |
Definition at line 92 of file Finder.php.
References ILIAS\Filesystem\Finder\Iterator\FileTypeFilterIterator\ALL.
ILIAS\Filesystem\Finder\Finder::append | ( | iterable | $iterator | ) |
Appends an existing set of files/directories to the finder.
The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array.
iterable | $iterator |
InvalidArgumentException | when the given argument is not iterable |
Definition at line 315 of file Finder.php.
ILIAS\Filesystem\Finder\Finder::count | ( | ) |
Definition at line 414 of file Finder.php.
References ILIAS\Filesystem\Finder\Finder\getIterator().
Referenced by ILIAS\Filesystem\Finder\Finder\getIterator().
ILIAS\Filesystem\Finder\Finder::date | ( | string | $date | ) |
Adds tests for file dates.
The date must be something that strtotime() is able to parse:
$finder->date('since yesterday'); $finder->date('until 2 days ago'); $finder->date('> now - 2 hours'); $finder->date('>= 2005-10-15');
string | $date | A date range string |
Definition at line 182 of file Finder.php.
ILIAS\Filesystem\Finder\Finder::depth | ( | $level | ) |
Adds tests for the directory depth.
Usage:
$finder->depth('> 1') // the Finder will start matching at level 1. $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point.
string | int | $level | The depth level expression |
Definition at line 158 of file Finder.php.
ILIAS\Filesystem\Finder\Finder::directories | ( | ) |
Definition at line 84 of file Finder.php.
References ILIAS\Filesystem\Finder\Iterator\FileTypeFilterIterator\ONLY_DIRECTORIES.
ILIAS\Filesystem\Finder\Finder::exclude | ( | array | $directories | ) |
string[] | $directories |
InvalidArgumentException |
Definition at line 105 of file Finder.php.
Referenced by ILIAS\Filesystem\Finder\Finder\searchInDirectory().
ILIAS\Filesystem\Finder\Finder::files | ( | ) |
Definition at line 76 of file Finder.php.
References ILIAS\Filesystem\Finder\Iterator\FileTypeFilterIterator\ONLY_FILES.
Referenced by ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\current(), ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\key(), ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\next(), ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\rewind(), and ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\valid().
ILIAS\Filesystem\Finder\Finder::getIterator | ( | ) |
LogicException |
Definition at line 389 of file Finder.php.
References ILIAS\Filesystem\Finder\Finder\count(), and ILIAS\Filesystem\Finder\Finder\searchInDirectory().
Referenced by ILIAS\Filesystem\Finder\Finder\count().
ILIAS\Filesystem\Finder\Finder::ignoreVCS | ( | bool | $ignoreVCS | ) |
Definition at line 227 of file Finder.php.
References ILIAS\Filesystem\Finder\Finder\IGNORE_VCS_FILES.
ILIAS\Filesystem\Finder\Finder::in | ( | array | $directories | ) |
string[] | $directories |
InvalidArgumentException |
Definition at line 128 of file Finder.php.
ILIAS\Filesystem\Finder\Finder::reverseSorting | ( | ) |
Definition at line 219 of file Finder.php.
Referenced by ILIAS\Filesystem\Finder\Finder\searchInDirectory().
|
private |
Definition at line 340 of file Finder.php.
References ILIAS\Filesystem\Finder\Finder\exclude(), ILIAS\Repository\filesystem(), ILIAS\Filesystem\Finder\Finder\reverseSorting(), and ILIAS\Filesystem\Finder\Finder\sort().
Referenced by ILIAS\Filesystem\Finder\Finder\getIterator().
ILIAS\Filesystem\Finder\Finder::size | ( | $sizes | ) |
Adds tests for file sizes.
$finder->size('> 10K'); $finder->size('<= 1Ki'); $finder->size(4); $finder->size(['> 10K', '< 20K'])
string|int|string[]|int[] | $sizes A size range string or an integer or an array of size ranges |
Definition at line 204 of file Finder.php.
References ILIAS\Filesystem\Finder\Finder\$sizes.
ILIAS\Filesystem\Finder\Finder::sort | ( | Closure | $closure | ) |
Sorts files and directories by an anonymous function.
The anonymous function receives two Metadata instances to compare. This can be slow as all the matching files and directories must be retrieved for comparison.
Closure | $closure |
Definition at line 273 of file Finder.php.
Referenced by ILIAS\Filesystem\Finder\Iterator\SortableIterator\__construct(), ILIAS\Filesystem\Finder\Iterator\SortableIterator\getIterator(), and ILIAS\Filesystem\Finder\Finder\searchInDirectory().
ILIAS\Filesystem\Finder\Finder::sortByName | ( | bool | $useNaturalSort = false | ) |
Definition at line 281 of file Finder.php.
References ILIAS\Filesystem\Finder\Iterator\SortableIterator\SORT_BY_NAME, and ILIAS\Filesystem\Finder\Iterator\SortableIterator\SORT_BY_NAME_NATURAL.
ILIAS\Filesystem\Finder\Finder::sortByTime | ( | ) |
Definition at line 300 of file Finder.php.
References ILIAS\Filesystem\Finder\Iterator\SortableIterator\SORT_BY_TIME.
ILIAS\Filesystem\Finder\Finder::sortByType | ( | ) |
Definition at line 292 of file Finder.php.
References ILIAS\Filesystem\Finder\Iterator\SortableIterator\SORT_BY_TYPE.
|
private |
Definition at line 62 of file Finder.php.
|
private |
Definition at line 66 of file Finder.php.
|
protected |
Definition at line 55 of file Finder.php.
|
private |
Definition at line 57 of file Finder.php.
|
private |
Definition at line 49 of file Finder.php.
Referenced by ILIAS\Filesystem\Finder\Finder\__construct().
|
private |
Definition at line 58 of file Finder.php.
|
private |
Definition at line 53 of file Finder.php.
|
private |
Definition at line 59 of file Finder.php.
|
private |
Definition at line 60 of file Finder.php.
|
private |
Definition at line 64 of file Finder.php.
Referenced by ILIAS\Filesystem\Finder\Finder\size().
|
private |
Definition at line 68 of file Finder.php.
|
private |
Definition at line 51 of file Finder.php.
|
private |
Definition at line 47 of file Finder.php.
|
private |
Definition at line 46 of file Finder.php.
Referenced by ILIAS\Filesystem\Finder\Finder\ignoreVCS().