Skip to content

Instantly share code, notes, and snippets.

@olivertappin
Created June 6, 2017 21:14
Show Gist options
  • Save olivertappin/01f3569c3bef6012aca3f8ab1a84130c to your computer and use it in GitHub Desktop.
Save olivertappin/01f3569c3bef6012aca3f8ab1a84130c to your computer and use it in GitHub Desktop.
Create a Phar file
<?php
$phar = new Phar('project.phar', 0, 'project.phar');
$phar->buildFromDirectory(dirname(__FILE__) . '/phar');
$phar->setStub($phar->createDefaultStub('index.php'));
// To generate the .phar file, run the following commands from the current directory:
// mkdir -p phar
// cp -R ./*.php phar/.
// cd phar && php ../build-phar.php
// cd ../ && mv phar/project.phar project.phar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment