PHP Class File, someline-starter

Afficher le fichier Open project: someline/someline-starter Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

allFiles() public static méthode

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

append() public static méthode

Append to a file.
public static append ( string $path, string $data ) : integer
$path string
$data string
Résultat integer

basename() public static méthode

Extract the trailing name component from a file path.
public static basename ( string $path ) : string
$path string
Résultat string

cleanDirectory() public static méthode

Empty the specified directory of all files and folders.
public static cleanDirectory ( string $directory ) : boolean
$directory string
Résultat boolean

copy() public static méthode

Copy a file to a new location.
public static copy ( string $path, string $target ) : boolean
$path string
$target string
Résultat boolean

copyDirectory() public static méthode

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
Résultat boolean

delete() public static méthode

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

deleteDirectory() public static méthode

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

directories() public static méthode

Get all of the directories within a given directory.
public static directories ( string $directory ) : array
$directory string
Résultat array

dirname() public static méthode

Extract the parent directory from a file path.
public static dirname ( string $path ) : string
$path string
Résultat string

exists() public static méthode

Determine if a file or directory exists.
public static exists ( string $path ) : boolean
$path string
Résultat boolean

extension() public static méthode

Extract the file extension from a file path.
public static extension ( string $path ) : string
$path string
Résultat string

files() public static méthode

Get an array of all files in a directory.
public static files ( string $directory ) : array
$directory string
Résultat array

get() public static méthode

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

getRequire() public static méthode

Get the returned value of a file.
public static getRequire ( string $path ) : mixed
$path string
Résultat mixed

glob() public static méthode

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

hasMacro() public static méthode

Checks if macro is registered.
public static hasMacro ( string $name ) : boolean
$name string
Résultat boolean

isDirectory() public static méthode

Determine if the given path is a directory.
public static isDirectory ( string $directory ) : boolean
$directory string
Résultat boolean

isFile() public static méthode

Determine if the given path is a file.
public static isFile ( string $file ) : boolean
$file string
Résultat boolean

isWritable() public static méthode

Determine if the given path is writable.
public static isWritable ( string $path ) : boolean
$path string
Résultat boolean

lastModified() public static méthode

Get the file's last modification time.
public static lastModified ( string $path ) : integer
$path string
Résultat integer

macro() public static méthode

Register a custom macro.
public static macro ( string $name, callable $macro ) : void
$name string
$macro callable
Résultat void

makeDirectory() public static méthode

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
Résultat boolean

mimeType() public static méthode

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

move() public static méthode

Move a file to a new location.
public static move ( string $path, string $target ) : boolean
$path string
$target string
Résultat boolean

moveDirectory() public static méthode

Move a directory.
public static moveDirectory ( string $from, string $to, boolean $overwrite = false ) : boolean
$from string
$to string
$overwrite boolean
Résultat boolean

name() public static méthode

Extract the file name from a file path.
public static name ( string $path ) : string
$path string
Résultat string

prepend() public static méthode

Prepend to a file.
public static prepend ( string $path, string $data ) : integer
$path string
$data string
Résultat integer

put() public static méthode

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

requireOnce() public static méthode

Require the given file once.
public static requireOnce ( string $file ) : mixed
$file string
Résultat mixed

sharedGet() public static méthode

Get contents of a file with shared access.
public static sharedGet ( string $path ) : string
$path string
Résultat string

size() public static méthode

Get the file size of a given file.
public static size ( string $path ) : integer
$path string
Résultat integer

type() public static méthode

Get the file type of a given file.
public static type ( string $path ) : string
$path string
Résultat string