autoload.php.dist 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. if (is_file(__DIR__.'/vendor/doctrine-common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php')) {
  23. AnnotationRegistry::registerLoader(function($class) use ($loader) {
  24. $loader->loadClass($class);
  25. return class_exists($class, false);
  26. });
  27. if (is_file(__DIR__.'/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php')) {
  28. AnnotationRegistry::registerFile(__DIR__.'/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
  29. }
  30. }
  31. if (is_file(__DIR__.'/vendor/swiftmailer/lib/classes/Swift.php')) {
  32. require_once __DIR__.'/vendor/swiftmailer/lib/classes/Swift.php';
  33. Swift::registerAutoload(__DIR__.'/vendor/swiftmailer/lib/swift_init.php');
  34. }