- Allow Silex applications to listen to console events
- Deprecated
Knp\Console\ConsoleEvents::INIT
- Added the
console.class
parameter - Added the
console.command.ids
parameter - Added support for the
lint:twig
anddebug:twig
commands fromsymfony/twig-bridge
- Added support for the
lint:yaml
command fromsymfony/yaml
- Added
symfony/web-server-bundle
support - [Minor BC break] The console constructor does not boot the Silex application anymore. You can set the
console.boot_in_constructor
parameter to true if your code depends on the old behavior.
If you used an old version of the console provider and still listen to the
Knp\Console\ConsoleEvents::INIT
event to register commands, you should
modify your code and extend the console
service instead.
Before:
use My\Command\MyCommand;
use Knp\Console\ConsoleEvents;
use Knp\Console\ConsoleEvent;
$app['dispatcher']->addListener(ConsoleEvents::INIT, function(ConsoleEvent $event) {
$app = $event->getApplication();
$app->add(new MyCommand());
});
After:
use My\Command\MyCommand;
use Knp\Console\Application;
$app->extend('console', function (Application $console) {
$console->add(new MyCommand());
return $console;
});
Older versions of the provider used to boot the Silex application when the console was loaded. This has been considered a bug and has been fixed in this version: the new console application only boots Silex before command execution.
If your code depends on the old behavior, you can set the console.boot_in_constructor
parameter to true
. Please note that this parameter will be removed in v3 of the service
provider and update your projects accordingly.
- Added Silex 2 compatibility