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


PHP Process::setCommandLine方法代码示例

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


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

示例1: iRunBehat

 /**
  * @When /^I run behat$/
  */
 public function iRunBehat()
 {
     $this->process->setWorkingDirectory($this->workingDir);
     $this->process->setCommandLine(sprintf('%s %s %s %s', $this->phpBin, escapeshellarg(BEHAT_BIN_PATH), strtr('--format-settings=\'{"timer": false}\'', array('\'' => '"', '"' => '\\"')), '--format=progress'));
     $this->process->start();
     $this->process->wait();
 }
开发者ID:icambridge,项目名称:BehatPageObjectExtension,代码行数:10,代码来源:BehatRunnerContext.php

示例2: iRunBehat

 /**
  * Runs behat command with provided parameters
  *
  * @When /^I run "behat(?: ([^"]*))?"$/
  *
  * @param   string $argumentsString
  */
 public function iRunBehat($argumentsString = '')
 {
     $argumentsString = strtr($argumentsString, array('\'' => '"'));
     $this->process->setWorkingDirectory($this->workingDir);
     $this->process->setCommandLine(sprintf('%s %s %s %s', $this->phpBin, escapeshellarg(BEHAT_BIN_PATH), $argumentsString, strtr('--format-settings=\'{"timer": false}\'', array('\'' => '"', '"' => '\\"'))));
     $this->process->run();
 }
开发者ID:AntonKalachev,项目名称:ChainedStepsExtension,代码行数:14,代码来源:FeatureContext.php

示例3: run

 /**
  * Run a command as a process.
  *
  * @param string $command
  * @return self
  */
 public function run($command)
 {
     $this->command = escapeshellcmd($command);
     $this->process->setCommandLine($this->command);
     $this->process->run();
     $this->validateRun();
     return $this;
 }
开发者ID:vuthaihoc,项目名称:pdf-parser,代码行数:14,代码来源:Process.php

示例4: archive

 /**
  * Executes the backup command.
  */
 public function archive()
 {
     $this->process->setCommandLine($this->getCommand());
     $this->process->run();
     if ($this->process->getErrorOutput()) {
         throw new \RuntimeException($this->process->getErrorOutput());
     }
 }
开发者ID:nadimtuhin,项目名称:archiver,代码行数:11,代码来源:ZipArchiver.php

示例5: process

 /**
  * @param $command
  * @throws ShellProcessFailed
  * @throws \Symfony\Component\Process\Exception\LogicException
  */
 public function process($command)
 {
     if (empty($command)) {
         return;
     }
     $this->process->setCommandLine($command);
     $this->process->run();
     if (!$this->process->isSuccessful()) {
         throw new ShellProcessFailed($this->process->getErrorOutput());
     }
 }
开发者ID:parabol,项目名称:laravel-cms,代码行数:16,代码来源:ShellProcessor.php

示例6: doRunBehat

 /**
  * @param string $configurationAsString
  */
 private function doRunBehat($configurationAsString)
 {
     $this->process->setWorkingDirectory($this->testApplicationDir);
     $this->process->setCommandLine(sprintf('%s %s %s', $this->phpBin, escapeshellarg(BEHAT_BIN_PATH), $configurationAsString));
     $this->process->start();
     $this->process->wait();
 }
开发者ID:Canu667,项目名称:todoapp,代码行数:10,代码来源:FeatureContext.php

示例7: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->downloadConfiguration();
     $library = new GLibc();
     try {
         $this->download()->extract();
         $library->setEnv($this->env)->setProjectDir($this->baseDir)->initialize()->boot($input, $output);
         $configure = $this->projectDir . '/' . $library->configure();
         $this->projectDir = dirname($this->projectDir) . '/glibc-build';
         $this->fs->mkdir($this->projectDir);
         $this->output->write('    Building   :  ');
         $process = new Process($configure, $this->projectDir, $this->env->toArray());
         $process->setTimeout(0);
         $process->run();
         if ($process->isSuccessful()) {
             $process->setCommandLine('make -j4 && make -j4 install');
             $process->run();
         }
         if ($process->isSuccessful()) {
             $message = '<info>✔</info>';
         } else {
             $message = '<error>✕</error>';
         }
         $this->output->writeln($message);
     } catch (\Exception $e) {
         $this->cleanUp();
         throw $e;
     }
     $this->createConfiguration();
     $this->output->writeln(sprintf(" <info>%s</info>  Droidphp Installer <info>successfully configured</info> Now you can:\n" . "    * Run :\n" . "        1. Execute the <comment>%s build:components</comment> command.\n" . " To Build the project\n\n", defined('PHP_WINDOWS_VERSION_BUILD') ? 'OK' : '✔', basename($_SERVER['PHP_SELF'])));
 }
开发者ID:mozanturhan,项目名称:droidphp-installer,代码行数:31,代码来源:SetupCommand.php

示例8: iRunBehat

 /**
  * Runs Behat with provided parameters.
  *
  * @When /^I run "behat(?: ((?:\"|[^"])*))?"$/
  *
  * @param string $argumentsString
  */
 public function iRunBehat($argumentsString = '')
 {
     $argumentsString = strtr($argumentsString, ['\'' => '"']);
     $this->behatProcess->setWorkingDirectory($this->workingDir);
     $this->behatProcess->setCommandLine(sprintf('%s %s %s %s', $this->phpBin, escapeshellarg(BEHAT_BIN_PATH), $argumentsString, strtr('--format-settings=\'{"timer": false}\' --no-colors', ['\'' => '"', '"' => '\\"'])));
     $this->behatProcess->start();
     $this->behatProcess->wait();
 }
开发者ID:elifesciences,项目名称:isolated-drupal-behat-extension,代码行数:15,代码来源:FeatureContext.php

示例9: iRunPhpspec

 /**
  * Runs phpspec command with provided parameters
  *
  * @When /^I run "phpspec(?: ((?:\"|[^"])*))?"$/
  *
  * @param string $argumentsString
  */
 public function iRunPhpspec($argumentsString = '')
 {
     $argumentsString = strtr($argumentsString, array('\'' => '"'));
     $this->process->setWorkingDirectory($this->workingDir);
     $this->process->setCommandLine(sprintf('%s %s %s --no-interaction', $this->phpBin, escapeshellarg($this->getPhpspecBinPath()), $argumentsString));
     $this->process->start();
     $this->process->wait();
 }
开发者ID:codifico,项目名称:phpspec-rest-view-extension,代码行数:15,代码来源:FeatureContext.php

示例10:

 function it_should_not_process_empty_commands(Process $process)
 {
     $process->setCommandLine('')->shouldNotBeCalled();
     $process->run()->shouldNotBeCalled();
     $process->isSuccessful()->willReturn(true);
     /** @noinspection PhpParamsInspection */
     $this->beConstructedWith($process);
     $this->process('');
 }
开发者ID:parabol,项目名称:laravel-cms,代码行数:9,代码来源:ShellProcessorSpec.php

示例11: iRunFiller

 /**
  * Runs behat command with provided parameters
  *
  * @When /^I run "filler(?: ((?:\"|[^"])*))?"$/
  *
  * @param   string $argumentsString
  */
 public function iRunFiller($argumentsString = '')
 {
     $argumentsString = str_replace('{dir}', $this->workingDir, strtr($argumentsString, array('\'' => '"')));
     $this->process->setWorkingDirectory($this->workingDir);
     $command = sprintf('%s %s %s', $this->phpBin, escapeshellarg($this->binDir . 'filler'), $argumentsString);
     $this->process->setCommandLine($command);
     $this->process->start();
     // TODO store exit code and process output for verification
     $exitCode = $this->process->wait();
 }
开发者ID:robmasters,项目名称:filler,代码行数:17,代码来源:FeatureContext.php

示例12: executeCommand

 /**
  * Executes a app/console command
  *
  * @param array           $args    Arguments
  * @param OutputInterface $output  Output
  * @param string          $message Message to be shown on error.
  *
  * @return integer|null Exit code
  */
 public function executeCommand(array $args, OutputInterface $output, $message)
 {
     $name = $args[0];
     $cmd = $this->getCmd($args);
     $output->writeln('');
     $output->writeln(sprintf('<info>Running %s</info>', $name));
     $output->writeln(sprintf('<comment>%s</comment>', $cmd));
     $this->process->setCommandLine($cmd);
     $this->process->run(function ($type, $buffer) use($output, $cmd) {
         if (Process::ERR === $type) {
             $output->writeln(sprintf('<error>%s</error>', $buffer));
         } else {
             $output->writeln(sprintf('<comment>%s</comment>', $buffer));
         }
     });
     if (!$this->process->isSuccessful()) {
         throw new \RuntimeException($message . '<error>' . $this->process->getErrorOutput() . '</error>');
     }
 }
开发者ID:alebon,项目名称:graviton,代码行数:28,代码来源:CommandRunner.php

示例13: runProcess

 /**
  * @param string $commandline
  * @return string
  * @throws ProcessFailedException
  */
 protected function runProcess($commandline)
 {
     if (null === $this->process) {
         $this->process = new Process(null);
     }
     $this->process->setCommandLine($commandline);
     $this->process->run();
     if (!$this->process->isSuccessful()) {
         throw new ProcessFailedException($this->process);
     }
     return trim($this->process->getOutput());
 }
开发者ID:ramunasd,项目名称:platform,代码行数:17,代码来源:PermissionsHandler.php

示例14: executeCommand

 protected static function executeCommand($command)
 {
     $process = new Process(null);
     $process->setCommandLine($command);
     $process->setTimeout(300);
     $process->run(function ($type, $buffer) {
         echo $buffer;
     });
     if (!$process->isSuccessful()) {
         throw new \RuntimeException(sprintf('An error occurred while executing \'%s\'.', $command));
     }
 }
开发者ID:webgriffe,项目名称:magento-installer,代码行数:12,代码来源:ScriptHandler.php

示例15: start

 public function start()
 {
     $seleniumUrl = $this->seleniumOptions->getSeleniumUrl();
     $seleniumQuery = $this->seleniumOptions->getSeleniumQuery();
     $seleniumJarLocation = $this->seleniumOptions->getSeleniumJarLocation();
     if (!$seleniumUrl || !$seleniumQuery || !$seleniumJarLocation) {
         throw new \LogicException('Url, Query and Selenium Jar Location is mandatory and Jar Location should point to a .jar file.');
     }
     if (!is_file($seleniumJarLocation)) {
         throw new \RuntimeException('Selenium jar is not a file');
     }
     if (!is_readable($seleniumJarLocation)) {
         throw new \RuntimeException('Selenium jar not readable - ' . $seleniumJarLocation);
     }
     if ($this->isSeleniumAvailable()) {
         throw new \RuntimeException('Selenium was already started');
     }
     $this->setStartCommand($this->createStartCommand());
     $this->process->setCommandLine($this->getStartCommand());
     $this->process->start();
     $this->responseWaitter->waitUntilAvailable($seleniumUrl, $seleniumQuery);
 }
开发者ID:fonsecas72,项目名称:selenium-handler,代码行数:22,代码来源:SeleniumStarter.php


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