Commit ffcf8bae authored by Fabien Potencier's avatar Fabien Potencier

bug #1377 Remove dependency on deprecated symfony/locale (romainneutron)

This PR was merged into the 2.0.x-dev branch.

Discussion
----------

Remove dependency on deprecated symfony/locale

Commits
-------

618188ef Remove dependency on deprecated symfony/locale
parents b872d734 618188ef
...@@ -28,19 +28,8 @@ class FormServiceProvider implements ServiceProviderInterface ...@@ -28,19 +28,8 @@ class FormServiceProvider implements ServiceProviderInterface
{ {
public function register(Container $app) public function register(Container $app)
{ {
if (!class_exists('Locale') && !class_exists('Symfony\Component\Locale\Stub\StubLocale')) {
throw new \RuntimeException('You must either install the PHP intl extension or the Symfony Locale Component to use the Form extension.');
}
if (!class_exists('Locale')) { if (!class_exists('Locale')) {
$r = new \ReflectionClass('Symfony\Component\Locale\Stub\StubLocale'); throw new \RuntimeException('You must either install the PHP intl extension or the Symfony Intl Component to use the Form extension.');
$path = dirname(dirname($r->getFilename())).'/Resources/stubs';
require_once $path.'/functions.php';
require_once $path.'/Collator.php';
require_once $path.'/IntlDateFormatter.php';
require_once $path.'/Locale.php';
require_once $path.'/NumberFormatter.php';
} }
$app['form.types'] = function ($app) { $app['form.types'] = function ($app) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment