Class PEAR_Autoloader

Description

This class is for objects where you want to separate the code for some methods into separate classes. This is useful if you have a class with not-frequently-used methods that contain lots of code that you would like to avoid always parsing.

The PEAR_Autoloader class provides autoloading and aggregation. The autoloading lets you set up in which classes the separated methods are found. Aggregation is the technique used to import new methods, an instance of each class providing separated methods is stored and called every time the aggregated method is called.

Located in /maintenance/libraries/pear/PEAR/Autoloader.php (line 43)

PEAR
   |
   --PEAR_Autoloader
Variable Summary
Method Summary
 void addAggregateObject (string $classname)
 void addAutoload (string $method, [string $classname = null])
 bool removeAggregateObject (string $classname)
 bool removeAutoload (string $method)
 mixed __call (string $method, string $args, mixed &$retval)
Variables
array $_autoload_map = array() (line 54)

Map of methods and classes where they are defined

  • access: private
array $_method_map = array() (line 63)

Map of methods and aggregate objects

  • access: private
Methods
addAggregateObject (line 130)

Add an aggregate object to this object. If the specified class

is not defined, loading it will be attempted following PEAR's file naming scheme. All the methods in the class will be aggregated, except private ones (name starting with an underscore) and constructors.

  • access: public
void addAggregateObject (string $classname)
  • string $classname: what class to instantiate for the object.
addAutoload (line 84)

Add one or more autoload entries.

  • access: public
void addAutoload (string $method, [string $classname = null])
  • string $method: which method to autoload
  • string $classname: (optional) which class to find the method in. If the $method parameter is an array, this parameter may be omitted (and will be ignored if not), and the $method parameter will be treated as an associative array with method names as keys and class names as values.
removeAggregateObject (line 159)

Remove an aggregate object.

  • return: TRUE if an object was removed, FALSE if not
  • access: public
bool removeAggregateObject (string $classname)
  • string $classname: the class of the object to remove
removeAutoload (line 106)

Remove an autoload entry.

  • return: TRUE if an entry was removed, FALSE if not
  • access: public
bool removeAutoload (string $method)
  • string $method: which method to remove the autoload entry for
__call (line 190)

Overloaded object call handler, called each time an undefined/aggregated method is invoked. This method repeats the call in the right aggregate object and passes on the return value.

  • return: The return value from the aggregated method, or a PEAR error if the called method was unknown.
mixed __call (string $method, string $args, mixed &$retval)
  • string $method: which method that was called
  • string $args: An array of the parameters passed in the original call

Documentation generated on Fri, 11 Feb 2005 18:12:45 +0000 by phpDocumentor 1.3.0RC3