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