DEPRECATED
#Phox
Phox provide a simple way to build, extract and sign Phar files.
1.1.0
Phox is able to be installed on your machine or on the server for one of the following ways.
composer global require "mostofreddy/phox=1.0.0"
If your are working on *Unix systems you can create a symbolic link.
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:
php phox build.....
Adding the dependency on composer.json
"require": {
"mostofreddy/phox": "1.0.0"
...
}
You can download the last stable version from https://github.com/mostofreddy/phox/releases/download/1.0.0/phox.phar
The MIT License (MIT). Please see License File for more information.
Before reporting a problem, please read how to File an issue.
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
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.
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.