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


PHP Runtime::getBinary方法代码示例

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


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

示例1: getCommand

 /**
  * Returns the command based into the configurations.
  *
  * @param array $settings
  *
  * @return string
  */
 public function getCommand(array $settings)
 {
     $command = $this->runtime->getBinary();
     $command .= $this->settingsToParameters($settings);
     if (true === $this->stderrRedirection) {
         $command .= ' 2>&1';
     }
     return $command;
 }
开发者ID:noikiy,项目名称:phpunit,代码行数:16,代码来源:PHP.php

示例2: getCommand

 /**
  * Returns the command based into the configurations.
  *
  * @param array $settings
  *
  * @return string
  */
 public function getCommand(array $settings)
 {
     $command = $this->runtime->getBinary();
     $command .= $this->settingsToParameters($settings);
     if ('phpdbg' === PHP_SAPI) {
         $command .= ' -qrr ' . escapeshellarg(__DIR__ . '/PHP/eval-stdin.php');
     }
     if (true === $this->stderrRedirection) {
         $command .= ' 2>&1';
     }
     return $command;
 }
开发者ID:radmen,项目名称:phpunit,代码行数:19,代码来源:PHP.php

示例3: startJob

 /**
  * @param Job $job
  * @return bool
  */
 public function startJob(Job $job)
 {
     $this->pool->add($job);
     try {
         $runtime = new Runtime();
         $job->start($runtime->getBinary());
     } catch (ForkException $e) {
         $this->pool->remove($job);
         $job->startTest();
         $job->addError($e);
         $job->endTest();
         return false;
     }
     $job->startTest();
     return true;
 }
开发者ID:munkie,项目名称:karzer,代码行数:20,代码来源:JobRunner.php

示例4: runJob

 /**
  * Runs a single job (PHP code) using a separate PHP process.
  *
  * @param string $job
  * @param array  $settings
  *
  * @return array
  *
  * @throws PHPUnit_Framework_Exception
  */
 public function runJob($job, array $settings = [])
 {
     $runtime = new Runtime();
     $process = proc_open($runtime->getBinary() . $this->settingsToParameters($settings), [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes);
     if (!is_resource($process)) {
         throw new PHPUnit_Framework_Exception('Unable to spawn worker process');
     }
     $this->process($pipes[0], $job);
     fclose($pipes[0]);
     $stdout = stream_get_contents($pipes[1]);
     fclose($pipes[1]);
     $stderr = stream_get_contents($pipes[2]);
     fclose($pipes[2]);
     proc_close($process);
     $this->cleanup();
     return ['stdout' => $stdout, 'stderr' => $stderr];
 }
开发者ID:AntonyAntonio,项目名称:phpback,代码行数:27,代码来源:Default.php

示例5: runJob

 /**
  *
  * {@inheritdoc} Reading from STDOUT or STDERR hangs forever on Windows if the output is
  *               too large.
  *              
  * @see https://bugs.php.net/bug.php?id=51800
  */
 public function runJob($job, array $settings = array())
 {
     $runtime = new Runtime();
     if (false === ($stdout_handle = tmpfile())) {
         throw new PHPUnit_Framework_Exception('A temporary file could not be created; verify that your TEMP environment variable is writable');
     }
     $process = proc_open($runtime->getBinary() . $this->settingsToParameters($settings), array(0 => array('pipe', 'r'), 1 => $stdout_handle, 2 => array('pipe', 'w')), $pipes);
     if (!is_resource($process)) {
         throw new PHPUnit_Framework_Exception('Unable to spawn worker process');
     }
     $this->process($pipes[0], $job);
     fclose($pipes[0]);
     $stderr = stream_get_contents($pipes[2]);
     fclose($pipes[2]);
     proc_close($process);
     rewind($stdout_handle);
     $stdout = stream_get_contents($stdout_handle);
     fclose($stdout_handle);
     $this->cleanup();
     return array('stdout' => $stdout, 'stderr' => $stderr);
 }
开发者ID:sapwoo,项目名称:portfolio,代码行数:28,代码来源:Windows.php

示例6: testBinaryCanBeRetrieved

 /**
  * @covers \SebastianBergmann\Environment\Runtime::getBinary
  *
  * @uses   \SebastianBergmann\Environment\Runtime::isHHVM
  */
 public function testBinaryCanBeRetrieved()
 {
     $this->assertInternalType('string', $this->env->getBinary());
 }
开发者ID:baardbaard,项目名称:bb-twitterfeed,代码行数:9,代码来源:RuntimeTest.php

示例7: getPhpBinary

 private function getPhpBinary()
 {
     $runtime = new Runtime();
     return $runtime->getBinary();
 }
开发者ID:pahenrus,项目名称:child-process,代码行数:5,代码来源:AbstractProcessTest.php


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