This class contains methods for auto-loading classes from files in the Hazaar library path. Ordinarily
there will be no need for developers to use this class directly but it does contain a few methods for
working with paths and library files.
This class is not meant to be instantiated directly and instances should be retrieved using the
p(notice notice-info) . The loader class is loaded automatically when starting the application.
There should be no need to use the Loader instance directly and static methods have been provided for
some extra functionality.
p(notice notice-warning) . Instantiating this class directly can have undefined results.
Return an array of search paths for this loader instance
Array of search paths
Loads a class from a source file.
This is the main class loader used by the __autoload()PHP
trigger. It is responsible for loading the files that hold class source definitions by determining
the correct file to load based on the class name.
First check if the class name is a single word that ends with ‘Controller’, designating it as a
controller class. If that matches then the class is loaded from the controller path.
Otherwise we check if the class starts with Application and load from the application path.
Lastly we do a 2 stage search of the library paths. Stage 1 looks for a correlating path while
2 looks for the class in a sub-directory of the module name.
We do 2 stage class path checking.
Stage 1: Look for the class in a correlating path. eg:Hazaar\Application in path
Stage 2: If stage 1 fails, look in a module sub-directory. eg:Hazaar\Application in path
If they both fail, the class is not found and we throw a pretty exception.
The name of the class to load.
loadController($controller) : mixed
This method is used to load a new instance of a controller class.
There are some
built-in ‘magic controllers’ that this method will automatically load upon request.