Load
class Load
Class Load
Constants
UNABLE_TO_LOAD |
Message for throw exception. |
Properties
static protected array | $dirs | Array of directories. | |
static protected int | $registered | Total number of registered classes. | |
static private Load | $instance | Hold the classes on instance. | |
static private | $fileExists | Contains if loaded file exists. | |
static private array | $fileLoaded |
Methods
Load constructor.
Adds a directory to the list of supported directories.
Add more directories to our list of directories to test.
Return this instance.
Performs the logic to locate the file based on the namespaced classname. This method derives a filename by converting the PHP namespace separator \ into the directory separator appropriate for this server and appending the extension .php.
Load a file if exists.
Details
at line 61
__construct(array|string $dirs = [])
Load constructor.
at line 79
static
init(array|string $dirs = [])
Adds a directory to the list of supported directories.
Also registers "autoload" as an autoloading method as a Standard PHP Library (SPL) autoloader.
at line 103
static
addDirs(array|string $dirs)
Add more directories to our list of directories to test.
at line 116
static
Load
getInstance()
Return this instance.
at line 131
static bool
autoLoad(string $class)
Performs the logic to locate the file based on the namespaced classname. This method derives a filename by converting the PHP namespace separator \ into the directory separator appropriate for this server and appending the extension .php.
at line 165
static protected bool
loadFile(string $file)
Load a file if exists.
Returns true if file exists and is loaded, otherwise return false.
The reason for this method is that if the file is not founded, we don't generate a fatal error when requiring it.