PHP Класс Kahlan\Dir\Dir

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

Защищенные свойства (Protected)

Свойство Тип Описание
$_exclude array List of exclude patterns
$_include array List of include patterns
$_types array List of allowed types

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

Метод Описание
_dirFlags ( array $options ) : integer Returns FilesystemIterator flags from Dir options.
_iteratorFlags ( array $options ) : integer Returns RecursiveIteratorIterator flags from Dir options.
accept ( ) : boolean Checks if a file passes the setted filters.
copy ( array | string $path, string $dest, array $options = [] ) : array Copies a directory.
filter ( array $options = [] ) Applies some filters to a FilterIterator instance.
make ( array | string $path, array $options = [] ) : boolean Creates a directory.
remove ( array | string $path, array $options = [] ) Removes one or many directories.
scan ( array | string $path, array $options = [] ) : array Scans one or many directories for files.
tempnam ( string $path = null, string $prefix = '' ) : string Creates a directory with unique file name.

Защищенные методы

Метод Описание
_copy ( string $path, string $dest, array $options ) : array Copies a directory.
_excluded ( $path ) : boolean Checks if a file passes match an excluded path.
_included ( $path ) : boolean Checks if a file passes match an included path.
_matchType ( ) : boolean Checks if a file passes match the allowed type.
_scan ( string $path, array $options, $dirFlags, $iteratorFlags ) : array Scans a given directory for files.

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

_copy() защищенный статический Метод

Copies a directory.
protected static _copy ( string $path, string $dest, array $options ) : array
$path string Source directory.
$dest string Destination directory.
$options array Scanning options. Possible values are: -`'mode'` _integer_ : Mode used for directory creation. -`'childrenOnly'` _boolean_ : Excludes parent directory if `true`. -`'followSymlinks'` _boolean_ : Follows Symlinks if `true`. -`'recursive'` _boolean_ : Scans recursively if `true`. -`'include'` _string|array_: An array of includes. -`'exclude'` _string|array_: An array of excludes.
Результат array

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

Returns FilesystemIterator flags from Dir options.
public static _dirFlags ( array $options ) : integer
$options array Scanning options. Possible values are: -`'skipDots'` _boolean_ : Keeps '.' and '..' if `true`. -`'followSymlinks'` _boolean_ : Follows Symlinks if `true`.
Результат integer Some `FilesystemIterator` flags

_excluded() защищенный Метод

Checks if a file passes match an excluded path.
protected _excluded ( $path ) : boolean
Результат boolean Returns `true` if match an excluded path, `false` otherwise.

_included() защищенный Метод

Checks if a file passes match an included path.
protected _included ( $path ) : boolean
Результат boolean Returns `true` if match an included path, `false` otherwise.

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

Returns RecursiveIteratorIterator flags from Dir options.
public static _iteratorFlags ( array $options ) : integer
$options array Scanning options. Possible values are: -`'iterator'` _integer_ : The iterator mode. -`'leavesOnly'` _boolean_ : Keeps only leaves if `true`.
Результат integer Some `RecursiveIteratorIterator` flags

_matchType() защищенный Метод

Checks if a file passes match the allowed type.
protected _matchType ( ) : boolean
Результат boolean Returns `true` if match the allowed type, `false` otherwise.

_scan() защищенный статический Метод

Scans a given directory for files.
protected static _scan ( string $path, array $options, $dirFlags, $iteratorFlags ) : array
$path string Path or paths to scan.
$options array Scanning options. Possible values are: -`'iterator'` _integer_ : The iterator mode. -`'skipDots'` _boolean_ : Keeps '.' and '..' if `true`. -`'leavesOnly'` _boolean_ : Keeps only leaves if `true`. -`'followSymlinks'` _boolean_ : Follows Symlinks if `true`. -`'recursive'` _boolean_ : Scans recursively if `true`. -`'include'` _string|array_: An array of includes. -`'exclude'` _string|array_: An array of excludes. -`'type'` _string|array_: An array of types.
Результат array

accept() публичный Метод

Checks if a file passes the setted filters.
public accept ( ) : boolean
Результат boolean

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

Copies a directory.
public static copy ( array | string $path, string $dest, array $options = [] ) : array
$path array | string Source directory.
$dest string Destination directory.
$options array Scanning options. Possible values are: -`'mode'` _integer_ : Mode used for directory creation. -`'childrenOnly'` _boolean_ : Excludes parent directory if `true`. -`'followSymlinks'` _boolean_ : Follows Symlinks if `true`. -`'recursive'` _boolean_ : Scans recursively if `true`.
Результат array

filter() публичный Метод

Applies some filters to a FilterIterator instance.
public filter ( array $options = [] )
$options array The filters optoins. Possible values are: -`'include'` _string|array_: An array of includes. -`'exclude'` _string|array_: An array of excludes. -`'type'` _string|array_: An array of types.

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

Creates a directory.
public static make ( array | string $path, array $options = [] ) : boolean
$path array | string The directory path.
$options array Possible options values are: -`'mode'` _integer_ : Mode used for directory creation. -`'recursive'` _boolean_ : Scans recursively if `true`.
Результат boolean

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

Removes one or many directories.
public static remove ( array | string $path, array $options = [] )
$path array | string Path or paths to scan.
$options array Scanning options. Possible values are: -`'followSymlinks'` _boolean_ : Follows Symlinks if `true`. -`'recursive'` _boolean_ : Scans recursively if `true`.

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

Scans one or many directories for files.
public static scan ( array | string $path, array $options = [] ) : array
$path array | string Path or paths to scan.
$options array Scanning options. Possible values are: -`'iterator'` _integer_ : The iterator mode. -`'skipDots'` _boolean_ : Keeps '.' and '..' if `true`. -`'leavesOnly'` _boolean_ : Keeps only leaves if `true`. -`'followSymlinks'` _boolean_ : Follows Symlinks if `true`. -`'recursive'` _boolean_ : Scans recursively if `true`. -`'include'` _string|array_: An array of includes. -`'exclude'` _string|array_: An array of excludes. -`'type'` _string|array_: An array of types.
Результат array

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

Creates a directory with unique file name.
См. также: http://php.net/manual/en/function.tempnam.php
public static tempnam ( string $path = null, string $prefix = '' ) : string
$path string The directory where the temporary filename will be created.
$prefix string The prefix of the generated temporary filename.
Результат string

Описание свойств

$_exclude защищенное свойство

List of exclude patterns
protected array $_exclude
Результат array

$_include защищенное свойство

List of include patterns
protected array $_include
Результат array

$_types защищенное свойство

List of allowed types
protected array $_types
Результат array