Elgg  Version 2.3
Public Member Functions | Protected Attributes | List of all members
Elgg\ClassLoader Class Reference

Public Member Functions

 __construct (\Elgg\ClassMap $map)
 Constructor. More...
 
 getClassMap ()
 Get the class map. More...
 
 getNamespaces ()
 Gets the configured namespaces. More...
 
 getPrefixes ()
 Gets the configured class prefixes. More...
 
 registerNamespaces (array $namespaces)
 Registers an array of namespaces. More...
 
 registerNamespace ($namespace, $paths)
 Registers a namespace. More...
 
 registerPrefixes (array $classes)
 Registers an array of classes using the PEAR naming convention. More...
 
 registerPrefix ($prefix, $paths)
 Registers a set of classes using the PEAR naming convention. More...
 
 addFallback ($path)
 Add a directory to search if no registered directory is found. More...
 
 register ()
 Registers this instance as an autoloader. More...
 
 loadClass ($class)
 Loads the given class or interface, possibly updating the class map. More...
 
 findFile ($class)
 Finds the path to the file where the class is defined. More...
 

Protected Attributes

 $namespaces = array()
 
 $prefixes = array()
 
 $fallbacks = array()
 
 $map
 

Detailed Description

Definition at line 49 of file ClassLoader.php.

Constructor & Destructor Documentation

Elgg\ClassLoader::__construct ( \Elgg\ClassMap  $map)

Constructor.

Parameters
\Elgg\ClassMap$mapClass map

Definition at line 65 of file ClassLoader.php.

Member Function Documentation

Elgg\ClassLoader::addFallback (   $path)

Add a directory to search if no registered directory is found.

Parameters
string$pathThe directory
Returns
void

Definition at line 148 of file ClassLoader.php.

Elgg\ClassLoader::findFile (   $class)

Finds the path to the file where the class is defined.

Parameters
string$classThe name of the class
Returns
string|null The path, if found

Definition at line 189 of file ClassLoader.php.

Elgg\ClassLoader::getClassMap ( )

Get the class map.

Returns

Definition at line 74 of file ClassLoader.php.

Elgg\ClassLoader::getNamespaces ( )

Gets the configured namespaces.

Returns
array A hash with namespaces as keys and directories as values

Definition at line 83 of file ClassLoader.php.

Elgg\ClassLoader::getPrefixes ( )

Gets the configured class prefixes.

Returns
array A hash with class prefixes as keys and directories as values

Definition at line 92 of file ClassLoader.php.

Elgg\ClassLoader::loadClass (   $class)

Loads the given class or interface, possibly updating the class map.

Parameters
string$classThe name of the class
Returns
void

Definition at line 167 of file ClassLoader.php.

Elgg\ClassLoader::register ( )

Registers this instance as an autoloader.

Returns
void

Definition at line 157 of file ClassLoader.php.

Elgg\ClassLoader::registerNamespace (   $namespace,
  $paths 
)

Registers a namespace.

Parameters
string$namespaceThe namespace
array | string$pathsThe location(s) of the namespace
Returns
void

Definition at line 115 of file ClassLoader.php.

Elgg\ClassLoader::registerNamespaces ( array  $namespaces)

Registers an array of namespaces.

Parameters
array$namespacesAn array of namespaces (namespaces as keys and locations as values)
Returns
void

Definition at line 102 of file ClassLoader.php.

Elgg\ClassLoader::registerPrefix (   $prefix,
  $paths 
)

Registers a set of classes using the PEAR naming convention.

Parameters
string$prefixThe classes prefix
array | string$pathsThe location(s) of the classes
Returns
void

Definition at line 138 of file ClassLoader.php.

Elgg\ClassLoader::registerPrefixes ( array  $classes)

Registers an array of classes using the PEAR naming convention.

Parameters
array$classesAn array of classes (prefixes as keys and locations as values)
Returns
void

Definition at line 125 of file ClassLoader.php.

Member Data Documentation

Elgg\ClassLoader::$fallbacks = array()
protected

Definition at line 53 of file ClassLoader.php.

Elgg\ClassLoader::$map
protected

Definition at line 58 of file ClassLoader.php.

Elgg\ClassLoader::$namespaces = array()
protected

Definition at line 51 of file ClassLoader.php.

Elgg\ClassLoader::$prefixes = array()
protected

Definition at line 52 of file ClassLoader.php.


The documentation for this class was generated from the following file: