Filesystem
in package
File helper methods, bound to the HydeKernel instance, and is an integral part of the framework.
All paths arguments are relative to the root of the application, and will be automatically resolved to absolute paths.
Table of Contents
Properties
Methods
- __construct() : mixed
- findFiles() : Collection<int, string>
- getBasePath() : string
- mediaPath() : string
- Get the absolute path to the media source directory, or a file within it.
- path() : string
- Get an absolute file path from a supplied relative path.
- pathToAbsolute() : mixed
- Get an absolute file path from a supplied relative path.
- pathToRelative() : string
- Decode an absolute path created with a Hyde::path() helper into its relative counterpart.
- siteMediaPath() : string
- Get the absolute path to the compiled site's media directory, or a file within it.
- sitePath() : string
- Get the absolute path to the compiled site directory, or a file within it.
- smartGlob() : Collection<int, string>
- touch() : bool
- Touch one or more files in the project's directory.
- unlink() : bool
- Unlink one or more files in the project's directory.
- unlinkIfExists() : bool
- Unlink a file in the project's directory, but only if it exists.
Properties
$kernel
protected
HydeKernel
$kernel
Methods
__construct()
public
__construct(HydeKernel $kernel) : mixed
Parameters
- $kernel : HydeKernel
findFiles()
public
findFiles(string $directory[, string|array<string|int, string>|false $matchExtensions = false ][, bool $recursive = false ]) : Collection<int, string>
Parameters
- $directory : string
- $matchExtensions : string|array<string|int, string>|false = false
- $recursive : bool = false
Return values
Collection<int, string>getBasePath()
public
getBasePath() : string
Return values
stringmediaPath()
Get the absolute path to the media source directory, or a file within it.
public
mediaPath([string $path = '' ]) : string
Parameters
- $path : string = ''
Return values
stringpath()
Get an absolute file path from a supplied relative path.
public
path([string $path = '' ]) : string
The function returns the fully qualified path to your site's root directory.
You may also use the function to generate a fully qualified path to a given file relative to the project root directory when supplying the path argument.
Parameters
- $path : string = ''
Return values
stringpathToAbsolute()
Get an absolute file path from a supplied relative path.
public
pathToAbsolute(string|array<string|int, string> $path) : mixed
Input types are matched, meaning that if the input is a string so will the output be.
Parameters
- $path : string|array<string|int, string>
pathToRelative()
Decode an absolute path created with a Hyde::path() helper into its relative counterpart.
public
pathToRelative(string $path) : string
Parameters
- $path : string
Return values
stringsiteMediaPath()
Get the absolute path to the compiled site's media directory, or a file within it.
public
siteMediaPath([string $path = '' ]) : string
Parameters
- $path : string = ''
Return values
stringsitePath()
Get the absolute path to the compiled site directory, or a file within it.
public
sitePath([string $path = '' ]) : string
Parameters
- $path : string = ''
Return values
stringsmartGlob()
public
smartGlob(string $pattern[, int $flags = 0 ]) : Collection<int, string>
Parameters
- $pattern : string
- $flags : int = 0
Return values
Collection<int, string>touch()
Touch one or more files in the project's directory.
public
touch(string|array<string|int, string> $path) : bool
Parameters
- $path : string|array<string|int, string>
Return values
boolunlink()
Unlink one or more files in the project's directory.
public
unlink(string|array<string|int, string> $path) : bool
Parameters
- $path : string|array<string|int, string>
Return values
boolunlinkIfExists()
Unlink a file in the project's directory, but only if it exists.
public
unlinkIfExists(string $path) : bool
Parameters
- $path : string