Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7536e8b

Browse files
[FrameworkBundle] Show server:run logs by default
1 parent06f5c86 commit7536e8b

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php‎

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
useSymfony\Component\Console\Input\InputOption;
1616
useSymfony\Component\Console\Input\InputInterface;
1717
useSymfony\Component\Console\Output\OutputInterface;
18+
useSymfony\Component\Console\Output\ConsoleOutputInterface;
1819
useSymfony\Component\Console\Style\SymfonyStyle;
1920
useSymfony\Component\Process\PhpExecutableFinder;
21+
useSymfony\Component\Process\Process;
2022
useSymfony\Component\Process\ProcessBuilder;
23+
useSymfony\Component\Process\Exception\RuntimeException;
2124

2225
/**
2326
* Runs Symfony application using PHP built-in web server.
@@ -114,14 +117,22 @@ protected function execute(InputInterface $input, OutputInterface $output)
114117
$builder->setTimeout(null);
115118
$process =$builder->getProcess();
116119

117-
if (OutputInterface::VERBOSITY_VERBOSE >$output->getVerbosity()) {
118-
$process->disableOutput();
120+
try {
121+
if (OutputInterface::VERBOSITY_NORMAL >$output->getVerbosity()) {
122+
$process->disableOutput();
123+
}else {
124+
$process->setTty(true);
125+
}
126+
$process->run();
127+
}catch (RuntimeException$e) {
128+
$process->run(function ($type,$buffer)use ($output) {
129+
if (Process::ERR ===$type &&$outputinstanceof ConsoleOutputInterface) {
130+
$output =$output->getErrorOutput();
131+
}
132+
$output->write($buffer,false, OutputInterface::OUTPUT_RAW);
133+
});
119134
}
120135

121-
$this
122-
->getHelper('process')
123-
->run($output,$process,null,null, OutputInterface::VERBOSITY_VERBOSE);
124-
125136
if (!$process->isSuccessful()) {
126137
$errorMessages =array('Built-in server terminated unexpectedly.');
127138

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp