pharmaker is a quick php script to build a phar file out of a directory with default scripts for web and cli
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Simple PHAR build tool to convert a directory into a PHAR archive

Basic Concepts

Source Directory: The directory that contains the source php files.
PHAR Name: The name which identifies the Phar. The name is used to generate the phar archive as well as to refer to the archive in phar:// steam contexts.
CLI Script: The script which is executed when the archive is run from the command line. index.php is assumed if not provided.
Web Script: The script which is by default executed in the web environment. Defaults to CLI script value if not provided with.

Building Basics

./makephar <source dir> <phar name> [<cli script> <web script>]

Example: The following command will create a phar archive named mphar.phar with cli.php as cli script and web.php as the web script

./makephar src mphar.phar cli.php web.php

==========: STARTING PHAR BUILD PROCESS :==========
Source Directory: src
PHAR Name: mphar.phar
CLI Script: cli.php
Web Script: web.php
DONE: Built mphar.phar

Checkout the "src" directory for sample cli and web script