Skip to content

Commit

Permalink
Add comment support
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Jan 11, 2021
1 parent 0d95366 commit cb99f41
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Console/Commands/BuiltInWebServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class BuiltInWebServer extends ConsoleCommand
* @short idekey
*/
public $debugIdeKey = 'PHPSTORM';
public $comment = '';

protected $_executeMethod = 'passthru';

Expand Down Expand Up @@ -112,7 +113,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->write(Figlet::create('SERVER', 'ivrit'));
}

putenv('PHP_CLI_SERVER_WORKERS=' . $this->workers);
if($this->workers > 0)
{
putenv('PHP_CLI_SERVER_WORKERS=' . $this->workers);
}
return $this->_runCommand($this->_buildCommand($output));
}

Expand Down Expand Up @@ -151,6 +155,10 @@ protected function _buildCommand(OutputInterface $output)
$output->write("http://");
$output->write($this->host === '0.0.0.0' ? '127.0.0.1' : $this->host);
$output->writeln(':' . $this->port);
if($this->comment)
{
$output->writeln($this->comment);
}

$phpCommand = PHP_BINARY;
if($this->debug)
Expand Down

0 comments on commit cb99f41

Please sign in to comment.