Skip to content

Commit

Permalink
Correcting an issue when multiple autoloaders are registered. If you …
Browse files Browse the repository at this point in the history
…throw an exception or trigger an error it will stop propagating through the autoloader stack. You should return true when the class is loaded, and false when it is not found so the other autoloaders can try, PHP will trigger the error for you.
  • Loading branch information
dhrrgn committed Aug 5, 2012
1 parent c40de3c commit e451c24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Shield/Shield.php
Expand Up @@ -143,8 +143,9 @@ private function _load($className)
$path = __DIR__.'/'.str_replace('Shield\\', '/', $className).'.php';
if (is_file($path)) {
include_once $path;
return true;
} else {
$this->throwError('Could not load class: '.$className);
return false;
}
}

Expand Down

0 comments on commit e451c24

Please sign in to comment.