PHP 클래스 File_Find

저자: Pan.Chao
파일 보기 프로젝트 열기: sourcefabric/newscoop 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$_dirs array internal dir-list
$directories array found dirs
$dirsep string directory separator
$files array found files

공개 메소드들

메소드 설명
_build ( string $directory, string $separator = "/" ) : void internal function to build singular directory trees, used by File_Find::maptree()
_determineRegex ( $pattern, string $type ) : string internal function to determine the type of regular expression to use, implemented by File_Find::glob() and File_Find::search()
glob ( string $pattern, string $dirpath, string $pattern_type = 'php' ) : array Search specified directory to find matches for specified pattern
isError ( &$var ) : boolean Determine whether or not a variable is a PEAR error
mapTreeMultiple ( string $directory, integer $maxrecursion, $count ) : array Map the directory tree given by the directory parameter.
maptree ( string $directory ) : array Map the directory tree given by the directory_path parameter.
search ( string $pattern, string $directory, string $type = 'php', boolean $fullpath = true, string $match = 'files' ) : array Search the specified directory tree with the specified pattern. Return an array containing all matching files (no directories included).

메소드 상세

_build() 공개 메소드

internal function to build singular directory trees, used by File_Find::maptree()
public _build ( string $directory, string $separator = "/" ) : void
$directory string name of the directory to read
$separator string directory separator
리턴 void

_determineRegex() 공개 메소드

internal function to determine the type of regular expression to use, implemented by File_Find::glob() and File_Find::search()
public _determineRegex ( $pattern, string $type ) : string
$type string given RegExp type
리턴 string kind of function ( "eregi", "ereg" or "preg_match") ;

glob() 공개 메소드

Search specified directory to find matches for specified pattern
저자: Sterling Hughes ([email protected])
public glob ( string $pattern, string $dirpath, string $pattern_type = 'php' ) : array
$pattern string a string containing the pattern to search the directory for.
$dirpath string a string containing the directory path to search.
$pattern_type string a string containing the type of pattern matching functions to use (can either be 'php', 'perl' or 'shell').
리턴 array containing all of the files and directories matching the pattern or null if no matches

isError() 공개 메소드

Determine whether or not a variable is a PEAR error
public isError ( &$var ) : boolean
리턴 boolean returns true if the variable is a PEAR error, otherwise it returns false.

mapTreeMultiple() 공개 메소드

Map the directory tree given by the directory parameter.
저자: Mika Tuupola ([email protected])
public mapTreeMultiple ( string $directory, integer $maxrecursion, $count ) : array
$directory string contains the directory path that you want to map.
$maxrecursion integer maximun number of folders to recursive map
리턴 array a multidimensional array containing all subdirectories and their files. For example: Array ( [0] => file_1.php [1] => file_2.php [subdirname] => Array ( [0] => file_1.php ) )

maptree() 공개 메소드

Map the directory tree given by the directory_path parameter.
저자: Sterling Hughes ([email protected])
public maptree ( string $directory ) : array
$directory string contains the directory path that you want to map.
리턴 array a two element array, the first element containing a list of all the directories, the second element containing a list of all the files.

프로퍼티 상세

$_dirs 공개적으로 프로퍼티

internal dir-list
public array $_dirs
리턴 array

$directories 공개적으로 프로퍼티

found dirs
public array $directories
리턴 array

$dirsep 공개적으로 프로퍼티

directory separator
public string $dirsep
리턴 string

$files 공개적으로 프로퍼티

found files
public array $files
리턴 array