Method to discover classes of a given type in a given path.
static
void
discover
(string $classPrefix, string $parentPath, [boolean $force = true], [boolean $recurse = false])
-
string
$classPrefix: The class name prefix to use for discovery.
-
string
$parentPath: Full path to the parent folder for the classes to discover.
-
boolean
$force: True to overwrite the autoload path value for the class if it already exists.
-
boolean
$recurse: Recurse through all child directories as well as the parent path.
Method to get the list of registered classes and their respective file paths for the autoloader.
static
array
getClassList
()
Loads a class from specified directories.
static
boolean
import
(string $key, [string $base = null])
-
string
$key: The class name to look for (dot notation).
-
string
$base: Search this directory for the class.
Load the file for a class.
static
boolean
load
(string $class)
-
string
$class: The class to be loaded.
Directly register a class to the autoload list.
static
void
register
(string $class, string $path, [boolean $force = true])
-
string
$class: The class name to register.
-
string
$path: Full path to the file that holds the class to register.
-
boolean
$force: True to overwrite the autoload path value for the class if it already exists.
Register a class prefix with lookup path. This will allow developers to register library
packages with different class prefixes to the system autoloader. More than one lookup path may be registered for the same class prefix, but if this method is called with the reset flag set to true then any registered lookups for the given prefix will be overwritten with the current lookup path.
static
void
registerPrefix
(string $prefix, string $path, [boolean $reset = false])
-
string
$prefix: The class prefix to register.
-
string
$path: Absolute file path to the library root where classes with the given prefix can be found.
-
boolean
$reset: True to reset the prefix with only the given lookup path.
Method to setup the autoloaders for the Joomla Platform. Since the SPL autoloaders are called in a queue we will add our explicit, class-registration based loader first, then fall back on the autoloader based on conventions. This will allow people to register a class in a specific location and override platform libraries as was previously possible.
static
void
setup
()
Autoload a class based on name.
static
void
_autoload
(string $class)
-
string
$class: The class to be loaded.
Load a class based on name and lookup array.
static
void
_load
(string $class, array $lookup)
-
string
$class: The class to be loaded (wihtout prefix).
-
array
$lookup: The array of base paths to use for finding the class file.