Overview

makePhar.php is a tool to create 5.2 compatiable phar files. (and with the right coding practice,
you can test without creating a phar file). It requires PHP_Archive to be installed via PEAR.

In your code, use a constant to point to the directory (or phar) of your scripts (also, follow
standard MFMWS rules for variable naming)

Where you define it in the file that runs when you include the phar (should be the same file that
MFMWS would run if you don't package the module as a phar), a line like the following will work:

	define('MODULE_DIR', /*<auto_path>*/ dirname(__FILE__) /*</auto_path>*/);
	
For this tool, anything inside of the <auto_path> tags will be replaced before being added to phar
so that the line in the phar will look like this:

	define('MODULE_DIR', 'phar://module.phar');

So that all your includes will just need to look something like this:

	require_once MODULE_DIR . '/somefile1.php';
	@include_once MODULE_DIR . '/somefile2.php';

NOTE: the / is required!

Also note, if you need a to access a file provided by the user (a config file of sorts normally),
then you just include it like normal:

	@include 'module_conf.php';

However, the case for this is not often.


There's also the config file to tell the tool what files to include. It's a simple xml file with the
follow format:

<makePhar base="dir/relative/to/config/file/of/files" alias="pharAlias">
	<mainFile path="module.php" />
	<file path="fileToInclude.php" />
	<file path="fileToInclude.php" alias="nameToGoBy" />
</makePhar>

Attributes for makePhar:
base - The directory that contains the files. Use this if the files are not in the same directory as
	the config file
alias - If you don't have a main file, or the name of the phar is going to be different than the
	basename of the main file

Attributes for file/mainFile (both are the same, but only one mainFile is allowed)
path - The path to a file to include. Note, ../ and ./ will be processed! So all files must exists
	in the base directory
alias - If defined, the file will be inserted into the phar with this path/name instead of the given
	name. Useful if you have two versions of a file, and one is used in phars, and one for outside of
	phars (with the one for use outside of phars having the alias name for the other one)