function php($argv, $callback = null, $options = array()) { $execFinder = new \Symfony\Component\Process\PhpExecutableFinder(); $php = $execFinder->find(); $argv = (array) $argv; array_unshift($argv, $php); return sh($argv, $callback, $options); }
private static function _createServerProcess($documentRoot) { $finder = new \Symfony\Component\Process\PhpExecutableFinder(); if (false === ($binary = $finder->find())) { throw new RuntimeException('Unable to find PHP binary to start server.'); } $script = implode(' ', array_map(array('Symfony\\Component\\Process\\ProcessUtils', 'escapeArgument'), array($binary, '-S', self::$_WEB_SERVER_ADDRESS))); return new \Symfony\Component\Process\Process('exec ' . $script, $documentRoot, null, null, null); }
protected function getPhpBinary() { $executableFinder = new \Symfony\Component\Process\PhpExecutableFinder(); return $executableFinder->find(); }