/** * Run child process. * * @param Daemonize $daemon * * @return mixed */ public function runChildProcess(Daemonize $daemon) { $this->output->setEnableAnsi(false); $this->output->setStdOut($this->log); $this->output->setStdErr($this->log); $this->process->start(); if (!$this->process->isRunning()) { throw new RuntimeException('Unable to start server process.'); } $this->processControl->setPid($this->process->getPid()); $this->process->wait(function ($type, $buffer) { $this->output->writeln($buffer); }); }
/** * Run console. * * @param AbstractInput $input */ public function run(AbstractInput $input) { $this->output = $this->output ?: new Output(); $input->bind($this->definition); if (true === $input->option->get('no-ansi')) { $this->output->setEnableAnsi(false); } if (true === $input->option->get('help')) { $this->application->writeHelp($this, $input->option->all()); } else { $input->validate(); $args = func_get_args(); array_shift($args); call_user_func_array(array($this, 'execute'), array_merge(array($input, $this->output), $args)); } }