Remove the server:log command if monolog is not loaded

This commit is contained in:
Samuel ROZE 2017-11-19 12:01:44 +02:00
parent 8d7f6ede84
commit b505ac7aec
No known key found for this signature in database
GPG Key ID: 835426F55A19FB84

View File

@ -11,6 +11,7 @@
namespace Symfony\Bundle\WebServerBundle\DependencyInjection;
use Symfony\Bridge\Monolog\Formatter\ConsoleFormatter;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@ -25,5 +26,9 @@ class WebServerExtension extends Extension
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('webserver.xml');
if (!class_exists(ConsoleFormatter::class)) {
$container->removeDefinition('web_server.command.server_log');
}
}
}