Преглед на файлове

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

Fabien Potencier преди 14 години
родител
ревизия
8333df6161
променени са 1 файла, в които са добавени 5 реда и са изтрити 3 реда
  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) {