PHP Класс dir, kirby

This class makes it easy to create/edit/delete directories on the filesystem
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
clean ( string $dir ) : boolean Flushes a directory
inspect ( string $dir ) : mixed Reads a directory and returns a full set of info about it
make ( string $dir ) : boolean Creates a new directory
modified ( string $dir, integer $modified ) : integer Recursively check when the dir and all subfolders have been modified for the last time.
move ( string $old, string $new ) : boolean Moves a directory to a new location
read ( string $dir ) : mixed Reads all files from a directory and returns them as an array.
remove ( string $dir, boolean $keep = false ) : boolean Deletes a directory
size ( $path, boolean $recursive = true, boolean $nice = false ) : mixed Gets the size of the directory and all subfolders and files

Описание методов

clean() статический публичный Метод

Flushes a directory
static public clean ( string $dir ) : boolean
$dir string The path of the directory
Результат boolean True: the directory has been flushed, false: flushing failed

inspect() статический публичный Метод

Reads a directory and returns a full set of info about it
static public inspect ( string $dir ) : mixed
$dir string The path of directory
Результат mixed An info array or false

make() статический публичный Метод

Creates a new directory
static public make ( string $dir ) : boolean
$dir string The path for the new directory
Результат boolean True: the dir has been created, false: creating failed

modified() статический публичный Метод

Recursively check when the dir and all subfolders have been modified for the last time.
static public modified ( string $dir, integer $modified ) : integer
$dir string The path of the directory
$modified integer internal modified store
Результат integer

move() статический публичный Метод

Moves a directory to a new location
static public move ( string $old, string $new ) : boolean
$old string The current path of the directory
$new string The desired path where the dir should be moved to
Результат boolean True: the directory has been moved, false: moving failed

read() статический публичный Метод

It skips unwanted invisible stuff.
static public read ( string $dir ) : mixed
$dir string The path of directory
Результат mixed An array of filenames or false

remove() статический публичный Метод

Deletes a directory
static public remove ( string $dir, boolean $keep = false ) : boolean
$dir string The path of the directory
$keep boolean If set to true, the directory will flushed but not removed.
Результат boolean True: the directory has been removed, false: removing failed

size() статический публичный Метод

Gets the size of the directory and all subfolders and files
static public size ( $path, boolean $recursive = true, boolean $nice = false ) : mixed
$recursive boolean
$nice boolean returns the size in a human readable size
Результат mixed