symfony API

sfFinder Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

Packages

You are currently browsing the symfony API for the 1.4 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

Allow to build rules to find files and directories.

Method Summary

Method Details

  • args_to_array ()

  • (sfFinder) discard ()

    Discards elements that matches.

    returns Current object

  • (sfFinder) exec ()

    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 ()

  • (sfFinder) follow_link ()

    Symlink following.

    returns Current object

  • get_type ()

  • (sfFinder) ignore_version_control ($ignore)

    $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 ()

    Searches files and directories which match defined rules.

    returns list of files and directories

  • isPathAbsolute ()

  • is_discarded ()

  • is_pruned ()

  • match_names ()

  • (sfFinder) maxdepth ($level)

    Sets maximum directory depth.


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

    returns current sfFinder object

  • (sfFinder) mindepth ($level)

    Sets minimum directory depth.


    Finder will start applying tests at level $level.

    returns current sfFinder object

  • (sfFinder) name ()

    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 ()

    Adds rules that files must not match.

    returns Current object

  • (sfFinder) prune ()

    Traverses no further.

    returns Current object

  • (sfFinder) relative ()

    Returns relative paths for all files and directories.

    returns Current object

  • search_in ()

  • (sfFinder) setType ($name)

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

    Sets the type of elements to returns.

    returns Current object

  • (sfFinder) size ()

    Adds tests for file sizes.


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

    returns Current object

  • size_ok ()

  • (sfFinder) sort_by_name ()

    Returns files and directories ordered by name

    returns Current object

  • (sfFinder) sort_by_type ()

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

    returns Current object

  • to_regex ()

  • (sfFinder) type ($name)

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

    Sets the type of elements to returns.

    returns new sfFinder object