API Documentation

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

$kernel  : HydeKernel

Methods

__construct()  : mixed
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

Methods

getBasePath()

public getBasePath() : string
Return values
string

mediaPath()

Get the absolute path to the media source directory, or a file within it.

public mediaPath([string $path = '' ]) : string
Parameters
$path : string = ''
Return values
string

path()

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
string

pathToAbsolute()

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
string

siteMediaPath()

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
string

sitePath()

Get the absolute path to the compiled site directory, or a file within it.

public sitePath([string $path = '' ]) : string
Parameters
$path : string = ''
Return values
string

smartGlob()

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
bool

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
bool

unlinkIfExists()

Unlink a file in the project's directory, but only if it exists.

public unlinkIfExists(string $path) : bool
Parameters
$path : string
Return values
bool

        
On this page

Search results