当前位置: 首页>>代码示例>>PHP>>正文


PHP Process::setEnhanceSigchildCompatibility方法代码示例

本文整理汇总了PHP中Symfony\Component\Process\Process::setEnhanceSigchildCompatibility方法的典型用法代码示例。如果您正苦于以下问题:PHP Process::setEnhanceSigchildCompatibility方法的具体用法?PHP Process::setEnhanceSigchildCompatibility怎么用?PHP Process::setEnhanceSigchildCompatibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Process\Process的用法示例。


在下文中一共展示了Process::setEnhanceSigchildCompatibility方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: start

 /**
  * Starts a wiremock process.
  *
  * @param string $jarPath
  * @param string $logsPath
  * @param string $arguments
  *
  * @throws \Exception
  */
 public function start($ip, $port, $path, $logsPath, $debug)
 {
     $phiremockPath = is_file($path) ? $path : "{$path}/phiremock";
     $this->process = new Process($this->getCommandPrefix() . "{$phiremockPath} -i {$ip} -p {$port}" . ($debug ? ' -d' : ''));
     if ($debug) {
         echo 'Executing: ' . $this->process->getCommandLine() . PHP_EOL;
     }
     $logFile = $logsPath . DIRECTORY_SEPARATOR . self::LOG_FILE_NAME;
     $this->process->start(function ($type, $buffer) use($logFile) {
         file_put_contents($logFile, $buffer, FILE_APPEND);
     });
     $this->process->setEnhanceSigchildCompatibility(true);
     if ($this->isWindows()) {
         $this->process->setEnhanceWindowsCompatibility(true);
     }
 }
开发者ID:mcustiel,项目名称:phiremock-codeception-extension,代码行数:25,代码来源:PhiremockProcess.php

示例2: getProcess

 /**
  * @param string      $commandline
  * @param null|string $cwd
  * @param null|array  $env
  * @param null|string $input
  * @param int         $timeout
  * @param array       $options
  *
  * @return Process
  */
 private function getProcess($commandline, $cwd = null, array $env = null, $input = null, $timeout = 60, array $options = array())
 {
     $process = new Process($commandline, $cwd, $env, $input, $timeout, $options);
     if (false !== ($enhance = getenv('ENHANCE_SIGCHLD'))) {
         try {
             $process->setEnhanceSigchildCompatibility(false);
             $process->getExitCode();
             $this->fail('ENHANCE_SIGCHLD must be used together with a sigchild-enabled PHP.');
         } catch (RuntimeException $e) {
             $this->assertSame('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.', $e->getMessage());
             if ($enhance) {
                 $process->setEnhanceSigChildCompatibility(true);
             } else {
                 self::$notEnhancedSigchild = true;
             }
         }
     }
     if (self::$process) {
         self::$process->stop(0);
     }
     return self::$process = $process;
 }
开发者ID:Ener-Getick,项目名称:symfony,代码行数:32,代码来源:ProcessTest.php


注:本文中的Symfony\Component\Process\Process::setEnhanceSigchildCompatibility方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。