浏览代码

[Locale] Added stubs as a replacement for the intl extension

You can enable the stubs by including the following code in app/autoload.php:

$loader->registerPrefixFallback(array(
    __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs',
));

If the intl extension is not loaded, the stub classes for the "en" locale
will be created automatically.
Bernhard Schussek 14 年之前
父节点
当前提交
404f83ccc3

+ 18 - 0
src/Symfony/Component/Locale/Resources/stubs/Locale.php

@@ -0,0 +1,18 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/**
+ * Stub implementation for the Locale class of the intl extension
+ *
+ * @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
+ * @see Symfony\Component\Locale\Stub\StubLocale
+ */
+class Locale extends \Symfony\Component\Locale\Stub\StubLocale {}

+ 18 - 0
src/Symfony/Component/Locale/Resources/stubs/NumberFormatter.php

@@ -0,0 +1,18 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/**
+ * Stub implementation for the NumberFormatter class of the intl extension
+ *
+ * @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
+ * @see Symfony\Component\Locale\Stub\StubNumberFormatter
+ */
+class NumberFormatter extends \Symfony\Component\Locale\Stub\StubNumberFormatter {}