コード例 #1
0
 /**
  * Execute console.
  *
  * @param AbstractInput $input
  * @param Output        $output
  */
 protected function execute(AbstractInput $input, Output $output)
 {
     $address = $input->option->get('address');
     $port = $input->option->get('port');
     $processControl = new ProcessControl(sprintf('%s:%s', $address, $port));
     if (false === $processControl->isRunning()) {
         throw new RuntimeException(sprintf('There are no active daemon run in "%s:%s"', $address, $port));
     }
     $output->writeln('<style name="info">Shutting down Borobudur development server</style>');
     $processControl->kill();
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 protected function initDaemon(AbstractInput $input, Output $output)
 {
     $log = $input->option->get('log');
     $this->log = fopen($log ? $log : $this->getDefaultLog(), 'a');
     $this->processControl = new ProcessControl(sprintf('%s:%s', $this->address, $this->port));
     $this->processControl->check();
     $this->output = $output;
 }
コード例 #3
0
 /**
  * Shutdown the process.
  *
  * @return int
  */
 public function shutdown()
 {
     return $this->process->kill();
 }