#!/usr/bin/env php startBuffering(); // add all files in the project $phar->buildFromDirectory( realpath(__DIR__ . '/../'), '#' . '^' . preg_quote(realpath(__DIR__ . '/../'), '#') . '/(data/bdrem.config.php.dist|lib/|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(); ?>