autoload.php 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. use Symfony\Component\ClassLoader\UniversalClassLoader;
  3. use Doctrine\Common\Annotations\AnnotationRegistry;
  4. $loader = new UniversalClassLoader();
  5. $loader->registerNamespaces(array(
  6. 'Symfony' => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
  7. 'Sensio' => __DIR__.'/../vendor/bundles',
  8. 'JMS' => __DIR__.'/../vendor/bundles',
  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. 'Assetic' => __DIR__.'/../vendor/assetic/src',
  14. 'Metadata' => __DIR__.'/../vendor/metadata/src',
  15. 'FOS' => __DIR__.'/../vendor/bundles',
  16. //'Muzich' => __DIR__.'/../vendor/src',
  17. 'Doctrine\\Common\\DataFixtures' => __DIR__.'/../vendor/doctrine-fixtures/lib',
  18. 'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
  19. 'Stof' => __DIR__.'/../vendor/bundles',
  20. 'Gedmo' => __DIR__.'/../vendor/gedmo-doctrine-extensions/lib',
  21. 'WhiteOctober' => __DIR__.'/../vendor/bundles',
  22. 'Pagerfanta' => __DIR__.'/../vendor/pagerfanta/src',
  23. 'Sonata' => __DIR__.'/../vendor/bundles',
  24. 'Knp' => array(
  25. __DIR__.'/../vendor/bundles',
  26. __DIR__.'/../vendor/knp/menu/src',
  27. ),
  28. ));
  29. $loader->registerPrefixes(array(
  30. 'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
  31. 'Twig_' => __DIR__.'/../vendor/twig/lib',
  32. ));
  33. // intl
  34. if (!function_exists('intl_get_error_code')) {
  35. require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
  36. $loader->registerPrefixFallbacks(array(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'));
  37. }
  38. $loader->registerNamespaceFallbacks(array(
  39. __DIR__.'/../src',
  40. ));
  41. $loader->register();
  42. AnnotationRegistry::registerLoader(function($class) use ($loader) {
  43. $loader->loadClass($class);
  44. return class_exists($class, false);
  45. });
  46. AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
  47. // Swiftmailer needs a special autoloader to allow
  48. // the lazy loading of the init file (which is expensive)
  49. require_once __DIR__.'/../vendor/swiftmailer/lib/classes/Swift.php';
  50. Swift::registerAutoload(__DIR__.'/../vendor/swiftmailer/lib/swift_init.php');