diff --git a/library/Zend/Loader/AutoloaderFactory.php b/library/Zend/Loader/AutoloaderFactory.php index 52326e6011..9fc2836525 100644 --- a/library/Zend/Loader/AutoloaderFactory.php +++ b/library/Zend/Loader/AutoloaderFactory.php @@ -29,7 +29,8 @@ */ abstract class Zend_Loader_AutoloaderFactory { - const STANDARD_AUTOLOADER = 'Zend_Loader_StandardAutoloader'; + const STANDARD_AUTOLOADER = 'Zend_Loader_StandardAutoloader'; + const CLASS_MAP_AUTOLOADER = 'Zend_Loader_ClassMapAutoloader'; /** * @var array All autoloaders registered using the factory @@ -89,6 +90,19 @@ public static function factory($options = null) foreach ($options as $class => $options) { if (!isset(self::$loaders[$class])) { + // Check class map autoloader + if ($class == self::CLASS_MAP_AUTOLOADER) { + if (!class_exists(self::CLASS_MAP_AUTOLOADER)) { + // Extract the filename from the classname + $classMapLoader = substr( + strrchr(self::CLASS_MAP_AUTOLOADER, '_'), 1 + ); + + require_once dirname(__FILE__) . "/$classMapLoader.php"; + } + } + + // Autoload with standard autoloader $autoloader = self::getStandardAutoloader(); if (!class_exists($class) && !$autoloader->autoload($class)) { require_once 'Exception/InvalidArgumentException.php';