Skip to content

Commit 3ae8a4c

Browse files
committed
Add shebang for Unix systems
1 parent db9843b commit 3ae8a4c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Diff for: create-phar.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@
1111
}
1212

1313
// Create phar
14-
$p = new Phar($pharFile);
14+
$p = new Phar($pharFile, 0, 'monstercat-dl.phar');
15+
$p->setSignatureAlgorithm(\Phar::SHA1);
16+
$p->startBuffering();
1517

1618
// Creating our library using whole directory
1719
$p->buildFromDirectory('src/');
1820

19-
// Pointing main file which requires all classes
20-
$p->setDefaultStub('monstercat-dl.php', '/monstercat-dl.php');
21+
// Create default stub
22+
$defaultStub = $p->createDefaultStub('monstercat-dl.php');
23+
$stub = "#!/usr/bin/env php\n" . $defaultStub;
24+
$p->setStub($stub);
2125

26+
$p->stopBuffering();
2227
// Plus - compressing it into gzip
2328
$p->compress(Phar::GZ);
2429

0 commit comments

Comments
 (0)