_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.
string
the class name
string
the path to the class file
add_classes(array $classes) : void
See {@see Autoloader::add_class}.
array
the 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.
string
the namespace
string
the path
bool
whether this is a PSR-0 compliant class
add_namespaces(array $namespaces, bool $prepend) : void
See {add_namespace}.
array
the namespaces
bool
whether 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');
string
the class name
string
the namespace to alias to
load(string $class) : bool
string
Class to load
bool
If it loaded the classnamespace_path(string $namespace) : array | bool
string
the namespace to get the path for
array
bool
the 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
string
Class name
bool
Whether this is a PSR-0 compliant class
string
Path for the classfind_core_class(string $class) : bool | string
string
bool
string
init_class(string $class, string $file)
If so then it calls it.
string
the class name
string
the file containing the class to include
\Exception |
|
---|---|
\FuelException |
lower(string $str) : string
string
string to convert to lowercase
string
converted stringprep_path(string $path) : string
string
Path to prepare
string
Prepped 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.