Erebot  latest
A modular IRC bot for PHP 5.3+
Erebot\Autoload Class Reference

Autoloader for Erebot's classes and interfaces. More...

Static Public Member Functions

static getPaths ()
 
static initialize ($path=null, $mapfile=null)
 
static load ($class)
 

Static Protected Member Functions

static addMap ($mapfile)
 
static addPath ($path)
 
static isMapped ($class)
 
static loadSuccessful ($class)
 
static register ()
 
static updateMap ($class, $origin)
 

Static Protected Attributes

static $map = array()
 Array of classname-to-file mapping.
 
static $mapfile = null
 Last classmap specified.
 
static $maps = array()
 Array of class maps loaded.
 
static $paths = array()
 Array of PEAR2 autoload paths registered.
 
static $registered = false
 Whether the autoload class has been spl_autoload_register-ed.
 
static $unmapped = array()
 Array of classes loaded automatically not in the map.
 

Detailed Description

Autoloader for Erebot's classes and interfaces.

This autoloader is mainly the same as the one used by PEAR2 packages.

The documentation of this class has also been updated to use Doxygen commands instead of phpDocumentor ones.

Definition at line 15 of file Autoload.php.

Member Function Documentation

static Erebot\Autoload::addMap (   $mapfile)
staticprotected

Add a classname-to-file map

Parameters
string$mapfileThe filename of the classmap
Returns
This method does not return anything.

Definition at line 113 of file Autoload.php.

static Erebot\Autoload::addPath (   $path)
staticprotected

Add a path

Parameters
string$pathThe directory to add to the set of PEAR2 paths
Returns
This method does not return anything.

Definition at line 84 of file Autoload.php.

static Erebot\Autoload::getPaths ( )
static

Return the array of paths PEAR2 autoload has registered

Return values
arrayArray of registered paths' names.

Definition at line 299 of file Autoload.php.

static Erebot\Autoload::initialize (   $path = null,
  $mapfile = null 
)
static

Initialize the PEAR2 autoloader

Parameters
string$pathDirectory path to register
string$mapfilePath to a classname-to-file map file.
Returns
This method does not return anything.

Definition at line 47 of file Autoload.php.

static Erebot\Autoload::isMapped (   $class)
staticprotected

Check if the class is already defined in a classmap

Parameters
string$classThe class to look for
Return values
boolTRUE if the class is already defined, FALSE otherwise.

Definition at line 141 of file Autoload.php.

static Erebot\Autoload::load (   $class)
static

Load a PEAR2 class

Parameters
string$classThe class to load
Return values
boolTRUE if the class could be loaded, FALSE otherwise.

Definition at line 163 of file Autoload.php.

static Erebot\Autoload::loadSuccessful (   $class)
staticprotected

Check if the requested class was loaded from the specified path

Parameters
string$className of the class or interface to test.
Return values
boolTRUE if the class was successfully loaded, FALSE otherwise.

Definition at line 256 of file Autoload.php.

static Erebot\Autoload::register ( )
staticprotected

Register the PEAR2 autoload class with spl_autoload_register

Returns
This method does not return anything.

Definition at line 60 of file Autoload.php.

static Erebot\Autoload::updateMap (   $class,
  $origin 
)
staticprotected

If possible, update the classmap file with newly-discovered mapping.

Parameters
string$classClass name discovered
string$originFile where class was found
Returns
This method does not return anything.

Definition at line 278 of file Autoload.php.


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