X-Git-Url: https://git.cweiske.de/bdrem.git/blobdiff_plain/400a6537534c4083b39debdd9e49032daf093813..5274821c5d92a9267ec992ec1d6757c4765ee5e8:/bin/makephar.php 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(); +?>