/** * Constructor. * * @param Symfony\Foundation\Kernel $kernel A Kernel instance * @param array $server The server parameters (equivalent of $_SERVER) * @param Symfony\Components\BrowserKit\History $history A History instance to store the browser history * @param Symfony\Components\BrowserKit\CookieJar $cookieJar A CookieJar instance to store the cookies */ public function __construct(Kernel $kernel, array $server = array(), History $history = null, CookieJar $cookieJar = null) { $this->kernel = $kernel; $this->container = $kernel->getContainer(); parent::__construct($kernel->getContainer()->getHttpKernelService(), $server, $history, $cookieJar); $this->addTestersFromContainer(); }
/** * Constructor. */ public function __construct(Kernel $kernel) { $this->kernel = $kernel; parent::__construct('Symfony', Kernel::VERSION . ' - ' . $kernel->getName()); $this->definition->addOption(new InputOption('--shell', '-s', InputOption::PARAMETER_NONE, 'Launch the shell.')); $this->kernel->boot(); $this->registerCommands(); }
public function compile($pharFile = 'goutte.phar') { if (file_exists($pharFile)) { unlink($pharFile); } $phar = new \Phar($pharFile, 0, 'Goutte'); $phar->setSignatureAlgorithm(\Phar::SHA1); $phar->startBuffering(); // CLI Component files foreach ($this->getFiles() as $file) { $path = str_replace(__DIR__ . '/', '', $file); $content = Kernel::stripComments(file_get_contents($file)); $content = preg_replace("#require_once 'Zend/.*?';#", '', $content); $phar->addFromString($path, $content); } // Stubs $phar['_cli_stub.php'] = $this->getCliStub(); $phar['_web_stub.php'] = $this->getWebStub(); $phar->setDefaultStub('_cli_stub.php', '_web_stub.php'); $phar->stopBuffering(); // $phar->compressFiles(\Phar::GZ); unset($phar); }
public function __construct($environment, $debug, $name) { parent::__construct($environment, $debug); $this->name = $name; }
protected function addPhpFile(\Phar $phar, $name, $content) { $phar[$name] = Kernel::stripComments($content); }