You can set configuration for PharBuilder inside you main composer.json
file.
All options must be added in a phar-builder
section inside the extra
section of the composer.json
.
All options are optional, if not found a value will be guess according to the configuration chain.
{
"name": "my-vendor/my-awesome-package",
"extra": {
"phar-builder": {
"name": "my-phar",
"output": "./build/dist/",
"dev": true,
"shebang": true,
"entry-point": "bin/my-app",
"included": ["HowTo.md", "references/"],
"excluded": ["src/stubs"],
"compression": "bz2"
}
}
}
Every option are optional.
If the option is not provided, the next options source will be requested
Define where the PHAR will be output.
Define the name of the PHAR (without the .phar
extension)
Indicate if development dependencies should be include in the PHAR.
(Set to true
to add developments dependencies)
Indicate if a shebang must be added on the first line of the phar Stub.
Any shebang in the entry point will be remove to avoid printing the shebang line in the console or on the webpage.
Define the file that will be load by the PHAR when executed.
(Any shebang in this file will be removed)
Define the list of directories or files to add along the PHAR.
PharBuilder will automatically add directories and files that are declared in the autoload
(and autoload-dev
if requested) section of the composer.json
, but any additional data your application need must be add by you.
You can define path to excludes. The path can be partial:
Value | Match hello/tests/world |
Match hellotestsworld |
Match tests/world |
Match hello/tests |
Match testsworld |
---|---|---|---|---|---|
tests |
YES | YES | YES | YES | YES |
/tests |
NO | NO | YES | NO | YES |
/tests/ |
NO | NO | YES | NO | NO |
*/tests/ |
YES | NO | YES | YES | NO |
The available values are:
bz2
gzip
none
Any other value will be ignore, and the next options source will be requested.