PHP Класс File, someline-starter

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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