Skip to content

Commit

Permalink
CLI workers (#26)
Browse files Browse the repository at this point in the history
* support PHP_CLI_SERVER_WORKERS in built-in webserver

* just use putenv

* fix test
  • Loading branch information
TomK authored Jan 11, 2021
1 parent 9f3a4ca commit 0d95366
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Console/Commands/BuiltInWebServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ class BuiltInWebServer extends ConsoleCommand
public $port;
public $showfig = true;
public $router = 'public/index.php';
/**
* Number of workers
* php>=7.4
*
* @short w
*/
public $workers = 5;

/**
* @short c
Expand Down Expand Up @@ -105,6 +112,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->write(Figlet::create('SERVER', 'ivrit'));
}

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

Expand Down

0 comments on commit 0d95366

Please sign in to comment.