8000 [WebServerBundle] fixed server:log when Monolog is not installed · symfony/symfony@9d56f0c · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d56f0c

Browse files
committed
[WebServerBundle] fixed server:log when Monolog is not installed
1 parent 133c37a commit 9d56f0c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,24 @@ class ServerLogCommand extends Command
2929
private $el;
3030
private $handler;
3131

32+
public function isEnabled()
33+
{
34+
if (!class_exists(ConsoleFormatter::class)) {
35+
return false;
36+
}
37+
38+
return parent::isEnabled();
39+
}
40+
3241
protected function configure()
3342
{
43+
$this->setName('server:log');
44+
45+
if (!class_exists(ConsoleFormatter::class)) {
46+
return;
47+
}
48+
3449
$this
35-
->setName('server:log')
3650
->setDescription('Start a log server that displays logs in real time')
3751
->addOption('host', null, InputOption::VALUE_REQUIRED, 'The server host', '0:9911')
3852
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The line format', ConsoleFormatter::SIMPLE_FORMAT)

0 commit comments

Comments
 (0)
0