[ Index ]

PHP Cross Reference of Joomla 3.3.0

title

Body

[close]

/libraries/ -> loader.php (summary)

(no description)

Copyright: Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
License: GNU General Public License version 2 or later; see LICENSE
File Size: 577 lines (15 kb)
Included or required: 3 times
Referenced: 0 times
Includes or requires: 0 files

Defines 16 functions

  discover()
  getClassList()
  getNamespaces()
  import()
  load()
  register()
  registerPrefix()
  registerAlias()
  registerNamespace()
  setup()
  loadByPsr0()
  loadByAlias()
  _autoload()
  _load()
  jexit()
  jimport()

Functions
Functions that are not part of a class:

discover($classPrefix, $parentPath, $force = true, $recurse = false)   X-Ref
Method to discover classes of a given type in a given path.

param: string   $classPrefix  The class name prefix to use for discovery.
param: string   $parentPath   Full path to the parent folder for the classes to discover.
param: boolean  $force        True to overwrite the autoload path value for the class if it already exists.
param: boolean  $recurse      Recurse through all child directories as well as the parent path.
return: void

getClassList()   X-Ref
Method to get the list of registered classes and their respective file paths for the autoloader.

return: array  The array of class => path values for the autoloader.

getNamespaces()   X-Ref
Method to get the list of registered namespaces.

return: array  The array of namespace => path values for the autoloader.

import($key, $base = null)   X-Ref
Loads a class from specified directories.

param: string  $key   The class name to look for (dot notation).
param: string  $base  Search this directory for the class.
return: boolean  True on success.

load($class)   X-Ref
Load the file for a class.

param: string  $class  The class to be loaded.
return: boolean  True on success

register($class, $path, $force = true)   X-Ref
Directly register a class to the autoload list.

param: string   $class  The class name to register.
param: string   $path   Full path to the file that holds the class to register.
param: boolean  $force  True to overwrite the autoload path value for the class if it already exists.
return: void

registerPrefix($prefix, $path, $reset = false, $prepend = false)   X-Ref
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.

param: string   $prefix   The class prefix to register.
param: string   $path     Absolute file path to the library root where classes with the given prefix can be found.
param: boolean  $reset    True to reset the prefix with only the given lookup path.
param: boolean  $prepend  If true, push the path to the beginning of the prefix lookup paths array.
return: void

registerAlias($alias, $original)   X-Ref
Offers the ability for "just in time" usage of `class_alias()`.
You cannot overwrite an existing alias.

param: string  $alias     The alias name to register.
param: string  $original  The original class to alias.
return: boolean  True if registration was successful. False if the alias already exists.

registerNamespace($namespace, $path, $reset = false, $prepend = false)   X-Ref
Register a namespace to the autoloader. When loaded, namespace paths are searched in a "last in, first out" order.

param: string   $namespace  A case sensitive Namespace to register.
param: string   $path       A case sensitive absolute file path to the library root where classes of the given namespace can be found.
param: boolean  $reset      True to reset the namespace with only the given lookup path.
param: boolean  $prepend    If true, push the path to the beginning of the namespace lookup paths array.
return: void

setup($enablePsr = true, $enablePrefixes = true, $enableClasses = true)   X-Ref
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.

param: boolean  $enablePsr       True to enable autoloading based on PSR-0.
param: boolean  $enablePrefixes  True to enable prefix based class loading (needed to auto load the Joomla core).
param: boolean  $enableClasses   True to enable class map based class loading (needed to auto load the Joomla core).
return: void

loadByPsr0($class)   X-Ref
Method to autoload classes that are namespaced to the PSR-0 standard.

param: string  $class  The fully qualified class name to autoload.
return: boolean  True on success, false otherwise.

loadByAlias($class)   X-Ref
Method to autoload classes that have been aliased using the registerAlias method.

param: string  $class  The fully qualified class name to autoload.
return: boolean  True on success, false otherwise.

_autoload($class)   X-Ref
Autoload a class based on name.

param: string  $class  The class to be loaded.
return: boolean  True if the class was loaded, false otherwise.

_load($class, $lookup)   X-Ref
Load a class based on name and lookup array.

param: string  $class   The class to be loaded (wihtout prefix).
param: array   $lookup  The array of base paths to use for finding the class file.
return: boolean  True if the class was loaded, false otherwise.

jexit($message = 0)   X-Ref
Global application exit.

This function provides a single exit point for the platform.

param: mixed  $message  Exit code or string. Defaults to zero.
return: void

jimport($path)   X-Ref
Intelligent file importer.

param: string  $path  A dot syntax path.
return: boolean  True on success.



Generated: Fri May 2 13:54:24 2014 Cross-referenced by PHPXref 0.7.1