DEPRECATED, (*1)
Phox
, (*2)
Phox provide a simple way to build, extract and sign Phar files., (*3)
Current stable version
1.1.0, (*4)
Install
Phox is able to be installed on your machine or on the server for one of the following ways., (*5)
Globally
composer global require "mostofreddy/phox=1.0.0"
If your are working on *Unix systems you can create a symbolic link., (*6)
cd /usr/bin
ln -s ~/.composer/vendor/bin/phox
On Windows environment, you can add the php executble on the environment variables. You have to call phox on this way:, (*7)
php phox build.....
Composer
Adding the dependency on composer.json, (*8)
"require": {
"mostofreddy/phox": "1.0.0"
...
}
Download
You can download the last stable version from https://github.com/mostofreddy/phox/releases/download/1.0.0/phox.phar, (*9)
License
The MIT License (MIT). Please see License File for more information., (*10)
Issues
Before reporting a problem, please read how to File an issue., (*11)
Using Phox
Running Phox from the command line
phox build --src=/var/www/my_project --output=/tmp/my_dir [--alias=MyAlias] [--stub=bin/cli.php] [--stubweb=web/server.php] [--replace] [--exclude=tests] [--exclude=docs]
- output: REQUIRED The full or relative path to the directory that contains all files to add.
- src: REQUIRED Output directory for phar file.
- alias: Alias with which this Phar archive should be referred to in calls to stream functionality.
- stub: Path to the php file to call when Phar file is running from command line. Example: --stubweb=src/mainStubCli.php.
- stubweb: Endpoint file when the Phar file is running as a site on server (ex: virtal host on Apache or server block in Nginx). Example: --stubweb=src/mainStubWeb.php.
- replace: If the file exists, delete it.
- exclude: Directory exclusion (ex: --exclude=tests --exclude=docs). (multiple values allowed)
Example, (*12)
php phox build --src=/var/www/my_project --output=/tmp/my_dir
phox extract --output=/tmp/my_dir/extract --phar=/tmp/my_dir/MyAlias.phar
- output: REQUIRED Output directory to extract the files.
- phar: REQUIRED Path to Phar file.
Signature
phox sign-create --phar=/tmp/my_dir/MyAlias.phar --output=/tmp/my_dir [--encrypt-type=SHA256]
- phar: REQUIRED Path to Phar.
- encrypt-type: Encryption algorithm (MD5, SHA1, SHA256, SHA512). Default: SHA256.
- output: Directory where the hash is generated.
Validate sign
phox sign-validate --phar=/tmp/my_dir/MyAlias.phar --sign-file=/tmp/my_dir/hash.SHA256
- phar: REQUIRED Path to Phar
- hash-string: Hash string created when the Phar file was signed.
- hash-file: Path to the hash file created when the Phar was signed.