\JLoader
Static class to handle loading of libraries.
Synopsis
class JLoader
{
- // members
- protected $classes;
- protected $imported;
- protected $prefixes;
- protected $classAliases;
- protected $namespaces;
- // methods
- public static void discover()
- public static array getClassList()
- public static array getNamespaces()
- public static boolean import()
- public static boolean load()
- public static void register()
- public static void registerPrefix()
- public static boolean registerAlias()
- public static void registerNamespace()
- public static void setup()
- public static boolean loadByPsr0()
- public static boolean loadByAlias()
- private static boolean _autoload()
- private static boolean _load()
Members
protected
- $classAliases
—
array
Holds proxy classes and the class names the proxy. - $classes
—
array
Container for already imported library paths. - $imported
—
array
Container for already imported library paths. - $namespaces
—
array
Container for namespace => path map. - $prefixes
—
array
Container for registered library class prefixes and path lookups.
Methods
private
- _autoload() — Autoload a class based on name.
- _load() — Load a class based on name and lookup array.
public
- discover() — Method to discover classes of a given type in a given path.
- getClassList() — Method to get the list of registered classes and their respective file paths for the autoloader.
- getNamespaces() — Method to get the list of registered namespaces.
- import() — Loads a class from specified directories.
- load() — Load the file for a class.
- loadByAlias() — Method to autoload classes that have been aliased using the registerAlias method.
- loadByPsr0() — Method to autoload classes that are namespaced to the PSR-0 standard.
- register() — Directly register a class to the autoload list.
- registerAlias() — Offers the ability for "just in time" usage of `class_alias()`.
- registerNamespace() — Register a namespace to the autoloader. When loaded, namespace paths are searched in a "last in, first out" order.
- registerPrefix() — 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. When loaded, prefix paths are searched in a "last in, first out" order.
- setup() — Method to setup the autoloaders for the Joomla Platform.