Kaynağa Gözat

fixed autoloader when tests are run on a machine without intl installed

Fabien Potencier 14 yıl önce
ebeveyn
işleme
8333df6161
1 değiştirilmiş dosya ile 5 ekleme ve 3 silme
  1. 5 3
      autoload.php.dist

+ 5 - 3
autoload.php.dist

@@ -17,9 +17,11 @@ $loader->registerNamespaces(array(
 $loader->registerPrefixes(array(
     'Twig_' => __DIR__.'/vendor/twig/lib',
 ));
-$loader->registerPrefixFallbacks(array(
-    __DIR__.'/src/Symfony/Component/Locale/Resources/stubs',
-));
+if (!function_exists('intl_get_error_code')) {
+    require_once __DIR__.'/src/Symfony/Component/Locale/Resources/stubs/functions.php';
+
+    $loader->registerPrefixFallbacks(array(__DIR__.'/src/Symfony/Component/Locale/Resources/stubs'));
+}
 $loader->register();
 
 AnnotationRegistry::registerLoader(function($class) use ($loader) {