PHP 클래스 File, someline-starter

파일 보기 프로젝트 열기: someline/someline-starter 1 사용 예제들

공개 메소드들

메소드 설명
allFiles ( string $directory, boolean $hidden = false ) : array Get all of the files from the given directory (recursive).
append ( string $path, string $data ) : integer Append to a file.
basename ( string $path ) : string Extract the trailing name component from a file path.
cleanDirectory ( string $directory ) : boolean Empty the specified directory of all files and folders.
copy ( string $path, string $target ) : boolean Copy a file to a new location.
copyDirectory ( string $directory, string $destination, integer $options = null ) : boolean Copy a directory from one location to another.
delete ( string | array $paths ) : boolean Delete the file at a given path.
deleteDirectory ( string $directory, boolean $preserve = false ) : boolean Recursively delete a directory.
directories ( string $directory ) : array Get all of the directories within a given directory.
dirname ( string $path ) : string Extract the parent directory from a file path.
exists ( string $path ) : boolean Determine if a file or directory exists.
extension ( string $path ) : string Extract the file extension from a file path.
files ( string $directory ) : array Get an array of all files in a directory.
get ( string $path, boolean $lock = false ) : string Get the contents of a file.
getRequire ( string $path ) : mixed Get the returned value of a file.
glob ( string $pattern, integer $flags ) : array Find path names matching a given pattern.
hasMacro ( string $name ) : boolean Checks if macro is registered.
isDirectory ( string $directory ) : boolean Determine if the given path is a directory.
isFile ( string $file ) : boolean Determine if the given path is a file.
isWritable ( string $path ) : boolean Determine if the given path is writable.
lastModified ( string $path ) : integer Get the file's last modification time.
macro ( string $name, callable $macro ) : void Register a custom macro.
makeDirectory ( string $path, integer $mode = 493, boolean $recursive = false, boolean $force = false ) : boolean Create a directory.
mimeType ( string $path ) : string | false Get the mime-type of a given file.
move ( string $path, string $target ) : boolean Move a file to a new location.
moveDirectory ( string $from, string $to, boolean $overwrite = false ) : boolean Move a directory.
name ( string $path ) : string Extract the file name from a file path.
prepend ( string $path, string $data ) : integer Prepend to a file.
put ( string $path, string $contents, boolean $lock = false ) : integer Write the contents of a file.
requireOnce ( string $file ) : mixed Require the given file once.
sharedGet ( string $path ) : string Get contents of a file with shared access.
size ( string $path ) : integer Get the file size of a given file.
type ( string $path ) : string Get the file type of a given file.

메소드 상세

allFiles() 공개 정적인 메소드

Get all of the files from the given directory (recursive).
public static allFiles ( string $directory, boolean $hidden = false ) : array
$directory string
$hidden boolean
리턴 array

append() 공개 정적인 메소드

Append to a file.
public static append ( string $path, string $data ) : integer
$path string
$data string
리턴 integer

basename() 공개 정적인 메소드

Extract the trailing name component from a file path.
public static basename ( string $path ) : string
$path string
리턴 string

cleanDirectory() 공개 정적인 메소드

Empty the specified directory of all files and folders.
public static cleanDirectory ( string $directory ) : boolean
$directory string
리턴 boolean

copy() 공개 정적인 메소드

Copy a file to a new location.
public static copy ( string $path, string $target ) : boolean
$path string
$target string
리턴 boolean

copyDirectory() 공개 정적인 메소드

Copy a directory from one location to another.
public static copyDirectory ( string $directory, string $destination, integer $options = null ) : boolean
$directory string
$destination string
$options integer
리턴 boolean

delete() 공개 정적인 메소드

Delete the file at a given path.
public static delete ( string | array $paths ) : boolean
$paths string | array
리턴 boolean

deleteDirectory() 공개 정적인 메소드

The directory itself may be optionally preserved.
public static deleteDirectory ( string $directory, boolean $preserve = false ) : boolean
$directory string
$preserve boolean
리턴 boolean

directories() 공개 정적인 메소드

Get all of the directories within a given directory.
public static directories ( string $directory ) : array
$directory string
리턴 array

dirname() 공개 정적인 메소드

Extract the parent directory from a file path.
public static dirname ( string $path ) : string
$path string
리턴 string

exists() 공개 정적인 메소드

Determine if a file or directory exists.
public static exists ( string $path ) : boolean
$path string
리턴 boolean

extension() 공개 정적인 메소드

Extract the file extension from a file path.
public static extension ( string $path ) : string
$path string
리턴 string

files() 공개 정적인 메소드

Get an array of all files in a directory.
public static files ( string $directory ) : array
$directory string
리턴 array

get() 공개 정적인 메소드

Get the contents of a file.
public static get ( string $path, boolean $lock = false ) : string
$path string
$lock boolean
리턴 string

getRequire() 공개 정적인 메소드

Get the returned value of a file.
public static getRequire ( string $path ) : mixed
$path string
리턴 mixed

glob() 공개 정적인 메소드

Find path names matching a given pattern.
public static glob ( string $pattern, integer $flags ) : array
$pattern string
$flags integer
리턴 array

hasMacro() 공개 정적인 메소드

Checks if macro is registered.
public static hasMacro ( string $name ) : boolean
$name string
리턴 boolean

isDirectory() 공개 정적인 메소드

Determine if the given path is a directory.
public static isDirectory ( string $directory ) : boolean
$directory string
리턴 boolean

isFile() 공개 정적인 메소드

Determine if the given path is a file.
public static isFile ( string $file ) : boolean
$file string
리턴 boolean

isWritable() 공개 정적인 메소드

Determine if the given path is writable.
public static isWritable ( string $path ) : boolean
$path string
리턴 boolean

lastModified() 공개 정적인 메소드

Get the file's last modification time.
public static lastModified ( string $path ) : integer
$path string
리턴 integer

macro() 공개 정적인 메소드

Register a custom macro.
public static macro ( string $name, callable $macro ) : void
$name string
$macro callable
리턴 void

makeDirectory() 공개 정적인 메소드

Create a directory.
public static makeDirectory ( string $path, integer $mode = 493, boolean $recursive = false, boolean $force = false ) : boolean
$path string
$mode integer
$recursive boolean
$force boolean
리턴 boolean

mimeType() 공개 정적인 메소드

Get the mime-type of a given file.
public static mimeType ( string $path ) : string | false
$path string
리턴 string | false

move() 공개 정적인 메소드

Move a file to a new location.
public static move ( string $path, string $target ) : boolean
$path string
$target string
리턴 boolean

moveDirectory() 공개 정적인 메소드

Move a directory.
public static moveDirectory ( string $from, string $to, boolean $overwrite = false ) : boolean
$from string
$to string
$overwrite boolean
리턴 boolean

name() 공개 정적인 메소드

Extract the file name from a file path.
public static name ( string $path ) : string
$path string
리턴 string

prepend() 공개 정적인 메소드

Prepend to a file.
public static prepend ( string $path, string $data ) : integer
$path string
$data string
리턴 integer

put() 공개 정적인 메소드

Write the contents of a file.
public static put ( string $path, string $contents, boolean $lock = false ) : integer
$path string
$contents string
$lock boolean
리턴 integer

requireOnce() 공개 정적인 메소드

Require the given file once.
public static requireOnce ( string $file ) : mixed
$file string
리턴 mixed

sharedGet() 공개 정적인 메소드

Get contents of a file with shared access.
public static sharedGet ( string $path ) : string
$path string
리턴 string

size() 공개 정적인 메소드

Get the file size of a given file.
public static size ( string $path ) : integer
$path string
리턴 integer

type() 공개 정적인 메소드

Get the file type of a given file.
public static type ( string $path ) : string
$path string
리턴 string