{"id":20916192,"url":"https://github.com/yannoff/phpcc","last_synced_at":"2025-10-12T14:42:16.709Z","repository":{"id":224238744,"uuid":"759578552","full_name":"yannoff/phpcc","owner":"yannoff","description":"PHP Code compiler - Phar executable compiling utility","archived":false,"fork":false,"pushed_at":"2024-05-19T16:05:42.000Z","size":42,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T16:27:17.243Z","etag":null,"topics":["phar","php-archive","php-compiler","self-executable"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yannoff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-18T23:04:25.000Z","updated_at":"2024-05-19T16:04:04.000Z","dependencies_parsed_at":"2024-02-24T18:41:39.641Z","dependency_job_id":"415f00a5-e685-4a7a-aec1-a6fef03086d9","html_url":"https://github.com/yannoff/phpcc","commit_stats":null,"previous_names":["yannoff/phpcc"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannoff%2Fphpcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannoff%2Fphpcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannoff%2Fphpcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannoff%2Fphpcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yannoff","download_url":"https://codeload.github.com/yannoff/phpcc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243308600,"owners_count":20270448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["phar","php-archive","php-compiler","self-executable"],"created_at":"2024-11-18T16:20:24.564Z","updated_at":"2025-10-12T14:42:11.660Z","avatar_url":"https://github.com/yannoff.png","language":"PHP","readme":"# yannoff/phpcc\n\nPHP Code compiler - Phar executable compiling utility\n\n## Help Contents\n\n- [Usage](#usage)\n    - [Synopsis](#synopsis)\n    - [Options/Arguments](#optionsarguments)\n    - [Examples](#examples)\n        - [A concrete use-case: the `phpcc` self-compiling command](#a-concrete-use-case-the-phpcc-self-compiling-command)\n        - [Example 1: PHP sources located in several directories](#example-1-php-sources-located-in-several-directories)\n        - [Example 2: Multiple extensions in the same directory](#example-2-multiple-extensions-in-the-same-directory)\n        - [Example 3: Standalone php script](#example-3-standalone-php-script)\n        - [Example 4: Add sparse single PHP files](#example-4-add-sparse-single-php-files)\n        - [Example 5: Adding metadata to the archive](#example-5-adding-metadata-to-the-archive)\n- [Install](#install)\n    - [Requirements](#requirements)\n    - [Quick install](#quick-install)\n- [License](#license)\n\n## Usage\n\n### Synopsis\n\n```\nphpcc --help\nphpcc --version\n```\n\n```\nphpcc \\\n    -e \u003cmain\u003e \\\n    -o \u003coutput\u003e \\\n    [-d \u003cdir\u003e [-d \u003cdir\u003e ...]] \\\n    [-f \u003cfile\u003e [-f \u003cfile\u003e ...]] \\\n    [-b \u003cbanner\u003e] \\\n    [-m \u003cmetadata\u003e [-m \u003cmetadata\u003e ...]]\n```\n\n### Options/Arguments\n\n\u003e The output and entrypoint scripts are mandatory.\n\nName /  Shorthand   |  Type | Description                                                                                                                                                                             |Required\n--------------------|:-----:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------:\n`--output`, `-o`    | value | The Phar archive output file                                                                                                                                                            |y\n`--main`, `-e`      | value | The main application entrypoint script                                                                                                                                                  |y\n`--banner`, `-b`    | value | Specify the filepath to the legal notice banner\u003cbr/\u003e_Will be included in the human-readable part of the stub._                                                                          |n\n`--file`, `-f`      | multi | Adds a single file to the archive                                                                                                                                                       |n\n`--dir`,  `-d`      | multi | Adds a sources directory to the archive\u003cbr/\u003e_Possible dir spec formats:\u003cbr/\u003e- `$dir` =\u003e include all files in directory\u003cbr/\u003e- `$dir:$extension` =\u003e filter files on a specific extension_ |n\n`--meta`, `-m`      | multi | Adds a metadata to the archive\u003cbr/\u003e_Metadata must be specified in the `$key:$value` format_                                                                                             |n\n`--shebang-less`    | flag  | Produce a stub deprived of the shebang directive\u003cbr/\u003e_Useful when the phar is meant to be included instead of being executed directly_                                                  |n\n`--quiet`, `-q`     | flag  | Reduce output messages amount: set verbosity level to `INFO` instead of default `DEBUG`                                                                                                 |n\n\n\n### Examples\n\n#### A concrete use-case: the `phpcc` self-compiling command\n\n```bash\nphpcc -d src:php -d vendor:php -e bin/compile.php -o bin/phpcc -b .banner\n```\n\n#### Example 1: PHP sources located in several directories\n\n- Add all `*.php` files from `src/` and `vendor/` dirs\n- Define `main.php` as the stub main entrypoint script\n- Save compiled phar executable to `bin/foobar`\n\n```bash\nphpcc -d src:php -d vendor:php -e main.php -o bin/foobar\n```\n#### Example 2: Multiple extensions in the same directory\n\n- Add all `*.php` and `*.phtml` files from `src/` dir\n- Define `main.php` as the stub main entrypoint script\n- Save compiled phar executable to `bin/foobar`\n\n```bash\nphpcc -d src:php -d src:phtml -e main.php -o bin/foobar\n```\n\n#### Example 3: Standalone php script\n\n- Define `app.php` as the stub main entrypoint script\n- Save compiled phar executable to `foobar.phar`\n- Use `LICENSE` file contents as legal notice banner\n\n```bash\nphpcc -e app.php -o foobar.phar -b LICENSE\n```\n\n#### Example 4: Add sparse single PHP files\n\n- Define `app.php` as the stub main entrypoint script\n- Save compiled phar executable to `foobar.phar`\n- Add `foo.php` and `bar.php` files to the archive\n\n```bash\nphpcc -e app.php -o foobar.phar -f foo.php -f bar.php\n```\n\n#### Example 5: Adding metadata to the archive\n\n- Define `app.php` as the stub main entrypoint script\n- Save compiled phar executable to `bin/acme`\n- Add the `license` \u0026 `author` metadata to the archive\n\n```bash\nphpcc -e app.php -o bin/acme -m license:MIT -m author:yannoff\n```\n\n## Install\n\n### Requirements\n\n- `php` or `paw` 7.1+\n- `phar.readonly` php config directive must be set to `Off`\n\n### Quick install\n\n_Get the latest release from Github_\n\n\u003e :bulb: `${BINDIR}` may be /usr/bin, /usr/local/bin or $HOME/bin\n\n```bash\ncurl -Lo ${BINDIR}/phpcc https://github.com/yannoff/phpcc/releases/latest/download/phpcc\n```\n_Add execution permissions to the binary_\n\n```bash\nchmod +x ${BINDIR}/phpcc\n```\n\n## License\n\nLicensed under the [MIT License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyannoff%2Fphpcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyannoff%2Fphpcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyannoff%2Fphpcc/lists"}