當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。