/** * Runs the command, returns the proc after it's done * @return \Symfony\Component\Process\Process */ public function execute($options = array()) { $cmd = $this->buildCommand($options); $env = defined('PHP_WINDOWS_VERSION_BUILD') ? Habitat::getAll() : null; $proc = new Process($cmd, null, $env, null, $timeout = 600); $proc->run(); return $proc; }
protected function getFinishedProc($cmd, &$pipes) { $env = defined('PHP_WINDOWS_VERSION_BUILD') ? Habitat::getAll() : null; $this->lastExecutedCommand = $cmd; $proc = new \Symfony\Component\Process\Process($cmd, null, $env, null, $timeout = 600); $this->waitForProc($proc); return $proc; }
/** * Runs the command, returns the proc after it's done * * @param array $options * @param callable $callback * * @return Process */ public function execute($options = array(), $callback = null) { $cmd = $this->buildCommand($options); $env = defined('PHP_WINDOWS_VERSION_BUILD') ? Habitat::getAll() : null; $proc = new Process($cmd, null, $env, null, $timeout = 600); if (!is_callable($callback)) { $proc->run(); } else { $proc->run($callback); } return $proc; }
/** * This method removes ExecutableTest objects from the pending collection * and adds them to the running collection. It is also in charge of recycling and * acquiring available test tokens for use */ private function fillRunQueue() { $opts = $this->options; while (sizeof($this->pending) && sizeof($this->running) < $opts->processes) { $tokenData = $this->getNextAvailableToken(); if ($tokenData !== false) { $this->acquireToken($tokenData['token']); $env = array('TEST_TOKEN' => $tokenData['token'], 'UNIQUE_TEST_TOKEN' => $tokenData['unique']) + Habitat::getAll(); $this->running[$tokenData['token']] = array_shift($this->pending)->run($opts->phpunit, $opts->filtered, $env); } } }
/** * Returns all environment variables. If $_ENV * is set it will be returned, otherwise $_ENV * will be set to information parsed from phpinfo() * and then returned * * @return array */ public static function getAll() { return Habitat::getInstance()->getEnvironment()->getAll(); }