[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/pake/ -> pakeFinder.class.php (sommaire)

(pas de description)

Author: Fabien Potencier <fabien.potencier@symfony-project.com>
Copyright: 2004-2005 Fabien Potencier <fabien.potencier@symfony-project.com>
License: see the LICENSE file included in the distribution
Version: SVN: $Id: pakeFinder.class.php 3268 2007-01-13 20:19:33Z fabien $
Poids: 538 lignes (12 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

pakeFinder:: (23 méthodes):
  maxdepth()
  mindepth()
  get_type()
  type()
  to_regex()
  args_to_array()
  name()
  not_name()
  size()
  prune()
  discard()
  ignore_version_control()
  exec()
  relative()
  follow_link()
  in()
  search_in()
  match_names()
  size_ok()
  is_pruned()
  is_discarded()
  exec_ok()
  isPathAbsolute()


Classe: pakeFinder  - X-Ref

Allow to build rules to find files and directories.

All rules may be invoked several times, except for ->in() method.
Some rules are cumulative (->name() for example) whereas others are destructive
(most recent value is used, ->maxdepth() method for example).

All methods return the current pakeFinder object to allow easy chaining:

$files = pakeFinder::type('file')->name('*.php')->in(.);

Interface loosely based on perl File::Find::Rule module.

maxdepth($level)   X-Ref
Sets maximum directory depth.

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

param: integer level
return: object current pakeFinder object

mindepth($level)   X-Ref
Sets minimum directory depth.

Finder will start applying tests at level $level.

param: integer level
return: object current pakeFinder object

get_type()   X-Ref
Pas de description

type($name)   X-Ref
Sets the type of elements to returns.

param: string directory or file or any (for both file and directory)
return: object new pakeFinder object

to_regex($str)   X-Ref
Pas de description

args_to_array($arg_list, $not = false)   X-Ref
Pas de description

name()   X-Ref
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')

param: list   a list of patterns, globs or strings
return: object current pakeFinder object

not_name()   X-Ref
Adds rules that files must not match.

param: list   a list of patterns, globs or strings
return: object current pakeFinder object

size()   X-Ref
Adds tests for file sizes.

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

param: list   a list of comparison strings
return: object current pakeFinder object

prune()   X-Ref
Traverses no further.

param: list   a list of patterns, globs to match
return: object current pakeFinder object

discard()   X-Ref
Discards elements that matches.

param: list   a list of patterns, globs to match
return: object current pakeFinder object

ignore_version_control()   X-Ref
Ignores version control directories.

Currently supports subversion, CVS, DARCS, Gnu Arch, Monotone, Bazaar-NG

return: object current pakeFinder object

exec()   X-Ref
Executes function or method for each element.

Element match if functino or method returns true.

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

param: mixed  function or method to call
return: object current pakeFinder object

relative()   X-Ref
Returns relative paths for all files and directories.

return: object current pakeFinder object

follow_link()   X-Ref
Symlink following.

return: object current sfFinder object

in()   X-Ref
Searches files and directories which match defined rules.

return: array list of files and directories

search_in($dir, $depth = 0)   X-Ref
Pas de description

match_names($dir, $entry)   X-Ref
Pas de description

size_ok($dir, $entry)   X-Ref
Pas de description

is_pruned($dir, $entry)   X-Ref
Pas de description

is_discarded($dir, $entry)   X-Ref
Pas de description

exec_ok($dir, $entry)   X-Ref
Pas de description

isPathAbsolute($path)   X-Ref
Pas de description



Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7