Skip to content

Commit

Permalink
Merge pull request #35 from jimbojsb/phar
Browse files Browse the repository at this point in the history
Add Phar support.
  • Loading branch information
pda committed Feb 3, 2012
2 parents 5b38924 + 1820dca commit 9bff1f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pheanstalk.phar
.idea
15 changes: 15 additions & 0 deletions makephar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
@unlink(__DIR__ . 'pheanstalk.phar');

$phar = new Phar(__DIR__ . '/pheanstalk.phar');
$phar->buildFromDirectory(__DIR__ . '/classes');

$bootstrapFile = file_get_contents(__DIR__ . '/pheanstalk_init.php');
$bootstrapFile = str_replace('<?php', '', $bootstrapFile);

$stub .= "<?php" . PHP_EOL;
$stub .= "Phar::mapPhar();" . PHP_EOL;
$stub .= $bootstrapFile . PHP_EOL;
$stub .= "__HALT_COMPILER();" . PHP_EOL;
$phar->setStub($stub);
?>

0 comments on commit 9bff1f2

Please sign in to comment.