当前位置: 首页>>代码示例>>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;未经允许,请勿转载。