From: Christian Weiske Date: Tue, 25 Feb 2014 20:11:46 +0000 (+0100) Subject: script to generate phar file X-Git-Tag: v0.5.0~23 X-Git-Url: https://git.cweiske.de/bdrem.git/commitdiff_plain/5274821c5d92a9267ec992ec1d6757c4765ee5e8 script to generate phar file --- diff --git a/bin/makephar.php b/bin/makephar.php new file mode 100755 index 0000000..6089b0c --- /dev/null +++ b/bin/makephar.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php +startBuffering(); + +// add all files in the project +$phar->buildFromDirectory( + realpath(__DIR__ . '/../'), + '#' + . '^' . preg_quote(realpath(__DIR__ . '/../'), '#') + . '/(data/bdrem.config.php.dist|src/bdrem/|www/|README\.rst)' + . '#' +); + +//remove shebang from bin/bdrem.php +$bin = file_get_contents(__DIR__ . '/../bin/bdrem.php'); +$phar->addFromString('bin/bdrem.php', substr($bin, strpos($bin, "\n") + 1)); + +$phar->setStub(file_get_contents(__DIR__ . '/../src/phar-stub.php')); +$phar->stopBuffering(); +?> diff --git a/src/phar-stub.php b/src/phar-stub.php new file mode 100644 index 0000000..3c80130 --- /dev/null +++ b/src/phar-stub.php @@ -0,0 +1,23 @@ +