symfony API

sfFinder Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.3 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.3 version. Switch to:

Allow to build rules to find files and directories.

Method Summary

Method Details

  • args_to_array () Browse code

  • (sfFinder) discard () Browse code

    Discards elements that matches.

    returns Current object

  • (sfFinder) exec () Browse code

    Executes function or method for each element.


    Element match if functino or method returns true.

    $finder->exec('myfunction');
    $finder->exec(array($object, 'mymethod'));

    returns Current object

  • exec_ok () Browse code

  • (sfFinder) follow_link () Browse code

    Symlink following.

    returns Current object

  • get_type () Browse code

  • (sfFinder) ignore_version_control ($ignore) Browse code

    $ignore falase when version control directories shall be included (default is true)

    Ignores version control directories.


    Currently supports Subversion, CVS, DARCS, Gnu Arch, Monotone, Bazaar-NG, GIT, Mercurial

    returns Current object

  • (array) in () Browse code

    Searches files and directories which match defined rules.

    returns list of files and directories

  • isPathAbsolute () Browse code

  • is_discarded () Browse code

  • is_pruned () Browse code

  • match_names () Browse code

  • (sfFinder) maxdepth ($level) Browse code

    Sets maximum directory depth.


    Finder will descend at most $level levels of directories below the starting point.

    returns current sfFinder object

  • (sfFinder) mindepth ($level) Browse code

    Sets minimum directory depth.


    Finder will start applying tests at level $level.

    returns current sfFinder object

  • (sfFinder) name () Browse code

    Adds rules that files must match.


    You can use patterns (delimited with / sign), globs or simple strings.

    $finder->name('*.php')
    $finder->name('/\.php$/') // same as above
    $finder->name('test.php')

    returns Current object

  • (sfFinder) not_name () Browse code

    Adds rules that files must not match.

    returns Current object

  • (sfFinder) prune () Browse code

    Traverses no further.

    returns Current object

  • (sfFinder) relative () Browse code

    Returns relative paths for all files and directories.

    returns Current object

  • search_in () Browse code

  • (sfFinder) setType ($name) Browse code

    $name directory or file or any (for both file and directory)

    Sets the type of elements to returns.

    returns Current object

  • (sfFinder) size () Browse code

    Adds tests for file sizes.


    $finder->size('> 10K');
    $finder->size('<= 1Ki');
    $finder->size(4);

    returns Current object

  • size_ok () Browse code

  • (sfFinder) sort_by_name () Browse code

    Returns files and directories ordered by name

    returns Current object

  • (sfFinder) sort_by_type () Browse code

    Returns files and directories ordered by type (directories before files), then by name

    returns Current object

  • to_regex () Browse code

  • (sfFinder) type ($name) Browse code

    $name directory or file or any (for both file and directory)

    Sets the type of elements to returns.

    returns new sfFinder object