Skip to content

yannoff/phpcc

Repository files navigation

yannoff/phpcc

PHP Code compiler - Phar executable compiling utility

Requirements

  • php or paw 7.1+
  • phar.readonly php config directive must be set to Off

Install

Get the latest release from Github

💡 ${BINDIR} may be /usr/bin, /usr/local/bin or $HOME/bin

curl -Lo ${BINDIR}/phpcc https://github.com/yannoff/phpcc/releases/latest/download/phpcc

Add execution permissions to the binary

chmod +x ${BINDIR}/phpcc

Usage

Synopsis

phpcc --help
phpcc --version
phpcc -e <entrypoint> -o <output> [-d dir [-d dir ...]] [-b <banner>] [-l <license>]

Options/Arguments

The output and entrypoint scripts are mandatory.

-e, --entrypoint

MANDATORY The main application entrypoint script.

-o, --output

MANDATORY The Phar archive output file.

-d, --dir

Adds a PHP sources directory to the archive.

Multiple values allowed here

Each directory may be of the form:

  • $dir => include all files in directory
  • $dir:$extension => filter files on a specific extension

-b, --banner

Filepath to the legal notice banner.

Will be included in the human-readable part of the stub.

Examples

A concrete use-case: the phpcc self-compiling command

phpcc -d src:php -d vendor:php -e bin/compile.php -o bin/phpcc -b .banner

More use cases can be found in the examples documentation.

License

Licensed under the MIT License.

About

PHP Code compiler - Phar executable compiling utility

Topics

Resources

License

Stars

Watchers

Forks