Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 1190634

Browse files
committed
Fixes #8 - Zend_Loader_ClassMapAutoloader is not auto included
1 parent 40dd702 commit 1190634

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

library/Zend/Loader/AutoloaderFactory.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
*/
3030
abstract class Zend_Loader_AutoloaderFactory
3131
{
32-
const STANDARD_AUTOLOADER = 'Zend_Loader_StandardAutoloader';
32+
const STANDARD_AUTOLOADER = 'Zend_Loader_StandardAutoloader';
33+
const CLASS_MAP_AUTOLOADER = 'Zend_Loader_ClassMapAutoloader';
3334

3435
/**
3536
* @var array All autoloaders registered using the factory
@@ -89,6 +90,19 @@ public static function factory($options = null)
8990

9091
foreach ($options as $class => $options) {
9192
if (!isset(self::$loaders[$class])) {
93+
// Check class map autoloader
94+
if ($class == self::CLASS_MAP_AUTOLOADER) {
95+
if (!class_exists(self::CLASS_MAP_AUTOLOADER)) {
96+
// Extract the filename from the classname
97+
$classMapLoader = substr(
98+
strrchr(self::CLASS_MAP_AUTOLOADER, '_'), 1
99+
);
100+
101+
require_once dirname(__FILE__) . "/$classMapLoader.php";
102+
}
103+
}
104+
105+
// Autoload with standard autoloader
92106
$autoloader = self::getStandardAutoloader();
93107
if (!class_exists($class) && !$autoloader->autoload($class)) {
94108
require_once 'Exception/InvalidArgumentException.php';

0 commit comments

Comments
 (0)