symfony API

sfFinder Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.2 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.2 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

  • args_to_array($arg_list, $not = false)
  • object current discard((list) 0)
    Discards elements that matches.
  • object current exec(0)
    Executes function or method for each element.
  • exec_ok($dir, $entry)
  • object current follow_link()
    Symlink following.
  • get_type()
  • object current ignore_version_control($ignore = true)
    Ignores version control directories.
  • array in()
    Searches files and directories which match defined rules.
  • isPathAbsolute($path)
  • is_discarded($dir, $entry)
  • is_pruned($dir, $entry)
  • match_names($dir, $entry)
  • object current maxdepth($level)
    Sets maximum directory depth.
  • object current mindepth($level)
    Sets minimum directory depth.
  • object current name((list) 0)
    Adds rules that files must match.
  • object current not_name((list) 0)
    Adds rules that files must not match.
  • object current prune((list) 0)
    Traverses no further.
  • object current relative()
    Returns relative paths for all files and directories.
  • search_in($dir, $depth)
  • setType($name)
  • object current size((list) 0)
    Adds tests for file sizes.
  • size_ok($dir, $entry)
  • object current sort_by_name()
    Returns files and directories ordered by name
  • object current sort_by_type()
    Returns files and directories ordered by type (directories before files), then by name
  • to_regex($str)
  • object new type($name)
    Sets the type of elements to returns.

Method Details

  • args_to_array ($arg_list, $not = false) Browse code

    $arg_list
    $not

  • (object current) discard ((list) 0) Browse code

    0 a list of patterns, globs to match

    Discards elements that matches.

    returns sfFinder object

  • (object current) exec (0) Browse code

    0 function or method to call

    Executes function or method for each element.


    Element match if functino or method returns true.

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

    returns sfFinder object

  • exec_ok ($dir, $entry) Browse code

    $dir
    $entry

  • (object current) follow_link () Browse code

    Symlink following.

    returns sfFinder object

  • get_type () Browse code

  • (object current) ignore_version_control ($ignore = true) 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 sfFinder object

  • (array) in () Browse code

    Searches files and directories which match defined rules.

    returns list of files and directories

  • isPathAbsolute ($path) Browse code

    $path

  • is_discarded ($dir, $entry) Browse code

    $dir
    $entry

  • is_pruned ($dir, $entry) Browse code

    $dir
    $entry

  • match_names ($dir, $entry) Browse code

    $dir
    $entry

  • (object current) maxdepth ($level) Browse code

    $level

    Sets maximum directory depth.


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

    returns sfFinder object

  • (object current) mindepth ($level) Browse code

    $level

    Sets minimum directory depth.


    Finder will start applying tests at level $level.

    returns sfFinder object

  • (object current) name ((list) 0) Browse code

    0 a list of patterns, globs or strings

    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 sfFinder object

  • (object current) not_name ((list) 0) Browse code

    0 a list of patterns, globs or strings

    Adds rules that files must not match.

    returns sfFinder object

  • (object current) prune ((list) 0) Browse code

    0 a list of patterns, globs to match

    Traverses no further.

    returns sfFinder object

  • (object current) relative () Browse code

    Returns relative paths for all files and directories.

    returns sfFinder object

  • search_in ($dir, $depth) Browse code

    $dir
    $depth

  • setType ($name) Browse code

    $name

  • (object current) size ((list) 0) Browse code

    0 a list of comparison strings

    Adds tests for file sizes.


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

    returns sfFinder object

  • size_ok ($dir, $entry) Browse code

    $dir
    $entry

  • (object current) sort_by_name () Browse code

    Returns files and directories ordered by name

    returns sfFinder object

  • (object current) sort_by_type () Browse code

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

    returns sfFinder object

  • to_regex ($str) Browse code

    $str

  • (object new) type ($name) Browse code

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

    Sets the type of elements to returns.

    returns sfFinder object