當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Process::getStatus方法代碼示例

本文整理匯總了PHP中Symfony\Component\Process\Process::getStatus方法的典型用法代碼示例。如果您正苦於以下問題:PHP Process::getStatus方法的具體用法?PHP Process::getStatus怎麽用?PHP Process::getStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\Process\Process的用法示例。


在下文中一共展示了Process::getStatus方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute_behat_generator

 /**
  * Execute behat command for featurename and return exit status.
  *
  * @param string $featurename name of the feature
  * @param string $featurepath path of feature file
  * @return int status code.
  */
 protected function execute_behat_generator($featurename, $featurepath)
 {
     $cmd = "vendor/bin/behat --config " . util::get_tool_dir() . DIRECTORY_SEPARATOR . 'behat.yml ' . $featurepath;
     $process = new symfonyprocess($cmd);
     $process->setWorkingDirectory(__DIR__ . "/../../moodle");
     $process->setTimeout(null);
     $process->start();
     if ($process->getStatus() !== 'started') {
         echo "Error starting process: {$featurename}";
         $process->signal(SIGKILL);
         exit(1);
     }
     while ($process->isRunning()) {
         $output = $process->getIncrementalOutput();
         // Don't show start data everytime.
         $output = preg_replace('/[a-z0-9.\\(\\)].*/im', '', $output);
         $op = trim($output);
         if (!empty($op)) {
             echo $output;
         }
     }
     return $process->getExitCode();
 }
開發者ID:rajeshtaneja,項目名稱:moodle-performance-tool,代碼行數:30,代碼來源:generator.php

示例2: execute_behat_generator

 /**
  * Execute behat command for featurename and return exit status.
  *
  * @return int status code.
  */
 protected function execute_behat_generator()
 {
     $cmd = "vendor/bin/behat --config " . util::get_tool_dir() . DIRECTORY_SEPARATOR . 'behat.yml ';
     $process = new Process($cmd);
     $process->setWorkingDirectory(__DIR__ . "/../../../../../");
     $process->setTimeout(null);
     $process->start();
     if ($process->getStatus() !== 'started') {
         echo "Error starting process";
         $process->signal(SIGKILL);
         exit(1);
     }
     while ($process->isRunning()) {
         $output = $process->getIncrementalOutput();
         $op = trim($output);
         if (!empty($op)) {
             echo $output;
         }
     }
     if ($process->getExitCode() !== 0) {
         echo $process->getErrorOutput();
     }
     return $process->getExitCode();
 }
開發者ID:rajeshtaneja,項目名稱:moodle-performance-toolkit,代碼行數:29,代碼來源:generator.php


注:本文中的Symfony\Component\Process\Process::getStatus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。