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