ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
|
Public Member Functions | |
__construct (Filesystem $filesystem) | |
Finder constructor. More... | |
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 () | |
Data Fields | |
const | IGNORE_VCS_FILES = 1 |
const | IGNORE_DOT_FILES = 2 |
Protected Attributes | |
$dirs = [] | |
Private Member Functions | |
searchInDirectory (string $dir) | |
Private Attributes | |
$filesystem | |
$vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg'] | |
$iterators = [] | |
$exclude = [] | |
$ignore = 0 | |
$mode = Iterator\FileTypeFilterIterator::ALL | |
$reverseSorting = false | |
$dates = [] | |
$sizes = [] | |
$depths = [] | |
$sort = false | |
Definition at line 17 of file Finder.php.
ILIAS\Filesystem\Finder\Finder::__construct | ( | Filesystem | $filesystem | ) |
Finder constructor.
Filesystem | $filesystem |
Definition at line 62 of file Finder.php.
References ILIAS\Filesystem\Finder\Finder\$filesystem.
ILIAS\Filesystem\Finder\Finder::addVCSPattern | ( | array | $pattern | ) |
ILIAS\Filesystem\Finder\Finder::allTypes | ( | ) |
Definition at line 93 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 |
Definition at line 330 of file Finder.php.
ILIAS\Filesystem\Finder\Finder::count | ( | ) |
Definition at line 431 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 181 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 157 of file Finder.php.
ILIAS\Filesystem\Finder\Finder::directories | ( | ) |
Definition at line 82 of file Finder.php.
References ILIAS\Filesystem\Finder\Iterator\FileTypeFilterIterator\ONLY_DIRECTORIES.
ILIAS\Filesystem\Finder\Finder::exclude | ( | array | $directories | ) |
string[] | $directories |
Definition at line 105 of file Finder.php.
Referenced by ILIAS\Filesystem\Finder\Finder\searchInDirectory().
ILIAS\Filesystem\Finder\Finder::files | ( | ) |
Definition at line 71 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(), and ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\rewind().
ILIAS\Filesystem\Finder\Finder::getIterator | ( | ) |
Definition at line 406 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 | ) |
bool | $ignoreVCS |
Definition at line 233 of file Finder.php.
References ILIAS\Filesystem\Finder\Finder\IGNORE_VCS_FILES.
ILIAS\Filesystem\Finder\Finder::in | ( | array | $directories | ) |
string[] | $directories |
Definition at line 127 of file Finder.php.
ILIAS\Filesystem\Finder\Finder::reverseSorting | ( | ) |
Definition at line 221 of file Finder.php.
Referenced by ILIAS\Filesystem\Finder\Finder\searchInDirectory().
|
private |
string | $dir |
Definition at line 359 of file Finder.php.
References ILIAS\Filesystem\Finder\Finder\exclude(), 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 203 of file Finder.php.
References $size, and 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 278 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 | ) |
bool | $useNaturalSort |
Definition at line 290 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 315 of file Finder.php.
References ILIAS\Filesystem\Finder\Iterator\SortableIterator\SORT_BY_TIME.
ILIAS\Filesystem\Finder\Finder::sortByType | ( | ) |
Definition at line 304 of file Finder.php.
References ILIAS\Filesystem\Finder\Iterator\SortableIterator\SORT_BY_TYPE.
|
private |
Definition at line 47 of file Finder.php.
|
private |
Definition at line 53 of file Finder.php.
|
protected |
Definition at line 32 of file Finder.php.
|
private |
Definition at line 35 of file Finder.php.
|
private |
Definition at line 23 of file Finder.php.
Referenced by ILIAS\Filesystem\Finder\Finder\__construct().
|
private |
Definition at line 38 of file Finder.php.
|
private |
Definition at line 29 of file Finder.php.
|
private |
Definition at line 41 of file Finder.php.
|
private |
Definition at line 44 of file Finder.php.
|
private |
Definition at line 50 of file Finder.php.
Referenced by ILIAS\Filesystem\Finder\Finder\size().
|
private |
Definition at line 56 of file Finder.php.
|
private |
Definition at line 26 of file Finder.php.
const ILIAS\Filesystem\Finder\Finder::IGNORE_DOT_FILES = 2 |
Definition at line 20 of file Finder.php.
const ILIAS\Filesystem\Finder\Finder::IGNORE_VCS_FILES = 1 |
Definition at line 19 of file Finder.php.
Referenced by ILIAS\Filesystem\Finder\Finder\ignoreVCS().