Commit 788d41c0 authored by Fabien Potencier's avatar Fabien Potencier

moved the checks for *.class_path parameters to the boot method as people...

moved the checks for *.class_path parameters to the boot method as people might have defined the parameter after the register method is called
parent b8826630
...@@ -118,7 +118,10 @@ class DoctrineServiceProvider implements ServiceProviderInterface ...@@ -118,7 +118,10 @@ class DoctrineServiceProvider implements ServiceProviderInterface
return $dbs[$app['dbs.default']]; return $dbs[$app['dbs.default']];
}); });
}
public function boot(Application $app)
{
if (isset($app['db.dbal.class_path'])) { if (isset($app['db.dbal.class_path'])) {
throw new \RuntimeException('You have provided the db.dbal.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.'); throw new \RuntimeException('You have provided the db.dbal.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.');
} }
...@@ -127,8 +130,4 @@ class DoctrineServiceProvider implements ServiceProviderInterface ...@@ -127,8 +130,4 @@ class DoctrineServiceProvider implements ServiceProviderInterface
throw new \RuntimeException('You have provided the db.common.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.'); throw new \RuntimeException('You have provided the db.common.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.');
} }
} }
public function boot(Application $app)
{
}
} }
...@@ -51,13 +51,12 @@ class FormServiceProvider implements ServiceProviderInterface ...@@ -51,13 +51,12 @@ class FormServiceProvider implements ServiceProviderInterface
return new DefaultCsrfProvider($app['form.secret']); return new DefaultCsrfProvider($app['form.secret']);
}); });
if (isset($app['form.class_path'])) {
throw new \RuntimeException('You have provided the form.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.');
}
} }
public function boot(Application $app) public function boot(Application $app)
{ {
if (isset($app['form.class_path'])) {
throw new \RuntimeException('You have provided the form.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.');
}
} }
} }
...@@ -56,14 +56,14 @@ class MonologServiceProvider implements ServiceProviderInterface ...@@ -56,14 +56,14 @@ class MonologServiceProvider implements ServiceProviderInterface
return Logger::DEBUG; return Logger::DEBUG;
}; };
} }
}
public function boot(Application $app)
{
if (isset($app['monolog.class_path'])) { if (isset($app['monolog.class_path'])) {
throw new \RuntimeException('You have provided the monolog.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.'); throw new \RuntimeException('You have provided the monolog.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.');
} }
}
public function boot(Application $app)
{
$app->before(function (Request $request) use ($app) { $app->before(function (Request $request) use ($app) {
$app['monolog']->addInfo('> '.$request->getMethod().' '.$request->getRequestUri()); $app['monolog']->addInfo('> '.$request->getMethod().' '.$request->getRequestUri());
}); });
......
...@@ -52,13 +52,12 @@ class TranslationServiceProvider implements ServiceProviderInterface ...@@ -52,13 +52,12 @@ class TranslationServiceProvider implements ServiceProviderInterface
$app['translator.message_selector'] = $app->share(function () { $app['translator.message_selector'] = $app->share(function () {
return new MessageSelector(); return new MessageSelector();
}); });
if (isset($app['translation.class_path'])) {
throw new \RuntimeException('You have provided the translation.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.');
}
} }
public function boot(Application $app) public function boot(Application $app)
{ {
if (isset($app['translation.class_path'])) {
throw new \RuntimeException('You have provided the translation.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.');
}
} }
} }
...@@ -94,13 +94,12 @@ class TwigServiceProvider implements ServiceProviderInterface ...@@ -94,13 +94,12 @@ class TwigServiceProvider implements ServiceProviderInterface
$app['twig.loader.array'], $app['twig.loader.array'],
)); ));
}); });
if (isset($app['twig.class_path'])) {
throw new \RuntimeException('You have provided the twig.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.');
}
} }
public function boot(Application $app) public function boot(Application $app)
{ {
if (isset($app['twig.class_path'])) {
throw new \RuntimeException('You have provided the twig.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.');
}
} }
} }
...@@ -53,13 +53,12 @@ class ValidatorServiceProvider implements ServiceProviderInterface ...@@ -53,13 +53,12 @@ class ValidatorServiceProvider implements ServiceProviderInterface
$app['validator.validator_factory'] = $app->share(function () { $app['validator.validator_factory'] = $app->share(function () {
return new ConstraintValidatorFactory(); return new ConstraintValidatorFactory();
}); });
if (isset($app['validator.class_path'])) {
throw new \RuntimeException('You have provided the validator.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.');
}
} }
public function boot(Application $app) public function boot(Application $app)
{ {
if (isset($app['validator.class_path'])) {
throw new \RuntimeException('You have provided the validator.class_path parameter. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. If you are already using Composer, you can remove the parameter. See http://getcomposer.org for more information.');
}
} }
} }
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