Documentation

Folder
in package

AbstractYes

Class Folder

Table of Contents

Methods

all()  : array<string|int, mixed>
Return recursive list of all files and directories under given path.
copy()  : void
Recursively copy directory in filesystem.
countChildren()  : int|false
Does a directory contain children
create()  : void
delete()  : bool
Recursively delete directory from filesystem.
getRelativePath()  : string
Get relative path between target and base path. If path isn't relative, return full path.
getRelativePathDotDot()  : string
Get relative path between target and base path. If path isn't relative, return full path.
hashAllFiles()  : string
Recursively md5 hash all files in a path
lastModifiedFile()  : int
Recursively find the last modified time under given path by file.
lastModifiedFolder()  : int
Recursively find the last modified time under given path.
mkdir()  : void
move()  : void
Move directory in filesystem.
rcopy()  : bool
Recursive copy of one directory to another
shift()  : string|null
Shift first directory out of the path.

Methods

all()

Return recursive list of all files and directories under given path.

public static all(string $path[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
$path : string
$params : array<string|int, mixed> = []
Tags
throws
RuntimeException
Return values
array<string|int, mixed>

copy()

Recursively copy directory in filesystem.

public static copy(string $source, string $target[, string|null $ignore = null ]) : void
Parameters
$source : string
$target : string
$ignore : string|null = null

Ignore files matching pattern (regular expression).

Tags
throws
RuntimeException

countChildren()

Does a directory contain children

public static countChildren(string $directory) : int|false
Parameters
$directory : string
Return values
int|false

create()

public static create(string $folder) : void
Parameters
$folder : string
Tags
throws
RuntimeException

delete()

Recursively delete directory from filesystem.

public static delete(string $target[, bool $include_target = true ]) : bool
Parameters
$target : string
$include_target : bool = true
Tags
throws
RuntimeException
Return values
bool

getRelativePath()

Get relative path between target and base path. If path isn't relative, return full path.

public static getRelativePath(string $path[, string $base = GRAV_ROOT ]) : string
Parameters
$path : string
$base : string = GRAV_ROOT
Return values
string

getRelativePathDotDot()

Get relative path between target and base path. If path isn't relative, return full path.

public static getRelativePathDotDot(string $path, string $base) : string
Parameters
$path : string
$base : string
Return values
string

hashAllFiles()

Recursively md5 hash all files in a path

public static hashAllFiles(array<string|int, mixed> $paths) : string
Parameters
$paths : array<string|int, mixed>
Return values
string

lastModifiedFile()

Recursively find the last modified time under given path by file.

public static lastModifiedFile(array<string|int, mixed> $paths[, string $extensions = 'md|yaml' ]) : int
Parameters
$paths : array<string|int, mixed>
$extensions : string = 'md|yaml'

which files to search for specifically

Return values
int

lastModifiedFolder()

Recursively find the last modified time under given path.

public static lastModifiedFolder(array<string|int, mixed> $paths) : int
Parameters
$paths : array<string|int, mixed>
Return values
int

mkdir()

public static mkdir(string $folder) : void
Parameters
$folder : string
Tags
throws
RuntimeException

move()

Move directory in filesystem.

public static move(string $source, string $target) : void
Parameters
$source : string
$target : string
Tags
throws
RuntimeException

rcopy()

Recursive copy of one directory to another

public static rcopy(string $src, string $dest) : bool
Parameters
$src : string
$dest : string
Tags
throws
RuntimeException
Return values
bool

shift()

Shift first directory out of the path.

public static shift(string &$path) : string|null
Parameters
$path : string
Return values
string|null

        
On this page

Search results