MakePhar

Type: Application/Utility OS/Platform: Any (PHP 5.6+) License: GPL 3.0 Status: Beta

MakePhar packs up up an entire PHP project into a single executable file, or optionally creating a library-only file that can be included by other PHP applications. It has support for minifying files as they are added, resulting in ~70% smaller files.

Some of the other features include:

  • Static or dynamic properties, read or evaluated from file as the phar is being built. Properties are automatically defined in the loader. You can use this to f.ex. parse the version number from Git or other vcs.
  • Native phar metadata support, set from direct values or resolved properties. The metadata can be read from other applications without having to include the phar.
  • Support for composer-based libraries. The stub automatically loads the vendor/autoload.php file and with it any bundled libraries or autoloaded files.

Basic documentation can be found here, and additional information is present in the doc sub-directory of the source tree.

Installing MakePhar

  1. Download MakePhar from the link on this page.
  2. Move the file to a directory on your path and make it executable.