PHP 클래스 AppserverIo\Appserver\Core\Utilities\FileSystem

저자: Johann Zelger ([email protected])
파일 보기 프로젝트 열기: appserver-io/appserver 1 사용 예제들

공개 메소드들

메소드 설명
chmod ( string $path, integer $perm ) : boolean Chmod function
chown ( string $path, integer $user, integer | null $group = null ) : boolean Chown function
cleanUpDir ( SplFileInfo $dir, boolean $alsoRemoveFiles = true ) : void Deletes all files and subdirectories from the passed directory.
copyDir ( string $src, string $dst ) : void Copies a directory recursively.
createDirectory ( string $directoryToCreate, integer $mode = 509, boolean $recursive = false ) : void Creates the passed directory.
getOsIdentifier ( ) : string Will return a three character OS identifier e.g. WIN or LIN
globDir ( string $pattern, integer $flags, boolean $recursive = true ) : array Parses and returns the directories and files that matches the passed glob pattern in a recursive way (if wanted).
initUmask ( integer $umask ) : void Init the umask to use creating files/directories, either with the passed value or the one found in the configuration.
recursiveChmod ( string $path, integer $filePerm = 420, integer $dirPerm = 493 ) : void Chmods files and folders with different permissions.
recursiveChown ( string $path, string $user, string $group = null ) : void Will set the owner and group on the passed directory.
removeDir ( string $src ) : void Removes a directory recursively.

메소드 상세

chmod() 공개 정적인 메소드

Chmod function
public static chmod ( string $path, integer $perm ) : boolean
$path string Relative or absolute path to a file or directory which should be processed.
$perm integer The permissions any file or dir should get.
리턴 boolean

chown() 공개 정적인 메소드

Chown function
public static chown ( string $path, integer $user, integer | null $group = null ) : boolean
$path string Relative or absolute path to a file or directory which should be processed.
$user integer The user that should gain owner rights.
$group integer | null The group that should gain group rights.
리턴 boolean

cleanUpDir() 공개 정적인 메소드

Deletes all files and subdirectories from the passed directory.
public static cleanUpDir ( SplFileInfo $dir, boolean $alsoRemoveFiles = true ) : void
$dir SplFileInfo The directory to remove
$alsoRemoveFiles boolean The flag for removing files also
리턴 void

copyDir() 공개 정적인 메소드

Copies a directory recursively.
public static copyDir ( string $src, string $dst ) : void
$src string The source directory to copy
$dst string The target directory
리턴 void

createDirectory() 공개 정적인 메소드

Creates the passed directory.
public static createDirectory ( string $directoryToCreate, integer $mode = 509, boolean $recursive = false ) : void
$directoryToCreate string The directory that should be created
$mode integer The mode to create the directory with
$recursive boolean TRUE if the directory has to be created recursively, else FALSE
리턴 void

getOsIdentifier() 공개 정적인 메소드

Will return a three character OS identifier e.g. WIN or LIN
public static getOsIdentifier ( ) : string
리턴 string

globDir() 공개 정적인 메소드

Parses and returns the directories and files that matches the passed glob pattern in a recursive way (if wanted).
public static globDir ( string $pattern, integer $flags, boolean $recursive = true ) : array
$pattern string The glob pattern used to parse the directories
$flags integer The flags passed to the glob function
$recursive boolean Whether or not to parse directories recursively
리턴 array The directories matches the passed glob pattern

initUmask() 공개 정적인 메소드

Init the umask to use creating files/directories, either with the passed value or the one found in the configuration.
public static initUmask ( integer $umask ) : void
$umask integer The new umask to set
리턴 void

recursiveChmod() 공개 정적인 메소드

This is an all-PHP alternative to using: \n exec("find ".$path." -type f -exec chmod 644 } \;"); \n exec("find ".$path." -type d -exec chmod 755 } \;");
public static recursiveChmod ( string $path, integer $filePerm = 420, integer $dirPerm = 493 ) : void
$path string Relative or absolute path to a file or directory which should be processed.
$filePerm integer The permissions any found files should get.
$dirPerm integer The permissions any found folder should get.
리턴 void

recursiveChown() 공개 정적인 메소드

Will set the owner and group on the passed directory.
public static recursiveChown ( string $path, string $user, string $group = null ) : void
$path string The directory to set the rights for
$user string The user to set
$group string The group to set
리턴 void

removeDir() 공개 정적인 메소드

Removes a directory recursively.
public static removeDir ( string $src ) : void
$src string The source directory to be removed
리턴 void