rex_finder
in package
implements
IteratorAggregate, Countable
Uses
rex_factory_trait
Finder.
Tags
Table of Contents
Interfaces
- IteratorAggregate
- Countable
Constants
- ALL = '__ALL__'
Methods
- childFirst() : $this
- Fetch child directories before their parent directory.
- count() : mixed
- dirsOnly() : $this
- Fetch dirs only.
- factory() : static
- Returns a new finder object.
- filesOnly() : $this
- Fetch files only.
- getIterator() : Traversable<string, SplFileInfo>
- ignoreDirs() : $this
- Ignore all directories which match the given glob pattern.
- ignoreFiles() : $this
- Ignore all files which match the given glob pattern.
- ignoreSystemStuff() : $this
- Ignores system stuff (like .DS_Store, .svn, .git etc.).
- recursive() : $this
- Activate/Deactivate recursive directory scanning.
- selfFirst() : $this
- Fetch directory contents before recurse its subdirectories.
- sort() : $this
- Sorts the elements.
Constants
ALL
public
mixed
ALL
= '__ALL__'
Methods
childFirst()
Fetch child directories before their parent directory.
public
childFirst() : $this
Return values
$thiscount()
public
count() : mixed
dirsOnly()
Fetch dirs only.
public
dirsOnly() : $this
Return values
$thisfactory()
Returns a new finder object.
public
static factory(string $dir) : static
Parameters
- $dir : string
-
Path to a directory
Tags
Return values
staticfilesOnly()
Fetch files only.
public
filesOnly() : $this
Return values
$thisgetIterator()
public
getIterator() : Traversable<string, SplFileInfo>
Return values
Traversable<string, SplFileInfo>ignoreDirs()
Ignore all directories which match the given glob pattern.
public
ignoreDirs(string|array<int, string> $glob[, bool $recursive = true ]) : $this
Parameters
- $glob : string|array<int, string>
-
Glob pattern or an array of glob patterns
- $recursive : bool = true
-
When FALSE the patterns won't be checked in child directories
Return values
$thisignoreFiles()
Ignore all files which match the given glob pattern.
public
ignoreFiles(string|array<int, string> $glob[, bool $recursive = true ]) : $this
Parameters
- $glob : string|array<int, string>
-
Glob pattern or an array of glob patterns
- $recursive : bool = true
-
When FALSE the patterns won't be checked in child directories
Return values
$thisignoreSystemStuff()
Ignores system stuff (like .DS_Store, .svn, .git etc.).
public
ignoreSystemStuff([bool $ignoreSystemStuff = true ]) : $this
Parameters
- $ignoreSystemStuff : bool = true
Return values
$thisrecursive()
Activate/Deactivate recursive directory scanning.
public
recursive([bool $recursive = true ]) : $this
Parameters
- $recursive : bool = true
Return values
$thisselfFirst()
Fetch directory contents before recurse its subdirectories.
public
selfFirst() : $this
Return values
$thissort()
Sorts the elements.
public
sort([mixed $sort = rex_sortable_iterator::KEYS ]) : $this
Parameters
- $sort : mixed = rex_sortable_iterator::KEYS