loader.php
This file should not be loaded directly in the application, "./autoload.php" takes care of loading it.
It takes care of:
- Setting application include paths.
- Registering an autoloader.
- Aliasing VELOX classes.
- Setting error and exception handlers and the shutdown function.
- Setting the default timezone.
- Providing some helper functions for autoloading.
If you ever wanted to extend VELOX functionality beyond basic stuff, you may want to do something here.
Table of Contents
- require_recursive() : bool
- Requires a directory recursively.
- class_alias_recursive() : bool
- Aliases classes in a directory to the root namespace recursively. Note that namespaces have to follow PSR-4.
Functions
require_recursive()
Requires a directory recursively.
require_recursive(string $directory) : bool
Parameters
- $directory : string
Return values
bool —If something was included, it returns true, otherwise false.
class_alias_recursive()
Aliases classes in a directory to the root namespace recursively. Note that namespaces have to follow PSR-4.
class_alias_recursive(string $directory, string $namespacePrefix) : bool
Parameters
- $directory : string
-
The path to a directory. If the passed parameter is not a directory, this function will skip it.
- $namespacePrefix : string
-
The prefix for classes namespace.
Return values
bool —If something was aliased, it returns true, otherwise false.