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
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
countChildren()
Does a directory contain children
public
static countChildren(string $directory) : int|false
Parameters
- $directory : string
Return values
int|falsecreate()
public
static create(string $folder) : void
Parameters
- $folder : string
Tags
delete()
Recursively delete directory from filesystem.
public
static delete(string $target[, bool $include_target = true ]) : bool
Parameters
- $target : string
- $include_target : bool = true
Tags
Return values
boolgetRelativePath()
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
stringgetRelativePathDotDot()
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
stringhashAllFiles()
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
stringlastModifiedFile()
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
intlastModifiedFolder()
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
intmkdir()
public
static mkdir(string $folder) : void
Parameters
- $folder : string
Tags
move()
Move directory in filesystem.
public
static move(string $source, string $target) : void
Parameters
- $source : string
- $target : string
Tags
rcopy()
Recursive copy of one directory to another
public
static rcopy(string $src, string $dest) : bool
Parameters
- $src : string
- $dest : string
Tags
Return values
boolshift()
Shift first directory out of the path.
public
static shift(string &$path) : string|null
Parameters
- $path : string