Kaynağa Gözat

merged branch Seldaek/autoload (PR #3515)

Commits
-------

d2f8aa3 Allow autoload to run without vendors being cloned

Discussion
----------

[Tests] Allow autoload to run without vendors being cloned

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fabien Potencier 13 yıl önce
ebeveyn
işleme
55f962d44d
1 değiştirilmiş dosya ile 9 ekleme ve 5 silme
  1. 9 5
      autoload.php.dist

+ 9 - 5
autoload.php.dist

@@ -24,11 +24,15 @@ if (!function_exists('intl_get_error_code')) {
 }
 $loader->register();
 
-AnnotationRegistry::registerLoader(function($class) use ($loader) {
-    $loader->loadClass($class);
-    return class_exists($class, false);
-});
-AnnotationRegistry::registerFile(__DIR__.'/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
+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');
+    }
+}
 
 if (is_file(__DIR__.'/vendor/swiftmailer/lib/classes/Swift.php')) {
     require_once __DIR__.'/vendor/swiftmailer/lib/classes/Swift.php';