public startWorkers ( ) |
public function startWorkers()
{
// Get verbosity.
$verbosity = new VerbosityString($this->output);
// Get current deploy.php file.
$deployPhpFile = $this->input->getOption('file');
// User input.
$input = '';
// Get user arguments.
foreach ($this->userDefinition->getArguments() as $argument) {
$value = $this->input->getArgument($argument->getName());
if ($value) {
$input .= " {$value}";
}
}
// Get user options.
foreach ($this->userDefinition->getOptions() as $option) {
$value = $this->input->getOption($option->getName());
if ($value) {
$input .= " --{$option->getName()} {$value}";
}
}
foreach ($this->servers as $serverName => $server) {
$process = new Process("php " . DEPLOYER_BIN . (null === $deployPhpFile ? "" : " --file={$deployPhpFile}") . " worker " . " --master 127.0.0.1:{$this->port}" . " --server {$serverName}" . " {$input} " . " {$verbosity}" . " &");
$process->disableOutput();
$process->start();
}
}