\PhileUtility

the Registry class for implementing a registry

Summary

Methods
Properties
Constants
getProtocol()
getBaseUrl()
getInstallPath()
resolveFilePath()
load()
isPluginLoaded()
getFiles()
redirect()
getSecureMD5Hash()
generateSecureToken()
crypto_rand_secure()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getProtocol()

getProtocol() : string

method to get the current http protocoll

Returns

string —

the current protocol

getBaseUrl()

getBaseUrl() : string

detect base url

Returns

string

getInstallPath()

getInstallPath() : string

detect install path

Returns

string

resolveFilePath()

resolveFilePath(mixed $path) : string|null

resolve a file path by replace the mod: prefix

Parameters

mixed $path

Returns

string|null —

the full filepath or null if file does not exists

load()

load(mixed $file) : mixed|null

load files e.g. config files

Parameters

mixed $file

Returns

mixed|null

isPluginLoaded()

isPluginLoaded(mixed $plugin) : bool

check if a plugin is loaded

Parameters

mixed $plugin

Returns

bool

getFiles()

getFiles(string $directory, string $fileNamePattern) : array

method to get files from a directory

Parameters

string $directory
string $fileNamePattern

Returns

array

redirect()

redirect(mixed $url, int $statusCode)

redirect to an url

Parameters

mixed $url

the url to redirect to

int $statusCode

the http status code

getSecureMD5Hash()

getSecureMD5Hash(mixed $value) : string

generate secure md5 hash

Parameters

mixed $value

Returns

string

generateSecureToken()

generateSecureToken(int $length, bool $widthSpecialChars, null $additionalChars) : string

method to generate a secure token code from http://stackoverflow.com/questions/1846202/php-how-to-generate-a-random-unique-alphanumeric-string/13733588#13733588 modified by Frank Nägler

Parameters

int $length
bool $widthSpecialChars
null $additionalChars

Returns

string

crypto_rand_secure()

crypto_rand_secure(mixed $min, mixed $max) : mixed

method to get a more secure random value code from http://stackoverflow.com/questions/1846202/php-how-to-generate-a-random-unique-alphanumeric-string/13733588#13733588

Parameters

mixed $min
mixed $max

Returns

mixed