Skip to content

Commit a8afcba

Browse files
bug symfony#25027 [FrameworkBundle] Hide server:log command based on deps (sroze)
This PR was merged into the 3.4 branch. Discussion ---------- [FrameworkBundle] Hide server:log command based on deps | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#25025 | License | MIT | Doc PR | ø Remove the `server:log` command if monolog is not installed. Commits ------- b505ac7 Remove the `server:log` command if monolog is not loaded
2 parents a03513a + b505ac7 commit a8afcba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Bundle/WebServerBundle/DependencyInjection/WebServerExtension.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\WebServerBundle\DependencyInjection;
1313

14+
use Symfony\Bridge\Monolog\Formatter\ConsoleFormatter;
1415
use Symfony\Component\DependencyInjection\Extension\Extension;
1516
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
1617
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -25,5 +26,9 @@ public function load(array $configs, ContainerBuilder $container)
2526
{
2627
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
2728
$loader->load('webserver.xml');
29+
30+
if (!class_exists(ConsoleFormatter::class)) {
31+
$container->removeDefinition('web_server.command.server_log');
32+
}
2833
}
2934
}

0 commit comments

Comments
 (0)