diff --git a/autoload.php.dist b/autoload.php.dist index 75e4ebb441..493a00bea2 100644 --- a/autoload.php.dist +++ b/autoload.php.dist @@ -1,41 +1,33 @@ registerNamespaces(array( - 'Symfony\\Tests' => __DIR__.'/tests', - 'Symfony' => __DIR__.'/src', - 'Doctrine\\Common\\DataFixtures' => __DIR__.'/vendor/doctrine-fixtures/lib', - 'Doctrine\\Common' => __DIR__.'/vendor/doctrine-common/lib', - 'Doctrine\\DBAL' => __DIR__.'/vendor/doctrine-dbal/lib', - 'Doctrine' => __DIR__.'/vendor/doctrine/lib', - 'Monolog' => __DIR__.'/vendor/monolog/src', -)); -$loader->registerPrefixes(array( - 'Twig_' => __DIR__.'/vendor/twig/lib', +$loader = new ClassLoader(); +$loader->addPrefixes(array( + 'Symfony\\Tests\\' => __DIR__.'/tests', + 'Symfony\\' => __DIR__.'/src', + 'Doctrine\\Common\\DataFixtures\\' => __DIR__.'/vendor/doctrine-fixtures/lib', + 'Doctrine\\Common\\' => __DIR__.'/vendor/doctrine-common/lib', + 'Doctrine\\DBAL\\' => __DIR__.'/vendor/doctrine-dbal/lib', + 'Doctrine\\ORM\\' => __DIR__.'/vendor/doctrine/lib', + 'Monolog\\' => __DIR__.'/vendor/monolog/src', + 'Twig_' => __DIR__.'/vendor/twig/lib', )); if (!function_exists('intl_get_error_code')) { require_once __DIR__.'/src/Symfony/Component/Locale/Resources/stubs/functions.php'; - $loader->registerPrefixFallback(__DIR__.'/src/Symfony/Component/Locale/Resources/stubs'); + $loader->addPrefix('', __DIR__.'/src/Symfony/Component/Locale/Resources/stubs'); } if (!interface_exists('SessionHandlerInterface', false)) { - $loader->registerPrefix('SessionHandlerInterface', __DIR__.'/src/Symfony/Component/HttpFoundation/Resources/stubs'); + $loader->addPrefix('SessionHandlerInterface', __DIR__.'/src/Symfony/Component/HttpFoundation/Resources/stubs'); } $loader->register(); if (is_file(__DIR__.'/vendor/doctrine-common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php')) { - AnnotationRegistry::registerLoader(function($class) use ($loader) { - $loader->loadClass($class); - return class_exists($class, false); - }); - if (is_file(__DIR__.'/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php')) { - AnnotationRegistry::registerFile(__DIR__.'/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'); - } + AnnotationRegistry::registerLoader(array($loader, 'loadClass')); } if (is_file(__DIR__.'/vendor/swiftmailer/lib/classes/Swift.php')) {