Commit 744af92b authored by Fabien Potencier's avatar Fabien Potencier

added missing files in the PHAR

parent be090ea7
...@@ -48,12 +48,12 @@ class Compiler ...@@ -48,12 +48,12 @@ class Compiler
; ;
foreach ($finder as $file) { foreach ($finder as $file) {
$path = str_replace(realpath(__DIR__.'/../..').'/', '', $file->getRealPath()); $this->addFile($phar, $file);
$content = Kernel::stripComments(file_get_contents($file));
$phar->addFromString($path, $content);
} }
$this->addFile($phar, new \SplFileInfo(__DIR__.'/../../LICENSE'), false);
$this->addFile($phar, new \SplFileInfo(__DIR__.'/../../autoload.php'));
// Stubs // Stubs
$phar['_cli_stub.php'] = $this->getStub(); $phar['_cli_stub.php'] = $this->getStub();
$phar['_web_stub.php'] = $this->getStub(); $phar['_web_stub.php'] = $this->getStub();
...@@ -66,6 +66,17 @@ class Compiler ...@@ -66,6 +66,17 @@ class Compiler
unset($phar); unset($phar);
} }
protected function addFile($phar, $file, $strip = true)
{
$path = str_replace(realpath(__DIR__.'/../..').'/', '', $file->getRealPath());
$content = file_get_contents($file);
if ($strip) {
$content = Kernel::stripComments(file_get_contents($file));
}
$phar->addFromString($path, $content);
}
protected function getStub() protected function getStub()
{ {
return <<<EOF return <<<EOF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment