autoload.php.dist 1.4KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. require_once __DIR__.'/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
  3. use Symfony\Component\ClassLoader\UniversalClassLoader;
  4. use Doctrine\Common\Annotations\AnnotationRegistry;
  5. $loader = new UniversalClassLoader();
  6. $loader->registerNamespaces(array(
  7. 'Symfony\\Tests' => __DIR__.'/tests',
  8. 'Symfony' => __DIR__.'/src',
  9. 'Doctrine\\Common' => __DIR__.'/vendor/doctrine-common/lib',
  10. 'Doctrine\\DBAL' => __DIR__.'/vendor/doctrine-dbal/lib',
  11. 'Doctrine' => __DIR__.'/vendor/doctrine/lib',
  12. 'Monolog' => __DIR__.'/vendor/monolog/src',
  13. ));
  14. $loader->registerPrefixes(array(
  15. 'Twig_' => __DIR__.'/vendor/twig/lib',
  16. ));
  17. if (!function_exists('intl_get_error_code')) {
  18. require_once __DIR__.'/src/Symfony/Component/Locale/Resources/stubs/functions.php';
  19. $loader->registerPrefixFallbacks(array(__DIR__.'/src/Symfony/Component/Locale/Resources/stubs'));
  20. }
  21. $loader->register();
  22. AnnotationRegistry::registerLoader(function($class) use ($loader) {
  23. $loader->loadClass($class);
  24. return class_exists($class, false);
  25. });
  26. AnnotationRegistry::registerFile(__DIR__.'/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
  27. if (is_file(__DIR__.'/vendor/swiftmailer/lib/classes/Swift.php')) {
  28. require_once __DIR__.'/vendor/swiftmailer/lib/classes/Swift.php';
  29. Swift::registerAutoload(__DIR__.'/vendor/swiftmailer/lib/swift_init.php');
  30. }