Class NFinder
Finder allows searching through directory trees using iterator.
NFinder::findFiles('*.php')
->size('> 10kB')
->from('.')
->exclude('temp');
-
NObject
-
NFinder
implements
IteratorAggregate
Methods summary
public static
NFinder
|
#
find( mixed $mask )
Begins search for files matching mask and all directories.
Begins search for files matching mask and all directories.
Parameters
Returns
|
public static
NFinder
|
#
findFiles( mixed $mask )
Begins search for files matching mask.
Begins search for files matching mask.
Parameters
Returns
|
public static
NFinder
|
#
findDirectories( mixed $mask )
Begins search for directories matching mask.
Begins search for directories matching mask.
Parameters
Returns
|
public
NFinder
|
#
in( string|array $path )
Searchs in the given folder(s).
Searchs in the given folder(s).
Parameters
Returns
|
public
NFinder
|
#
from( string|array $path )
Searchs recursively from the given folder(s).
Searchs recursively from the given folder(s).
Parameters
Returns
|
public
NFinder
|
#
childFirst( )
Shows folder content prior to the folder.
Shows folder content prior to the folder.
Returns
|
public
Iterator
|
#
getIterator( )
Returns iterator.
Returns
Implementation of
|
public
NFinder
|
#
exclude( mixed $masks )
Restricts the search using mask. Excludes directories from recursive
traversing.
Restricts the search using mask. Excludes directories from recursive
traversing.
Parameters
Returns
|
public
NFinder
|
#
filter( callable $callback )
Restricts the search using callback.
Restricts the search using callback.
Parameters
Returns
|
public
NFinder
|
#
limitDepth( integer $depth )
Limits recursion level.
Parameters
Returns
|
public
NFinder
|
#
size( string $operator, integer $size = NULL )
Restricts the search by size.
Restricts the search by size.
Parameters
- $operator
string "[operator] [size] [unit]" example: >=10kB
- $size
integer
Returns
|
public
NFinder
|
#
date( string $operator, mixed $date = NULL )
Restricts the search by modified time.
Restricts the search by modified time.
Parameters
- $operator
string "[operator] [date]" example: >1978-01-23
- $date
mixed
Returns
|
public static
boolean
|
#
compare( mixed $l, mixed $operator, $r )
Compares two values.
Parameters
- $l
mixed
- $operator
mixed
- $r
Returns
boolean
|