Class JLoader

Description

Static class to handle loading of libraries.

  • abstract:
  • since: 11.1

Located in /libraries/loader.php (line 17)


	
			
Variable Summary
static array $classes
static array $imported
static array $prefixes
Method Summary
static void discover (string $classPrefix, string $parentPath, [boolean $force = true], [boolean $recurse = false])
static array getClassList ()
static boolean import (string $key, [string $base = null])
static boolean load (string $class)
static void register (string $class, string $path, [boolean $force = true])
static void registerPrefix (string $prefix, string $path, [boolean $reset = false])
static void setup ()
static void _autoload (string $class)
static void _load (string $class, array $lookup)
Variables
static array $classes = array() (line 25)

Container for already imported library paths.

  • since: 11.1
  • access: protected
static array $imported = array() (line 33)

Container for already imported library paths.

  • since: 11.1
  • access: protected
static array $prefixes = array() (line 41)

Container for registered library class prefixes and path lookups.

  • since: 12.1
  • access: protected
Methods
static method discover (line 55)

Method to discover classes of a given type in a given path.

  • since: 11.1
  • access: public
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.
static method getClassList (line 103)

Method to get the list of registered classes and their respective file paths for the autoloader.

  • return: The array of class => path values for the autoloader.
  • since: 11.1
  • access: public
static array getClassList ()
static method import (line 118)

Loads a class from specified directories.

  • return: True on success.
  • since: 11.1
  • access: public
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.
static method load (line 183)

Load the file for a class.

  • return: True on success
  • since: 11.1
  • access: public
static boolean load (string $class)
  • string $class: The class to be loaded.
static method register (line 215)

Directly register a class to the autoload list.

  • since: 11.1
  • access: public
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.
static method registerPrefix (line 246)

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.

  • since: 12.1
  • access: public
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.
static method setup (line 276)

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.

  • since: 11.3
  • access: public
static void setup ()
static method _autoload (line 295)

Autoload a class based on name.

  • since: 11.3
  • access: private
static void _autoload (string $class)
  • string $class: The class to be loaded.
static method _load (line 316)

Load a class based on name and lookup array.

  • since: 12.1
  • access: private
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.

Documentation generated on Mon, 25 Jun 2012 13:56:25 -0500 by phpDocumentor 1.4.4