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


PHP PhpProcess::setPhpBinary方法代码示例

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


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

示例1: createProcess

 /**
  * Create process
  */
 protected function createProcess()
 {
     // initialisation du process
     $this->process = new PhpProcess($this->getScript(), $this->getConfiguration()->getCwd(), $this->getConfiguration()->getEnv(), $this->getConfiguration()->getTimeout());
     if ($this->configuration->getParameter('PHP_BINARY')) {
         $this->process->setPhpBinary($this->configuration->getParameter('PHP_BINARY'));
     }
 }
开发者ID:itkg,项目名称:batch,代码行数:11,代码来源:Console.php

示例2: createAndRun

    /**
     * Initiates new actor in a new PHP process
     * @param integer  $id An unique id of an actor, should be free tcp-port in current implementation
     * @param callable $handler
     * @return PhpProcess
     */
    public static function createAndRun($id, callable $handler)
    {
        $serializedHandler = base64_encode((new Serializer())->serialize($handler));
        $autoloadPath = Utils::getAutoloadPath();
        $process = new PhpProcess(<<<EOF
    <?php
        require '{$autoloadPath}';
        \\Phactor\\Phactor\\Actor::initializeChild({$id}, '{$serializedHandler}');
    ?>
EOF
);
        if (null === $process->getCommandLine()) {
            $process->setPhpBinary(PHP_BINARY);
        }
        // workaround for portable windows php
        $process->start();
        return $process;
    }
开发者ID:elnoro,项目名称:phactor,代码行数:24,代码来源:Actor.php

示例3: doRequestInProcess

 /**
  * Makes a request in another process.
  *
  * @param object $request An origin request instance
  *
  * @return object An origin response instance
  *
  * @throws \RuntimeException When processing returns exit code
  * @see \Symfony\Component\BrowserKit\Client
  * @see \Symfony\Component\HttpKernel\Client
  */
 protected function doRequestInProcess($request)
 {
     // We set the TMPDIR (for Macs) and TEMP (for Windows), because on these platforms the temp directory changes based on the user.
     $process = new PhpProcess($this->getScript($request), $this->rootDir, array('TMPDIR' => sys_get_temp_dir(), 'TEMP' => sys_get_temp_dir()));
     $process->setPhpBinary('php-cgi');
     $process->run();
     // I think the second hcheck validates that the response is serialized, but that's not what we want here.
     //if (!$process->isSuccessful() || !preg_match('/^O\:\d+\:/', $process->getOutput())) {
     if (!$process->isSuccessful()) {
         throw new \RuntimeException(sprintf('OUTPUT: %s ERROR OUTPUT: %s', $process->getOutput(), $process->getErrorOutput()));
     }
     return $process->getOutput();
 }
开发者ID:bangpound,项目名称:drupal-kernel,代码行数:24,代码来源:Kernel.php


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