Permalink
Browse files

Handle empty namespaces

  • Loading branch information...
1 parent 2d670fc commit dbd44d6bcf33d32c727b3ef8fdc2b44c4694117f @Seldaek Seldaek committed Aug 15, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Composer/Autoload/AutoloadGenerator.php
View
2 src/Composer/Autoload/AutoloadGenerator.php
@@ -129,7 +129,7 @@ public static function autoload(\$class)
strpos($namespace, '_') === false ? preg_quote(strtr($namespace, '\\', '/')) : ''
);
foreach (ClassMapGenerator::createMap($dir, $whitelist) as $class => $path) {
- if (0 === strpos($class, $namespace)) {
+ if ('' === $namespace || 0 === strpos($class, $namespace)) {
$path = '/'.$filesystem->findShortestPath(getcwd(), $path, true);
if (!isset($classMap[$class])) {
$classMap[$class] = '$baseDir . '.var_export($path, true).",\n";

0 comments on commit dbd44d6

Please sign in to comment.