Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Commit

Permalink
Merge pull request #485 from froschdesign/hotfix/8
Browse files Browse the repository at this point in the history
Fixes #8 - Zend_Loader_ClassMapAutoloader is not auto included
  • Loading branch information
akrabat committed Jan 7, 2015
2 parents c11f8e1 + 1190634 commit ba7ffb1
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion library/Zend/Loader/AutoloaderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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';
Expand Down

0 comments on commit ba7ffb1

Please sign in to comment.