_reset()
add_class()
add_classes()
add_core_namespace()
add_namespace()
add_namespaces()
alias_to_namespace()
load()
namespace_path()
register()
class_to_path()
find_core_class()
init_class()
lower()
prep_path()
$auto_initialize
$classes
$core_namespaces
$default_path
$namespaces
$psr_namespaces
The Autoloader is responsible for all class loading.
It allows you to define different load paths based on namespaces. It also lets you set explicit paths for classes to be loaded from.
| package | Fuel |
|---|---|
| subpackage | Core |
_reset()
This method is called by the exception handler, and is considered an internal method!
| access | protected |
|---|
add_class(string $class, string $path) : void
Any class added here will not be searched for but explicitly loaded from the path.
stringthe class name
stringthe path to the class file
add_classes(array $classes) : void
See {@see Autoloader::add_class}.
arraythe class names and paths
add_core_namespace(string $namespace, bool $prefix) : void
Prefixing the classes will overwrite core classes and previously added namespaces.
string
bool
add_namespace(string $namespace, string $path, bool $psr) : void
Any class in the given namespace will be looked for in the given path.
stringthe namespace
stringthe path
boolwhether this is a PSR-0 compliant class
add_namespaces(array $namespaces, bool $prepend) : void
See {add_namespace}.
arraythe namespaces
boolwhether to prepend the namespace to the search path
alias_to_namespace(string $class, string $namespace)
By default it will add it to the global namespace.
Autoloader::alias_to_namespace('Foo\\Bar');
Autoloader::alias_to_namespace('Foo\\Bar', '\\Baz');
stringthe class name
stringthe namespace to alias to
load(string $class) : bool
stringClass to load
boolIf it loaded the classnamespace_path(string $namespace) : array | bool
stringthe namespace to get the path for
arrayboolthe namespace path or falseregister() : void
class_to_path(string $class, bool $psr) : string
It follows the PSR-0 standard, except for makes the entire path lower case, unless you tell it otherwise.
Note: This does not check if the file exists...just gets the path
stringClass name
boolWhether this is a PSR-0 compliant class
stringPath for the classfind_core_class(string $class) : bool | string
string
boolstring
init_class(string $class, string $file)
If so then it calls it.
stringthe class name
stringthe file containing the class to include
\Exception |
|
|---|---|
\FuelException |
lower(string $str) : string
stringstring to convert to lowercase
stringconverted stringprep_path(string $path) : string
stringPath to prepare
stringPrepped path$auto_initialize : bool
$classes : array
$core_namespaces : array
$default_path : array
$namespaces : array
$psr_namespaces : array
These namespaces should be loaded according to the PSR-0 standard.