$trigger
$trigger :
__construct(\TriTan\Interfaces\Hooks\ActionFilterHookInterface $hook)
\TriTan\Interfaces\Hooks\ActionFilterHookInterface | $hook |
mkdir(string $path) : boolean
Custom make directory function.
This function will check if the path is an existing directory, if not, then it will be created with set permissions and also created recursively if needed.
string | $path | Path to be created. |
If session.savepath is not set, path is not writable, or lacks permission to mkdir.
getContents(string $filename, boolean $use_include_path = false, boolean $context = true)
Custom function to use curl, fopen, or use file_get_contents if curl is not available.
Uses trigger_include_path_search
, resource_context
and stream_context_create_options
filters.
string | $filename | Resource to read. |
boolean | $use_include_path | Whether or not to use include path. |
boolean | $context | Whether or not to use a context resource. |
checkSyntax(string $filename, boolean $check_includes = true) : void|\TriTan\Exception\Exception
Performs a syntax and error check of a given PHP script.
string | $filename | PHP script/file to check. |
boolean | $check_includes | If set to true, will check if other files have been included. |
If file does not exist or is not readable.
If file contains duplicate function names.
exists(string $filename, boolean $throw = true) : boolean
Checks whether a file or directory exists.
string | $filename | Path to the file or directory. |
boolean | $throw | Determines whether to do a simple check or throw an exception. Default: true. |
If file does not exist.
true if the file or directory specified by $filename exists; false otherwise.
sanitizeFilename(string $filename, boolean $beautify = true) : string
Sanitizes a filename.
Uses sanitized_filename
filter hook.
string | $filename | Name of file to sanitize. |
boolean | $beautify | Whether or not to beautify the sanitized filename. |
Sanitized filename for use.
removeTrailingSlash(string $string) : string
Removes trailing forward slashes and backslashes if they exist.
The primary use of this is for paths and thus should be used for paths. It is not restricted to paths and offers no specific path support.
string | $string | What to remove the trailing slashes from. |
String without the trailing slashes.
addTrailingSlash(string $string) : string
Appends a trailing slash.
Will remove trailing forward and backslashes if it exists already before adding a trailing forward slash. This prevents double slashing a string or path.
The primary use of this is for paths and thus should be used for paths. It is not restricted to paths and offers no specific path support.
string | $string | What to add the trailing slash to. |
String with trailing slash added.