Documentation

rex_finder
in package
implements IteratorAggregate, Countable Uses rex_factory_trait

Finder.

Tags
author

staabm

author

gharlan

implements

IteratorAggregate<string, SplFileInfo>

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
$this

dirsOnly()

Fetch dirs only.

public dirsOnly() : $this
Return values
$this

factory()

Returns a new finder object.

public static factory(string $dir) : static
Parameters
$dir : string

Path to a directory

Tags
throws
InvalidArgumentException
Return values
static

filesOnly()

Fetch files only.

public filesOnly() : $this
Return values
$this

getIterator()

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
$this

ignoreFiles()

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
$this

ignoreSystemStuff()

Ignores system stuff (like .DS_Store, .svn, .git etc.).

public ignoreSystemStuff([bool $ignoreSystemStuff = true ]) : $this
Parameters
$ignoreSystemStuff : bool = true
Return values
$this

recursive()

Activate/Deactivate recursive directory scanning.

public recursive([bool $recursive = true ]) : $this
Parameters
$recursive : bool = true
Return values
$this

selfFirst()

Fetch directory contents before recurse its subdirectories.

public selfFirst() : $this
Return values
$this

sort()

Sorts the elements.

public sort([mixed $sort = rex_sortable_iterator::KEYS ]) : $this
Parameters
$sort : mixed = rex_sortable_iterator::KEYS
Return values
$this

        
On this page

Search results