symfony API

sfFinder Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.0 API OpenSearch

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

  • (object) discard () Browse code

    Discards elements that matches.

    returns current sfFinder object

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

  • exec_ok () Browse code

  • (object) follow_link () Browse code

    Symlink following.

    returns current sfFinder object

  • get_type () Browse code

  • (object) ignore_version_control () Browse code

    Ignores version control directories.


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

    returns current pakeFinder 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

  • (object) maxdepth () Browse code

    Sets maximum directory depth.


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

    returns current sfFinder object

  • (object) mindepth () Browse code

    Sets minimum directory depth.


    Finder will start applying tests at level $level.

    returns current sfFinder object

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

  • (object) not_name () Browse code

    Adds rules that files must not match.

    returns current sfFinder object

  • (object) prune () Browse code

    Traverses no further.

    returns current sfFinder object

  • (object) relative () Browse code

    Returns relative paths for all files and directories.

    returns current sfFinder object

  • search_in () Browse code

  • (object) size () Browse code

    Adds tests for file sizes.


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

    returns current sfFinder object

  • size_ok () Browse code

  • to_regex () Browse code

  • (object) type () Browse code

    Sets the type of elements to returns.

    returns new sfFinder object