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


PHP PhpProcess::getCommandLine方法代码示例

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


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

示例1: testCommandLine

    public function testCommandLine()
    {
        $process = new PhpProcess(<<<'PHP'
<?php echo 'foobar';
PHP
);
        $commandLine = $process->getCommandLine();
        $f = new PhpExecutableFinder();
        $this->assertContains($f->find(), $commandLine, '::getCommandLine() returns the command line of PHP before start');
        $process->start();
        $this->assertContains($commandLine, $process->getCommandLine(), '::getCommandLine() returns the command line of PHP after start');
        $process->wait();
        $this->assertContains($commandLine, $process->getCommandLine(), '::getCommandLine() returns the command line of PHP after wait');
    }
开发者ID:Ener-Getick,项目名称:symfony,代码行数:14,代码来源:PhpProcessTest.php

示例2: testCommandLine

    public function testCommandLine()
    {
        if ('phpdbg' === PHP_SAPI) {
            $this->markTestSkipped('phpdbg SAPI is not supported by this test.');
        }
        $process = new PhpProcess(<<<PHP
<?php echo 'foobar';
PHP
);
        $f = new PhpExecutableFinder();
        $commandLine = $f->find();
        $this->assertSame($commandLine, $process->getCommandLine(), '::getCommandLine() returns the command line of PHP before start');
        $process->start();
        $this->assertSame($commandLine, $process->getCommandLine(), '::getCommandLine() returns the command line of PHP after start');
        $process->wait();
        $this->assertSame($commandLine, $process->getCommandLine(), '::getCommandLine() returns the command line of PHP after wait');
    }
开发者ID:nix9,项目名称:laracasts,代码行数:17,代码来源:PhpProcessTest.php

示例3: 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

示例4: getCommandLine

 /**
  * @return CommandLine
  */
 public function getCommandLine()
 {
     return new CommandLine(parent::getCommandLine());
 }
开发者ID:liuggio,项目名称:spawn,代码行数:7,代码来源:ClosureProcess.php


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