From 5274821c5d92a9267ec992ec1d6757c4765ee5e8 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 25 Feb 2014 21:11:46 +0100 Subject: script to generate phar file --- bin/makephar.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 bin/makephar.php (limited to '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(); +?> -- cgit v1.2.3