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


PHP Process::wait方法代码示例

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


在下文中一共展示了Process::wait方法的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: isSuccessful

 private function isSuccessful()
 {
     if (null === $this->isSuccessful) {
         $this->process->wait();
         $this->isSuccessful = $this->process->isSuccessful();
     }
     return $this->isSuccessful;
 }
开发者ID:fabpot,项目名称:php-cs-fixer,代码行数:8,代码来源:ProcessLintingResult.php

示例3: 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}\' --no-colors', array('\'' => '"', '"' => '\\"'))));
     $this->process->start();
     $this->process->wait();
 }
开发者ID:cam5,项目名称:WebApiExtension,代码行数:15,代码来源:FeatureContext.php

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

示例5: runCommand

 private function runCommand($cmd)
 {
     $process = new Process($cmd);
     $process->run();
     $process->wait();
     return $process;
 }
开发者ID:zsturgess,项目名称:herokuizemebundle,代码行数:7,代码来源:ExtensionDependancyHelper.php

示例6: runProcess

 /**
  * Run a terminal command
  * @param  [array]         $command  [description]
  * @param  [path]          $directory [description]
  * @param  OutputInterface $output    [description]
  * @return [void]                     [description]
  */
 private function runProcess($command, $directory, $output, $alias)
 {
     $output->writeln('');
     if (is_array($command['line'])) {
         $commandLine = implode(' && ', $command['line']);
     } else {
         $commandLine = $command['line'];
     }
     $process = new Process($commandLine, $directory);
     $process->setTimeout(7600);
     $process->start();
     if ($output->isVerbose()) {
         $process->wait(function ($type, $buffer) {
             echo $buffer;
         });
     } else {
         $progress = new ProgressBar($output);
         $progress->setFormat("<comment>%message%</comment> [%bar%]");
         $progress->setMessage($command['title']);
         $progress->start();
         $progress->setRedrawFrequency(10000);
         while ($process->isRunning()) {
             $progress->advance();
         }
         $progress->finish();
         $progress->clear();
     }
     $output->writeln('');
     $output->write('<comment>' . $command['title'] . ' </comment><info>√ done</info>');
 }
开发者ID:nobox,项目名称:nobox-laravel-installer,代码行数:37,代码来源:ProcessHelper.php

示例7: exec

 /**
  * Executes the command $cmd
  *
  * @param string $cmd
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  * @param bool $silent
  * @param bool $tty
  * @return string|void
  */
 public function exec($cmd, $output = null, $silent = FALSE, $tty = FALSE)
 {
     $process = new Process($cmd);
     if ($tty) {
         $process->setTty(TRUE);
     }
     $process->setTimeout(null);
     if (!$silent && $output) {
         $output->writeln($this->messageService->lightGray('-------------------------------------------------'));
         $output->writeln($this->messageService->lightGray('Executing: ' . $cmd));
         $messageService = $this->messageService;
         $process->setTimeout(3600);
         $process->start();
         $process->wait(function ($type, $buffer) use($output, $messageService) {
             if (Process::ERR === $type) {
                 $output->writeln($messageService->red('----> ERROR START'));
                 $output->write($messageService->red('----> ' . $buffer));
                 $output->writeln($messageService->red('----> ERROR END'));
             } else {
                 $output->write($messageService->green($buffer));
             }
         });
     } else {
         $process->run();
     }
     return $process->getOutput();
 }
开发者ID:kryslin,项目名称:instance-manager,代码行数:36,代码来源:CommandService.php

示例8: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $distribution = $input->getArgument('distribution');
     $version = $input->getArgument('version');
     $download = $this->downloadProject($distribution, $version);
     $process = new Process("tar -xzf {$download['location']} -C /tmp/");
     $process->start();
     if (substr($version, 0, 3) == '7.x') {
         $finder = new Finder();
         $process->wait();
         // Find all modules dropped in to the distribution.
         $finder->files()->name("*.info");
         $filename = array();
         foreach ($finder->in($download['locationUncompressed']) as $file) {
             $filename[] = array('path' => $file->getRealPath(), 'filename' => $file->getFileName());
         }
         // Create the array for the containing modules.
         $return = array();
         foreach ($filename as $file) {
             $contents = $this->parse_info_file(file_get_contents($file['path']));
             $machine_name = substr($file['filename'], 0, strpos($file['filename'], '.'));
             $return[$machine_name] = array('name' => $contents['name'], 'machine_name' => substr($file['filename'], 0, strpos($file['filename'], '.')), 'core' => $contents['core'], 'version' => $contents['version'], 'status' => 'Enabled', 'package' => isset($contents['package']) ? $contents['package'] : null);
         }
         $output->write(json_encode($return));
     }
 }
开发者ID:jkswoods,项目名称:stool,代码行数:26,代码来源:DistributionCommand.php

示例9: updateProject

 private function updateProject($docroot, $project, $version)
 {
     // Find the project, perform the update and applying patches (if applicable).
     $projectFilename = $this->substituteProjectName($project);
     $finder = new Finder();
     $finder->files()->name("{$projectFilename}.info");
     $filename = null;
     foreach ($finder->in($docroot) as $file) {
         $filename = $file->getRealPath();
     }
     if (!is_null($filename)) {
         $locationVars = $this->downloadProject($project, $version);
         $process = new Process("tar -xzf {$locationVars['location']} -C /tmp/");
         $process->start();
         $samuraiYmlLocation = $this->findSamuraiYaml($docroot);
         $process->wait();
         if (strlen($samuraiYmlLocation) > 0) {
             $this->applyPatches($locationVars, $docroot, $samuraiYmlLocation, $project);
         }
         $foldername = substr($filename, 0, -strlen("{$projectFilename}.info") - 1);
         $fs = new Filesystem();
         $fs->remove($foldername);
         $fs->rename($locationVars['locationUncompressed'], $foldername);
         if (strlen($samuraiYmlLocation) > 0) {
             $this->cleanupPatching($docroot);
         }
         $this->cleanupPatching($docroot);
     } elseif ($project == 'drupal') {
         $locationVars = $this->downloadProject($project, $version);
         $process = new Process("tar -xzf {$locationVars['location']} -C /tmp/");
         $process->start();
         $samuraiYmlLocation = $this->findSamuraiYaml($docroot);
         $process->wait();
         if (strlen($samuraiYmlLocation) > 0) {
             $this->applyPatches($locationVars, $docroot, $samuraiYmlLocation, $project);
         }
         $fs = new Filesystem();
         $newCoreFiles = scandir($locationVars['locationUncompressed']);
         foreach ($newCoreFiles as $key => $file) {
             switch ($file) {
                 case '..':
                 case '.':
                 case '.htaccess':
                 case '.gitignore':
                 case 'sites':
                     unset($newCoreFiles[$key]);
                     $file = null;
                     break;
             }
             if (!is_null($file)) {
                 $fs->remove($docroot . '/' . $file);
                 $fs->rename($locationVars['locationUncompressed'] . '/' . $file, $docroot . '/' . $file);
             }
         }
         if (strlen($samuraiYmlLocation) > 0) {
             $this->cleanupPatching($docroot);
         }
     }
 }
开发者ID:jkswoods,项目名称:stool,代码行数:59,代码来源:UpdateCommand.php

示例10: execute

 /**
  * Execute a supervisorctl command
  *
  * @param $cmd string supervisorctl command
  * @return \Symfony\Component\Process\Process
  */
 public function execute($cmd)
 {
     $p = new Process(sprintf('supervisorctl%1$s %2$s', $this->configurationParameter, $cmd));
     $p->setWorkingDirectory($this->applicationDirectory);
     $p->run();
     $p->wait();
     return $p;
 }
开发者ID:robholmes,项目名称:rabbitmq-supervisor-bundle,代码行数:14,代码来源:Supervisor.php

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

示例12: execute

 /**
  * Process ctl command
  *
  * @param $cmd string supervisorctl command
  * @return Process
  */
 public function execute($cmd)
 {
     $p = new Process("supervisorctl " . $cmd);
     $p->setWorkingDirectory($this->appDir);
     $p->run();
     $p->wait();
     return $p;
 }
开发者ID:acassan,项目名称:supervisord-bundle,代码行数:14,代码来源:Supervisord.php

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

示例14: addPromise

 /**
  * Add optional promise to process options
  *
  * @param Process $process
  * @return Promise
  */
 private function addPromise(Process $process)
 {
     /** @var Promise $promise */
     $promise = new Promise(function () use($process, &$promise) {
         $process->wait();
         $promise->resolve($process);
     });
     $process->setOptions([ProcessQueue::PROMISE_KEY => $promise]);
     return $promise;
 }
开发者ID:epfremmer,项目名称:process-queue,代码行数:16,代码来源:ProcessQueueTest.php

示例15: handle

 /**
  * Execute the job.
  * @return void
  */
 public function handle()
 {
     $shell = "/bin/bash " . $this->shellPath . '/resources/shell/deploy.sh' . ' ' . base_path() . ' ' . env('SL_DEPLOY_BRANCH', 'master');
     $process = new Process($shell);
     $process->start();
     $process->wait(function ($type, $buffer) {
         if (Process::ERR === $type) {
             echo 'ERR > ' . $buffer;
         } else {
             echo 'OUT > ' . $buffer;
         }
     });
 }
开发者ID:imvkmark,项目名称:sl-deploy,代码行数:17,代码来源:WebDeploy.php


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