Commit 3ed4cdf6 authored by Igor Wiedler's avatar Igor Wiedler

Add exceptions for removed autoloader service and class_loader parameters

parent ea521424
...@@ -60,6 +60,10 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe ...@@ -60,6 +60,10 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
$this['logger'] = null; $this['logger'] = null;
$this['autoloader'] = function () {
throw new \RuntimeException('You tried to access the autoloader service. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. See http://getcomposer.org for more information.');
};
$this['routes'] = $this->share(function () { $this['routes'] = $this->share(function () {
return new RouteCollection(); return new RouteCollection();
}); });
......
...@@ -118,6 +118,14 @@ class DoctrineServiceProvider implements ServiceProviderInterface ...@@ -118,6 +118,14 @@ class DoctrineServiceProvider implements ServiceProviderInterface
return $dbs[$app['dbs.default']]; return $dbs[$app['dbs.default']];
}); });
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.');
}
if (isset($app['db.common.class_path'])) {
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) public function boot(Application $app)
......
...@@ -51,6 +51,10 @@ class FormServiceProvider implements ServiceProviderInterface ...@@ -51,6 +51,10 @@ 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)
......
...@@ -56,6 +56,10 @@ class MonologServiceProvider implements ServiceProviderInterface ...@@ -56,6 +56,10 @@ class MonologServiceProvider implements ServiceProviderInterface
return Logger::DEBUG; return Logger::DEBUG;
}; };
} }
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.');
}
} }
public function boot(Application $app) public function boot(Application $app)
......
...@@ -52,6 +52,10 @@ class TranslationServiceProvider implements ServiceProviderInterface ...@@ -52,6 +52,10 @@ 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)
......
...@@ -89,6 +89,10 @@ class TwigServiceProvider implements ServiceProviderInterface ...@@ -89,6 +89,10 @@ 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)
......
...@@ -53,6 +53,10 @@ class ValidatorServiceProvider implements ServiceProviderInterface ...@@ -53,6 +53,10 @@ 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)
......
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