Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // #!/usr/bin/env php
- // php --define phar.readonly=0 ./make-phar.php $1
- if ($argc === 1) {
- echo "Usage: {$argv[0]} <phar-name>";
- exit;
- }
- $pharFilename = basename($argv[1]);
- $pharFilePath = "build/{$pharFilename}.phar";
- if (file_exists($pharFilePath)) {
- unlink($pharFilePath);
- }
- $phar = new Phar($pharFilePath);
- $phar->startBuffering();
- $phar->buildFromDirectory('./');
- $phar->setDefaultStub('src/index.php');
- $phar->stopBuffering();
- echo "{$pharFilePath} successfully created";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement