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

  • (object) discard ()

    Discards elements that matches.

    returns current sfFinder object

  • (object) 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 sfFinder object

  • exec_ok ()

  • (object) follow_link ()

    Symlink following.

    returns current sfFinder object

  • get_type ()

  • (object) ignore_version_control ()

    Ignores version control directories.


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

    returns current pakeFinder object

  • (array) in ()

    Searches files and directories which match defined rules.

    returns list of files and directories

  • isPathAbsolute ()

  • is_discarded ()

  • is_pruned ()

  • match_names ()

  • (object) maxdepth ()

    Sets maximum directory depth.


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

    returns current sfFinder object

  • (object) mindepth ()

    Sets minimum directory depth.


    Finder will start applying tests at level $level.

    returns current sfFinder object

  • (object) 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 sfFinder object

  • (object) not_name ()

    Adds rules that files must not match.

    returns current sfFinder object

  • (object) prune ()

    Traverses no further.

    returns current sfFinder object

  • (object) relative ()

    Returns relative paths for all files and directories.

    returns current sfFinder object

  • search_in ()

  • (object) size ()

    Adds tests for file sizes.


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

    returns current sfFinder object

  • size_ok ()

  • to_regex ()

  • (object) type ()

    Sets the type of elements to returns.

    returns new sfFinder object