noccylabs/tinyphar

$ git tag
0.1.0
0.1.1
0.1.2
0.1.2.1
0.1.3

$ git branch
* master

TinyPhar: Helpers for packaged applications

Examples

Helpful constants

A few constants are defined automatically when you include the library:

if (IS_PHAR) {
    echo "I'm running from a phar located in ".PHAR_DIR."\n";
}

These are:

In addition, metadata defined as an array will be defined with keys cast to uppercase.

metadata in phar:
[ "update_uri" => "http://google.com" ]

The above would make this work:

echo "Checking ".PHAR_META_UPDATE_URI." for updates...\n";

Remember that the PHAR_ constants are only defined if IS_PHAR is true, and additionally the PHAR_META_ constants are only defined if present in the file. Use defined() as neccessary!