mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-17 05:45:35 +08:00
Compare commits
1 Commits
feat/pgo-v
...
pmmp-exper
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee3be6f374 |
@@ -1,16 +0,0 @@
|
|||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
charset = utf-8
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 4
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
[*.md]
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[*.{yml,yaml,vue,ts}]
|
|
||||||
indent_size = 2
|
|
||||||
24
.gitattributes
vendored
24
.gitattributes
vendored
@@ -1,24 +0,0 @@
|
|||||||
# Force LF line endings for all text files.
|
|
||||||
# Prevents git from auto-converting LF -> CRLF on Windows checkouts.
|
|
||||||
* text=auto eol=lf
|
|
||||||
|
|
||||||
# Explicit binary files — git won't touch line endings for these
|
|
||||||
*.phar binary
|
|
||||||
*.png binary
|
|
||||||
*.jpg binary
|
|
||||||
*.jpeg binary
|
|
||||||
*.gif binary
|
|
||||||
*.ico binary
|
|
||||||
*.zip binary
|
|
||||||
*.gz binary
|
|
||||||
*.tgz binary
|
|
||||||
*.txz binary
|
|
||||||
*.xz binary
|
|
||||||
*.bz2 binary
|
|
||||||
*.7z binary
|
|
||||||
*.exe binary
|
|
||||||
*.dll binary
|
|
||||||
*.sfx binary
|
|
||||||
*.so binary
|
|
||||||
*.a binary
|
|
||||||
*.o binary
|
|
||||||
6
.github/FUNDING.yml
vendored
6
.github/FUNDING.yml
vendored
@@ -1,15 +1,13 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: [crazywhalecc]# Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
patreon: # Replace with a single Patreon username
|
patreon: # Replace with a single Patreon username
|
||||||
open_collective: # Replace with a single Open Collective username
|
open_collective: # Replace with a single Open Collective username
|
||||||
# ko_fi: crazywhalecc # Replace with a single Ko-fi username
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
liberapay: # Replace with a single Liberapay username
|
liberapay: # Replace with a single Liberapay username
|
||||||
issuehunt: # Replace with a single IssueHunt username
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
otechie: # Replace with a single Otechie username
|
otechie: # Replace with a single Otechie username
|
||||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||||
# noinspection YAMLSchemaValidation
|
|
||||||
buy_me_a_coffee: # crazywhalecc
|
|
||||||
custom: 'https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md' # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
custom: 'https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md' # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
|
|||||||
17
.github/ISSUE_TEMPLATE/bug_report.md
vendored
17
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,17 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Build PHP or library failed, download failed, doesn't seem to work...
|
|
||||||
title: ''
|
|
||||||
labels: bug
|
|
||||||
body:
|
|
||||||
- type: textarea
|
|
||||||
id: what-happened
|
|
||||||
attributes:
|
|
||||||
label: What happened?
|
|
||||||
description: |
|
|
||||||
Please tell us what you do, what you get and what you expected.
|
|
||||||
Provide with some step-by-step instructions to reproduce the issue.
|
|
||||||
If possible, attach a screenshot or log files in ./log directory.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
---
|
|
||||||
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request
|
|
||||||
about: Suggest an idea for this project
|
|
||||||
title: ''
|
|
||||||
labels: new feature
|
|
||||||
assignees: crazywhalecc
|
|
||||||
|
|
||||||
---
|
|
||||||
10
.github/ISSUE_TEMPLATE/something-want-to-know.md
vendored
10
.github/ISSUE_TEMPLATE/something-want-to-know.md
vendored
@@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
name: Something want to know
|
|
||||||
about: Describe your question about static-php, we will reply ASAP
|
|
||||||
title: ''
|
|
||||||
labels: question
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
24
.github/copilot-instructions.md
vendored
24
.github/copilot-instructions.md
vendored
@@ -1,24 +0,0 @@
|
|||||||
# StaticPHP v3 Copilot Instructions
|
|
||||||
|
|
||||||
> The canonical agent instructions live in [AGENTS.md](./AGENTS.md). This file provides the essential summary for GitHub Copilot; read `AGENTS.md` for the complete project map, working rules, and validation steps.
|
|
||||||
|
|
||||||
StaticPHP is a PHP CLI application for building static PHP binaries, PHP SAPIs, extensions, libraries, and helper tools. Prefer the v3 architecture under `src/StaticPHP`, `src/Package`, `config/pkg`, and `config/artifact`.
|
|
||||||
|
|
||||||
## Skills
|
|
||||||
|
|
||||||
Use the repository skills when the task matches them:
|
|
||||||
|
|
||||||
- `.github/skills/staticphp-package-maintenance`: add, modify, review, or validate package, artifact, extension, library, target, or tool definitions.
|
|
||||||
- `.github/skills/staticphp-build-troubleshooting`: diagnose build, download, doctor, shell, terminal, CI, smoke-test, or log failures.
|
|
||||||
- `.github/skills/staticphp-documentation-sync`: synchronize bilingual documentation (`docs/en/` and `docs/zh/`) when features, commands, configuration, APIs, or behavior change.
|
|
||||||
|
|
||||||
## Quick Reference
|
|
||||||
|
|
||||||
- **Entrypoint**: `php bin/spc`
|
|
||||||
- **Config lint**: `php bin/spc dev:lint-config`
|
|
||||||
- **CS fix**: `composer cs-fix`
|
|
||||||
- **Tests**: `composer test`
|
|
||||||
- **Static analysis**: `composer analyse`
|
|
||||||
- **Extension packages**: `config/pkg/ext/ext-*.yml`, prefix with `ext-` in dependencies
|
|
||||||
- **Platform suffixes**: `@unix`, `@linux`, `@macos`, `@windows` — prefer these over runtime conditionals
|
|
||||||
- **Do NOT edit generated dirs**: `buildroot/`, `source/`, `downloads/`, `pkgroot/`
|
|
||||||
12
.github/pull_request_template.md
vendored
12
.github/pull_request_template.md
vendored
@@ -1,12 +1,12 @@
|
|||||||
## What does this PR do?
|
## What does this PR do?
|
||||||
|
|
||||||
<!-- Please describe the changes made in this PR here. -->
|
|
||||||
|
|
||||||
|
|
||||||
## Checklist before merging
|
## Checklist before merging
|
||||||
|
|
||||||
- If you modified `*.php` or `*.yml`, run them locally to ensure your changes are valid:
|
> If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
|
||||||
- [ ] `composer cs-fix`
|
> If a modification is not involved, please skip it directly.
|
||||||
- [ ] `composer analyse`
|
|
||||||
- [ ] `composer test`
|
- [ ] If it's a extension or dependency update, make sure adding related extensions in `src/global/test-extensions.php`.
|
||||||
- [ ] `bin/spc dev:lint-config`
|
- [ ] If you changed the behavior of static-php-cli, add docs in [static-php/static-php-cli-docs](https://github.com/static-php/static-php-cli-docs) .
|
||||||
|
- [ ] If you updated `config/xxxx.json` content, run `bin/spc dev:sort-config xxx`.
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
---
|
|
||||||
name: staticphp-build-troubleshooting
|
|
||||||
description: Diagnose StaticPHP v3 failures. Use when investigating build, compile, linker, download, doctor, environment, CI, smoke-test, terminal output, spc.output.log, spc.shell.log, config.log, CMake logs, or user-provided error snippets from StaticPHP commands.
|
|
||||||
---
|
|
||||||
|
|
||||||
# StaticPHP Build Troubleshooting
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
Use this skill to triage StaticPHP failures from the outside in: command and environment first, SPC module/stage metadata next, shell/config logs last. The goal is to isolate the failing package, stage, command, and root cause before editing code.
|
|
||||||
|
|
||||||
## First Pass
|
|
||||||
|
|
||||||
1. Capture the exact command, OS, architecture, PHP version, extensions/libs/targets, and whether the run used `-v`, `-vv`, or `-vvv`.
|
|
||||||
2. Read the final terminal error first. StaticPHP prints module error info, failed package, failed stage, failed command, log paths, and extra log files when available.
|
|
||||||
3. If log files exist, inspect them in this order:
|
|
||||||
- `log/spc.output.log`: user-facing SPC messages and exception summary.
|
|
||||||
- `log/spc.shell.log`: executed commands, working directories, env, stdout/stderr.
|
|
||||||
- Extra logs named in the exception output: `php-src.config.log`, `lib.<pkg>.console.log`, `lib.<pkg>.cmake-error.log`, `lib.<pkg>.cmake-configure.log`, `lib.<pkg>.cmake-output.log`.
|
|
||||||
4. Read `references/log-triage.md` for pattern matching, likely causes, and next checks.
|
|
||||||
|
|
||||||
## Diagnosis Rules
|
|
||||||
|
|
||||||
- Do not start by changing shared core code. Most failures are package metadata, environment, upstream source, dependency order, or platform flags.
|
|
||||||
- Prefer evidence from the last failing command over earlier warnings.
|
|
||||||
- When logs are long, search backward for `Command exited`, `error:`, `undefined reference`, `not found`, `No package`, `CMake Error`, `configure: error`, `fatal error`, `Failed module`, and `Failed stage`.
|
|
||||||
- Use `config.log` and CMake logs for configure detection failures; use `spc.shell.log` for the actual command and env.
|
|
||||||
- Be careful with rebuild suggestions. `spc reset --with-download --yes` is destructive to caches; ask before clearing caches unless the user explicitly asked.
|
|
||||||
|
|
||||||
## Repro Commands
|
|
||||||
|
|
||||||
Use focused commands when reproducing:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
php bin/spc doctor -vvv
|
|
||||||
php bin/spc download --for-extensions="curl,openssl" --with-php=8.5 --parallel=4 --retry=3 -vvv
|
|
||||||
php bin/spc build:libs "openssl" -vvv
|
|
||||||
php bin/spc build:php "bcmath,openssl,curl" --build-cli -vvv
|
|
||||||
php bin/spc dev:lint-config
|
|
||||||
```
|
|
||||||
|
|
||||||
Choose the smallest command that still reaches the failing package.
|
|
||||||
|
|
||||||
## Fix Direction
|
|
||||||
|
|
||||||
After finding the failing package/stage:
|
|
||||||
|
|
||||||
- Package YAML issue: use `$staticphp-package-maintenance`, then edit `config/pkg/*` or `config/artifact/*`.
|
|
||||||
- Build command or patch issue: inspect the package class under `src/Package/*`.
|
|
||||||
- Environment issue: check `doctor`, toolchain classes, and `config/pkg/tool/*`.
|
|
||||||
- Upstream download issue: check artifact type, regex, GitHub rate limiting, mirror behavior, and `GITHUB_TOKEN`.
|
|
||||||
- Core exception/logging issue: inspect `src/StaticPHP/Exception`, `src/StaticPHP/Runtime/Shell`, or executor classes only after package-level causes are ruled out.
|
|
||||||
|
|
||||||
## Resources
|
|
||||||
|
|
||||||
- `references/log-triage.md`: log files, failure categories, search patterns, and likely fixes.
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
interface:
|
|
||||||
display_name: "StaticPHP Build Troubleshooting"
|
|
||||||
short_description: "Diagnose StaticPHP build and log failures."
|
|
||||||
default_prompt: "Use $staticphp-build-troubleshooting to investigate a StaticPHP build, download, doctor, or log failure."
|
|
||||||
@@ -1,209 +0,0 @@
|
|||||||
# StaticPHP Log Triage
|
|
||||||
|
|
||||||
## Contents
|
|
||||||
|
|
||||||
- Log files
|
|
||||||
- Terminal summary
|
|
||||||
- Search strategy
|
|
||||||
- Failure categories
|
|
||||||
- Rebuild hygiene
|
|
||||||
- Reporting checklist
|
|
||||||
|
|
||||||
## Log Files
|
|
||||||
|
|
||||||
Default log directory is `log/`, controlled by `SPC_LOGS_DIR`. The important files are:
|
|
||||||
|
|
||||||
- `spc.output.log`: StaticPHP console/logger output and exception summaries.
|
|
||||||
- `spc.shell.log`: command execution log with command, caller, inline env, working directory, stdout, stderr, and exit code.
|
|
||||||
- `php-src.config.log`: copied when PHP source configure fails.
|
|
||||||
- `lib.<pkg>.console.log`: copied Autoconf `config.log` for a library when available.
|
|
||||||
- `lib.<pkg>.cmake-configure.log`: copied CMake 3.26+ configure log.
|
|
||||||
- `lib.<pkg>.cmake-error.log`: copied CMake error log.
|
|
||||||
- `lib.<pkg>.cmake-output.log`: copied CMake output log.
|
|
||||||
|
|
||||||
Logs are created when `SPC_ENABLE_LOG_FILE` is true. Old `*.log` files are cleaned unless `SPC_PRESERVE_LOG` is set to a truthy value. The code in `src/bootstrap.php` reads `SPC_PRESERVE_LOG` (no trailing S).
|
|
||||||
|
|
||||||
## Terminal Summary
|
|
||||||
|
|
||||||
StaticPHP exceptions often print:
|
|
||||||
|
|
||||||
- Exception category: build, download, environment, execution, file system, patch, validation, wrong usage, registry, internal.
|
|
||||||
- Failed module: package name, type, and sometimes class/file/line.
|
|
||||||
- Failed stage: call chain such as `build` or `build -> configure`.
|
|
||||||
- Failed command: the command that returned non-zero.
|
|
||||||
- Command working directory and inline env.
|
|
||||||
- Paths to `spc.output.log`, `spc.shell.log`, and extra logs.
|
|
||||||
|
|
||||||
Use this summary to choose the first files to read. If a package and stage are present, start with that package's YAML and class after reading the relevant log tail.
|
|
||||||
|
|
||||||
## Search Strategy
|
|
||||||
|
|
||||||
For long logs, search from the end first.
|
|
||||||
|
|
||||||
Useful patterns:
|
|
||||||
|
|
||||||
```text
|
|
||||||
Failed module:
|
|
||||||
Failed stage:
|
|
||||||
Failed command:
|
|
||||||
Command exited with non-zero code
|
|
||||||
configure: error
|
|
||||||
CMake Error
|
|
||||||
undefined reference
|
|
||||||
cannot find -l
|
|
||||||
fatal error:
|
|
||||||
No package
|
|
||||||
Package .* not found
|
|
||||||
Could NOT find
|
|
||||||
is not a valid
|
|
||||||
permission denied
|
|
||||||
curl: (
|
|
||||||
HTTP/2 403
|
|
||||||
rate limit
|
|
||||||
```
|
|
||||||
|
|
||||||
In `spc.shell.log`, each command block begins with `>>>>>>>>>>>>>>>>>>>>>>>>>>`, then prints the command, caller, env, and working dir. The last failed block is usually the highest-value evidence.
|
|
||||||
|
|
||||||
## Failure Categories
|
|
||||||
|
|
||||||
### Download Failure
|
|
||||||
|
|
||||||
Signs:
|
|
||||||
|
|
||||||
- `Download failed`
|
|
||||||
- `curl: (56)`, `curl: (22)`, HTTP 403/404/429
|
|
||||||
- GitHub API calls in verbose logs
|
|
||||||
- Asset regex did not match a release asset
|
|
||||||
|
|
||||||
Likely checks:
|
|
||||||
|
|
||||||
- If GitHub rate limited, ask user to set `GITHUB_TOKEN`.
|
|
||||||
- Verify artifact source type and regex in `config/pkg/*` or `config/artifact/*`.
|
|
||||||
- Use `--dl-retry`, `--dl-parallel`, `--ignore-cache`, `--no-alt`, or custom source options only as repro aids.
|
|
||||||
- Prefer fixing stale URLs/regexes over adding workarounds.
|
|
||||||
|
|
||||||
### Doctor or Environment Failure
|
|
||||||
|
|
||||||
Signs:
|
|
||||||
|
|
||||||
- `Environment check failed`
|
|
||||||
- missing `make`, `cmake`, `autoconf`, `pkg-config`, compiler, Perl, Visual Studio, MSYS2, Zig, etc.
|
|
||||||
- `Some check items can not be fixed`
|
|
||||||
|
|
||||||
Likely checks:
|
|
||||||
|
|
||||||
- Run `php bin/spc doctor -vvv`.
|
|
||||||
- Inspect `src/StaticPHP/Doctor/Item/*` for the check and fix behavior.
|
|
||||||
- Inspect `config/pkg/tool/*` for installable helper tools.
|
|
||||||
- On Windows, some dependencies cannot be auto-installed.
|
|
||||||
|
|
||||||
### Configure Failure
|
|
||||||
|
|
||||||
Signs:
|
|
||||||
|
|
||||||
- `configure: error`
|
|
||||||
- Autoconf failure before compilation
|
|
||||||
- extra `config.log` listed
|
|
||||||
|
|
||||||
Likely checks:
|
|
||||||
|
|
||||||
- Read copied `php-src.config.log` or `lib.<pkg>.console.log`.
|
|
||||||
- Look for the first compiler/linker probe that failed.
|
|
||||||
- Check `headers`, `static-libs`, `pkg-configs`, dependency order, and `initializeEnv($pkg)` behavior.
|
|
||||||
- For extensions, check `php-extension.arg-type` and `#[CustomPhpConfigureArg]`.
|
|
||||||
|
|
||||||
### CMake Failure
|
|
||||||
|
|
||||||
Signs:
|
|
||||||
|
|
||||||
- `CMake Error`
|
|
||||||
- `Could NOT find`
|
|
||||||
- missing target, package config, or static library
|
|
||||||
|
|
||||||
Likely checks:
|
|
||||||
|
|
||||||
- Read `lib.<pkg>.cmake-error.log` and `lib.<pkg>.cmake-configure.log`.
|
|
||||||
- Inspect `UnixCMakeExecutor`/`WindowsCMakeExecutor` usage in the package class.
|
|
||||||
- Check CMake options, toolchain root path, `pkg-configs`, and transitive dependency libraries.
|
|
||||||
|
|
||||||
### Compile Failure
|
|
||||||
|
|
||||||
Signs:
|
|
||||||
|
|
||||||
- compiler `fatal error: header.h: No such file or directory`
|
|
||||||
- syntax/type errors from upstream source
|
|
||||||
- incompatible PHP API or platform macros
|
|
||||||
|
|
||||||
Likely checks:
|
|
||||||
|
|
||||||
- Identify the source file and include path from `spc.shell.log`.
|
|
||||||
- Verify dependency headers are installed in `buildroot/include`.
|
|
||||||
- Check PHP version compatibility and existing patches in `src/globals/patch`.
|
|
||||||
- Prefer targeted patches or compile flags in the package class over broad toolchain changes.
|
|
||||||
|
|
||||||
### Link Failure
|
|
||||||
|
|
||||||
Signs:
|
|
||||||
|
|
||||||
- `undefined reference`
|
|
||||||
- `cannot find -lfoo`
|
|
||||||
- duplicate symbols
|
|
||||||
- Windows unresolved external symbol or missing `.lib`
|
|
||||||
|
|
||||||
Likely checks:
|
|
||||||
|
|
||||||
- Verify `static-libs`, dependency order, and `getStaticLibFiles()` usage.
|
|
||||||
- Inspect `SPC_EXTRA_LIBS`, `Libs.private` in `.pc` files, and package-specific pkg-config patching.
|
|
||||||
- On Windows, confirm `.lib` names and required system libraries.
|
|
||||||
- For OpenSSL/curl-like packages, search existing linker flag hooks before adding a new one.
|
|
||||||
|
|
||||||
### Smoke Test or Validation Failure
|
|
||||||
|
|
||||||
Signs:
|
|
||||||
|
|
||||||
- `Validation failed`
|
|
||||||
- `php --ri` failure
|
|
||||||
- extension not loaded after build
|
|
||||||
- micro/embed runtime smoke test fails
|
|
||||||
|
|
||||||
Likely checks:
|
|
||||||
|
|
||||||
- Check extension `display-name`; empty string skips `php --ri`.
|
|
||||||
- Confirm static vs shared build settings.
|
|
||||||
- Confirm the extension is included in the final SAPI target and not only built as a dependency.
|
|
||||||
- Inspect `src/globals/ext-tests/*` and common tests for expected runtime behavior.
|
|
||||||
|
|
||||||
### Registry or Config Failure
|
|
||||||
|
|
||||||
Signs:
|
|
||||||
|
|
||||||
- `Registry error`
|
|
||||||
- unknown package, invalid field, invalid platform suffix, type mismatch
|
|
||||||
- package referenced by attribute but missing config
|
|
||||||
|
|
||||||
Likely checks:
|
|
||||||
|
|
||||||
- Run `php bin/spc dev:lint-config`.
|
|
||||||
- Inspect `ConfigValidator` tests for accepted fields and error expectations.
|
|
||||||
- Confirm attribute type matches YAML `type`.
|
|
||||||
- Confirm hooks reference existing package names and stages for the current platform.
|
|
||||||
|
|
||||||
## Rebuild Hygiene
|
|
||||||
|
|
||||||
Use the smallest cleanup that can invalidate the suspected stale state:
|
|
||||||
|
|
||||||
- Redownload one artifact: `--ignore-cache="artifact-name"`.
|
|
||||||
- Skip downloads to test local source/build logic: `--no-download`.
|
|
||||||
- Prefer source when debugging build logic: `--dl-prefer-source`.
|
|
||||||
- Clear build products only when necessary. `spc reset --with-download --yes` removes caches and should not be suggested casually.
|
|
||||||
|
|
||||||
## Reporting Checklist
|
|
||||||
|
|
||||||
When preparing an issue or PR explanation, include:
|
|
||||||
|
|
||||||
- Exact `php bin/spc ...` command.
|
|
||||||
- OS, architecture, PHP version option, and relevant env vars.
|
|
||||||
- Failed package and stage.
|
|
||||||
- Last failed command and exit code.
|
|
||||||
- Tail of `spc.output.log`, relevant command block from `spc.shell.log`, and any extra config/CMake log.
|
|
||||||
- Whether the failure reproduces after a focused clean or cache refresh.
|
|
||||||
160
.github/skills/staticphp-documentation-sync/SKILL.md
vendored
160
.github/skills/staticphp-documentation-sync/SKILL.md
vendored
@@ -1,160 +0,0 @@
|
|||||||
---
|
|
||||||
name: staticphp-documentation-sync
|
|
||||||
description: Synchronize bilingual documentation when StaticPHP v3 user-facing or developer-facing documentation must change. Use when adding, modifying, deprecating, or removing documented features, CLI commands/options, environment variables, configuration formats, public APIs/extension points, workflows, installation requirements, migration guidance, or user-visible behavior. Do not use solely for internal implementation changes, package/library additions, or build bug fixes unless they change documented behavior or require updating existing docs.
|
|
||||||
---
|
|
||||||
|
|
||||||
# StaticPHP Documentation Sync
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
StaticPHP maintains bilingual documentation under `docs/en/` (English) and `docs/zh/` (Chinese). User-facing or developer-facing documentation changes must be reflected in both languages. Use this skill to identify affected docs, update them in sync, and validate sidebar/config consistency.
|
|
||||||
|
|
||||||
## When to Use This Skill
|
|
||||||
|
|
||||||
Invoke this skill when the change involves:
|
|
||||||
|
|
||||||
- New or modified CLI commands, options, or arguments
|
|
||||||
- New or changed environment variables
|
|
||||||
- Package (extension/library/target/tool) additions, removals, or behavioral changes that affect documented support, dependencies, commands, or workflows
|
|
||||||
- Configuration format changes (YAML fields, artifact definitions, registry)
|
|
||||||
- Build lifecycle, doctor, or toolchain changes
|
|
||||||
- API or extension point changes (attributes, hooks, DI, custom artifacts)
|
|
||||||
- Workflow changes (installation, first build, migration)
|
|
||||||
- Deprecation or removal of any documented feature
|
|
||||||
|
|
||||||
Do not update docs just because code changed. Internal refactors, new libraries used only as dependencies, package build fixes, CI-only changes, and bug fixes that preserve documented behavior usually do not need documentation changes. If existing docs mention the changed behavior, command, package support, dependency, caveat, or workaround, update them.
|
|
||||||
|
|
||||||
## Documentation Map
|
|
||||||
|
|
||||||
```
|
|
||||||
docs/
|
|
||||||
├── en/ # English docs (canonical source)
|
|
||||||
│ ├── index.md # Home page hero/features
|
|
||||||
│ ├── guide/ # User-facing guides
|
|
||||||
│ │ ├── index.md # Overview
|
|
||||||
│ │ ├── installation.md # Installation instructions
|
|
||||||
│ │ ├── first-build.md # First build walkthrough
|
|
||||||
│ │ ├── sapi-reference.md # PHP SAPI options
|
|
||||||
│ │ ├── cli-reference.md # CLI commands and options
|
|
||||||
│ │ ├── cli-generator.md # Build command generator
|
|
||||||
│ │ ├── migrate-from-v2.md # v2 → v3 migration
|
|
||||||
│ │ ├── extensions.md # Supported extensions list
|
|
||||||
│ │ ├── extension-notes.md # Per-extension notes
|
|
||||||
│ │ ├── env-vars.md # Environment variables
|
|
||||||
│ │ ├── deps-map.md # Dependency map
|
|
||||||
│ │ └── troubleshooting.md # Troubleshooting guide
|
|
||||||
│ ├── develop/ # Developer docs
|
|
||||||
│ │ ├── index.md # Dev overview
|
|
||||||
│ │ ├── structure.md # Project structure
|
|
||||||
│ │ ├── registry.md # Registry model
|
|
||||||
│ │ ├── package-model.md # Package YAML model
|
|
||||||
│ │ ├── artifact-model.md # Artifact YAML model
|
|
||||||
│ │ ├── craft-yml.md # craft.yml reference
|
|
||||||
│ │ ├── build-lifecycle.md # Build stages/lifecycle
|
|
||||||
│ │ ├── system-build-tools.md # System tool requirements
|
|
||||||
│ │ ├── doctor-module.md # Doctor module
|
|
||||||
│ │ ├── php-src-changes.md # PHP source patches
|
|
||||||
│ │ └── extending/ # Extension authoring
|
|
||||||
│ │ ├── index.md
|
|
||||||
│ │ ├── package-classes.md
|
|
||||||
│ │ ├── annotations.md
|
|
||||||
│ │ ├── lifecycle-hooks.md
|
|
||||||
│ │ ├── dependency-injection.md
|
|
||||||
│ │ └── custom-artifact.md
|
|
||||||
│ ├── contributing/
|
|
||||||
│ │ └── index.md
|
|
||||||
│ └── faq/
|
|
||||||
│ └── index.md
|
|
||||||
├── zh/ # Chinese docs (mirrors en/ structure)
|
|
||||||
│ └── (same structure as en/)
|
|
||||||
├── .vitepress/
|
|
||||||
│ ├── sidebar.en.ts # English sidebar config
|
|
||||||
│ ├── sidebar.zh.ts # Chinese sidebar config
|
|
||||||
│ └── config.ts # VitePress site config
|
|
||||||
└── deps-craft-yml.md # Shared craft.yml include used by both languages
|
|
||||||
```
|
|
||||||
|
|
||||||
Other documentation files outside this tree may also matter, especially root-level `ext-support.md`.
|
|
||||||
|
|
||||||
**Key rule**: `docs/en/` and `docs/zh/` have identical file trees. Every `.md` file under `en/` must have a corresponding file under `zh/`.
|
|
||||||
|
|
||||||
## Workflow
|
|
||||||
|
|
||||||
### Step 1: Identify Impact Scope
|
|
||||||
|
|
||||||
Map the change to affected documentation:
|
|
||||||
|
|
||||||
| Change Type | Likely Affected Docs |
|
|
||||||
|---|---|
|
|
||||||
| New/removed CLI command | `guide/cli-reference.md`, `guide/cli-generator.md` |
|
|
||||||
| New/removed CLI option | `guide/cli-reference.md`, `guide/first-build.md` |
|
|
||||||
| New env var | `guide/env-vars.md` |
|
|
||||||
| New/removed documented extension package | `guide/extensions.md`, `guide/extension-notes.md`, `guide/deps-map.md`, root `ext-support.md` |
|
|
||||||
| Package config field change | `develop/package-model.md`, `develop/artifact-model.md` |
|
|
||||||
| Build lifecycle change | `develop/build-lifecycle.md` |
|
|
||||||
| Doctor change | `develop/doctor-module.md`, `develop/system-build-tools.md` |
|
|
||||||
| New attribute/hook/DI | `develop/extending/annotations.md`, `develop/extending/lifecycle-hooks.md`, `develop/extending/dependency-injection.md` |
|
|
||||||
| PHP source patch | `develop/php-src-changes.md` |
|
|
||||||
| Registry change | `develop/registry.md` |
|
|
||||||
| Install/setup change | `guide/installation.md`, `guide/first-build.md` |
|
|
||||||
| Deprecation/removal | All docs referencing the feature |
|
|
||||||
| New doc page | `sidebar.en.ts`, `sidebar.zh.ts` |
|
|
||||||
|
|
||||||
### Step 2: Read Current Docs
|
|
||||||
|
|
||||||
Before editing, read BOTH the English and Chinese versions of each affected file to understand the current content and existing translation patterns.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Example: check both language versions of the CLI reference
|
|
||||||
cat docs/en/guide/cli-reference.md
|
|
||||||
cat docs/zh/guide/cli-reference.md
|
|
||||||
```
|
|
||||||
|
|
||||||
### Step 3: Update English Docs First
|
|
||||||
|
|
||||||
1. Update `docs/en/` files with accurate, complete English content.
|
|
||||||
2. Follow existing formatting conventions (headings, code blocks, tables, admonitions).
|
|
||||||
3. If adding a new page:
|
|
||||||
- Create the file under `docs/en/<category>/<name>.md`
|
|
||||||
- Add the corresponding entry in `docs/.vitepress/sidebar.en.ts`
|
|
||||||
- Ensure the file has proper VitePress frontmatter if needed
|
|
||||||
|
|
||||||
### Step 4: Sync Chinese Docs
|
|
||||||
|
|
||||||
1. Update `docs/zh/` files to match the English changes.
|
|
||||||
2. Translate all changed or added prose. Do not leave placeholder text or untranslated English in Chinese docs.
|
|
||||||
3. Match the structure and formatting of the English version exactly.
|
|
||||||
4. If a new page was added in English, create the corresponding `docs/zh/` file and update `docs/.vitepress/sidebar.zh.ts`.
|
|
||||||
5. Treat `docs/deps-craft-yml.md` as a special shared include for both languages. If it needs prose changes, either keep the shared content acceptable for both languages or split the included content before adding language-specific prose.
|
|
||||||
|
|
||||||
### Step 5: Validate
|
|
||||||
|
|
||||||
Run these checks before considering the task complete:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Check that en/ and zh/ have matching file trees
|
|
||||||
diff <(find docs/en -name '*.md' | sed 's|docs/en/||' | sort) \
|
|
||||||
<(find docs/zh -name '*.md' | sed 's|docs/zh/||' | sort)
|
|
||||||
|
|
||||||
# Check that all sidebar links point to existing files
|
|
||||||
# (manual check: every 'link' in sidebar.*.ts must resolve to an actual .md file)
|
|
||||||
|
|
||||||
# Build docs when Node dependencies are available; this catches many broken links/config issues
|
|
||||||
npm run docs:build
|
|
||||||
```
|
|
||||||
|
|
||||||
## Translation Guidelines
|
|
||||||
|
|
||||||
- **Chinese docs must be complete**: Every section, paragraph, and table in the English docs must have a Chinese equivalent. Never skip sections.
|
|
||||||
- **Code blocks and command examples**: Keep executable code and commands identical in both languages. Translate surrounding prose; translate comments inside examples only when they are explanatory docs rather than copy-pasteable source/config.
|
|
||||||
- **Technical terms**: Use consistent translations. Refer to existing Chinese docs for established term translations. When in doubt, prefer the term used elsewhere in `docs/zh/`.
|
|
||||||
- **Links**: Internal links in Chinese docs should point to `/zh/...` paths (not `/en/...`).
|
|
||||||
- **YAML frontmatter**: Keep frontmatter identical between languages (layout, etc.) unless the title/tagline field is translated.
|
|
||||||
|
|
||||||
## Common Pitfalls
|
|
||||||
|
|
||||||
- **Don't update only one language**: This is the most common mistake. Always update both `en/` and `zh/` in the same change.
|
|
||||||
- **Don't forget sidebar configs**: When adding, renaming, or removing doc pages, update both `sidebar.en.ts` and `sidebar.zh.ts`.
|
|
||||||
- **Don't forget shared/root docs**: root `ext-support.md` and `docs/deps-craft-yml.md` are also documentation. Update them if relevant.
|
|
||||||
- **Don't leave TODO markers**: Do not commit TODO translation placeholders unless the user explicitly allows it or the task is blocked; if that happens, call it out in the final response.
|
|
||||||
- **Don't translate file paths or URLs**: Only translate human-readable content, not paths, URLs, command names, or code identifiers.
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
---
|
|
||||||
name: staticphp-package-maintenance
|
|
||||||
description: Maintain StaticPHP v3 packages and artifacts. Use when adding, modifying, reviewing, or validating config under config/pkg or config/artifact; package classes under src/Package; extension/library/target/tool dependencies; PHP configure args; build hooks; package metadata; or related tests and docs.
|
|
||||||
---
|
|
||||||
|
|
||||||
# StaticPHP Package Maintenance
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
Use this skill to make focused package changes without re-reading the entire repository. StaticPHP v3 separates declarative package/artifact YAML from package-specific PHP build logic; prefer config-only edits unless current patterns require a class.
|
|
||||||
|
|
||||||
## Quick Workflow
|
|
||||||
|
|
||||||
1. Identify the package kind and exact name.
|
|
||||||
- Extension: `config/pkg/ext/ext-name.yml`, class `src/Package/Extension/name.php`.
|
|
||||||
- Library: `config/pkg/lib/name.yml`, class `src/Package/Library/name.php`.
|
|
||||||
- Target or virtual target: `config/pkg/target/name.yml`, class `src/Package/Target/name.php`.
|
|
||||||
- Tool: `config/pkg/tool/name.yml`, class `src/Package/Tool/name.php`.
|
|
||||||
- Shared/custom artifact: `config/artifact/name.yml`, class `src/Package/Artifact/name.php`.
|
|
||||||
|
|
||||||
2. Search for the closest existing package before designing anything new.
|
|
||||||
- Similar build system: `rg "#\\[BuildFor|UnixCMakeExecutor|UnixAutoconfExecutor|WindowsCMakeExecutor" src/Package`.
|
|
||||||
- Similar config fields: `rg "static-libs|pkg-configs|arg-type|depends@" config/pkg`.
|
|
||||||
- Similar download type: `rg "type: ghrel|type: pecl|type: pie|type: git|binary: hosted" config`.
|
|
||||||
|
|
||||||
3. Read `references/package-reference.md` when changing YAML fields, artifact definitions, package naming, dependencies, platform suffixes, or validation expectations.
|
|
||||||
|
|
||||||
4. Read `references/build-class-patterns.md` when PHP build logic, attributes, lifecycle hooks, custom configure args, source patching, or executor usage is needed.
|
|
||||||
|
|
||||||
5. Validate narrowly, then broadly if risk warrants it.
|
|
||||||
- Config lint: `php bin/spc dev:lint-config`
|
|
||||||
- Focused tests: `vendor/bin/phpunit tests/StaticPHP/Config tests/StaticPHP/Registry tests/StaticPHP/Util/DependencyResolverTest.php --no-coverage`
|
|
||||||
- Full project checks: `composer test`, `composer analyse`
|
|
||||||
|
|
||||||
## Editing Rules
|
|
||||||
|
|
||||||
- Treat `config/pkg/*` and `config/artifact/*` as the source of package truth; package classes augment behavior.
|
|
||||||
- Use platform suffix fields for declarative OS differences: `@unix`, `@linux`, `@macos`, `@windows`.
|
|
||||||
- Add a PHP class only for custom build stages, validation, hook behavior, patches, or custom configure arguments.
|
|
||||||
- Keep extension dependencies prefixed with `ext-`; libraries, tools, and targets use their package names.
|
|
||||||
- Prefer existing helpers such as `UnixAutoconfExecutor`, `UnixCMakeExecutor`, `WindowsCMakeExecutor`, `shell()`, `cmd()`, and `FileSystem`.
|
|
||||||
- Do not modify build outputs (`buildroot/`, `source/`, `downloads/`, `pkgroot/`) to fix package definitions.
|
|
||||||
- If upstream metadata changes, update license metadata and smoke-test/display names when relevant.
|
|
||||||
|
|
||||||
## Common Task Paths
|
|
||||||
|
|
||||||
- Add a new PECL extension: define `config/pkg/ext/ext-name.yml` with `type: php-extension`, `artifact.source.type: pecl`, dependencies, and `php-extension.arg-type`; add a class only if configure args, patches, or hooks are non-standard.
|
|
||||||
- Add a library: define `config/pkg/lib/name.yml` with artifact, dependencies, and install verification fields (`headers`, `static-libs`, `pkg-configs`, `static-bins`); add build class methods by OS.
|
|
||||||
- Fix an existing package build: start from the failing package config/class, then inspect dependencies and hooks targeting that package before changing shared core code.
|
|
||||||
- Update a version source: prefer artifact fields that support update checking (`ghrel`, `ghtar`, `ghtagtar`, `git` with regex, `filelist`, `pecl`, `pie`) over hard-coded URLs when upstream supports it.
|
|
||||||
|
|
||||||
## Resources
|
|
||||||
|
|
||||||
- `references/package-reference.md`: YAML package/artifact model, naming, fields, validation, and commands.
|
|
||||||
- `references/build-class-patterns.md`: PHP package attributes, stages, hooks, executors, and class patterns.
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
interface:
|
|
||||||
display_name: "StaticPHP Package Maintenance"
|
|
||||||
short_description: "Add, update, and validate StaticPHP v3 package definitions."
|
|
||||||
default_prompt: "Use $staticphp-package-maintenance to add, modify, or review StaticPHP package and artifact definitions."
|
|
||||||
@@ -1,143 +0,0 @@
|
|||||||
# StaticPHP Build Class Patterns
|
|
||||||
|
|
||||||
## Contents
|
|
||||||
|
|
||||||
- When a class is needed
|
|
||||||
- Package attributes
|
|
||||||
- Stage and hook behavior
|
|
||||||
- Executor choices
|
|
||||||
- Common patterns
|
|
||||||
- Failure-safe edits
|
|
||||||
|
|
||||||
## When a Class Is Needed
|
|
||||||
|
|
||||||
Do not add a PHP package class for simple metadata. Use YAML alone when StaticPHP can infer the configure args, dependencies, and verification.
|
|
||||||
|
|
||||||
Add or update a class when the package needs:
|
|
||||||
|
|
||||||
- OS-specific build commands.
|
|
||||||
- Custom validation before building.
|
|
||||||
- Custom PHP configure arguments.
|
|
||||||
- Patches or file edits before build.
|
|
||||||
- Hooks into another package's stage.
|
|
||||||
- Custom source/binary download or extraction logic.
|
|
||||||
- Package info shown by dev tooling.
|
|
||||||
|
|
||||||
Package classes live in `src/Package/*` and are discovered through PSR-4 plus attributes. Config must exist first; `PackageLoader` throws if an attribute references an undefined package.
|
|
||||||
|
|
||||||
## Package Attributes
|
|
||||||
|
|
||||||
Class-level package attributes:
|
|
||||||
|
|
||||||
- `#[Extension('curl')]` maps to package `ext-curl` if the prefix is omitted.
|
|
||||||
- `#[Library('openssl')]`
|
|
||||||
- `#[Target('php')]`
|
|
||||||
- `#[Tool('zig')]`
|
|
||||||
|
|
||||||
Method-level attributes:
|
|
||||||
|
|
||||||
- `#[BuildFor('Linux'|'Darwin'|'Windows')]`: registers the `build` stage for that OS.
|
|
||||||
- `#[Stage('name')]`: registers a named stage; defaults to the method name when omitted.
|
|
||||||
- `#[BeforeStage('package', 'stage', 'only-when-package-resolved')]`: hook before a target package stage.
|
|
||||||
- `#[AfterStage('package', 'stage', 'only-when-package-resolved')]`: hook after a target package stage.
|
|
||||||
- `#[PatchBeforeBuild]`: runs once before package build unless `.spc-patched` exists; return `true` to write that marker.
|
|
||||||
- `#[CustomPhpConfigureArg('Linux')]`: supplies custom extension configure args.
|
|
||||||
- `#[Validate]`: validates environment/source assumptions.
|
|
||||||
- `#[Info]`: returns package information for tooling.
|
|
||||||
- `#[InitPackage]`: runs while loading a package class.
|
|
||||||
- `#[ResolveBuild]`: target package callback for resolving build dependencies.
|
|
||||||
- `#[ConditionalOn(SomeClass::class)]`: conditionally enables before/after hooks only when DI has the class.
|
|
||||||
|
|
||||||
## Stage and Hook Behavior
|
|
||||||
|
|
||||||
`PackageBuilder::buildPackage()` does:
|
|
||||||
|
|
||||||
1. Ensure build directories exist.
|
|
||||||
2. Skip if already installed unless forced.
|
|
||||||
3. Ensure source exists for non-virtual packages.
|
|
||||||
4. Emit `PatchBeforeBuild` callbacks.
|
|
||||||
5. Run the `build` stage.
|
|
||||||
6. Install license data.
|
|
||||||
7. Record tool package versions where relevant.
|
|
||||||
|
|
||||||
`Package::runStage()` wraps a stage with:
|
|
||||||
|
|
||||||
1. `BeforeStage` callbacks.
|
|
||||||
2. The stage method itself.
|
|
||||||
3. `AfterStage` callbacks.
|
|
||||||
|
|
||||||
SPC exceptions bind package and stage metadata. Preserve that behavior by throwing existing `SPCException` subclasses instead of raw exceptions when adding new failure paths.
|
|
||||||
|
|
||||||
## Executor Choices
|
|
||||||
|
|
||||||
Use existing executors where possible:
|
|
||||||
|
|
||||||
- `UnixAutoconfExecutor`: for Unix packages using `./configure && make && make install`. It injects default static flags and copies `config.log` into SPC logs on failure.
|
|
||||||
- `UnixCMakeExecutor`: for Unix CMake packages. It writes toolchain settings and copies CMake configure/error/output logs on failure.
|
|
||||||
- `WindowsCMakeExecutor`: for Windows CMake packages.
|
|
||||||
- `shell()->cd(...)->initializeEnv($pkg)`: for custom Unix command chains.
|
|
||||||
- `cmd()->cd(...)`: for Windows command chains.
|
|
||||||
|
|
||||||
Prefer `FileSystem` helpers for file edits and copies so behavior stays consistent.
|
|
||||||
|
|
||||||
## Common Patterns
|
|
||||||
|
|
||||||
Minimal library class:
|
|
||||||
|
|
||||||
```php
|
|
||||||
#[Library('example')]
|
|
||||||
class example
|
|
||||||
{
|
|
||||||
#[BuildFor('Linux')]
|
|
||||||
public function build(LibraryPackage $pkg): void
|
|
||||||
{
|
|
||||||
(new UnixAutoconfExecutor($pkg))
|
|
||||||
->configure()
|
|
||||||
->make();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Extension hook into PHP build:
|
|
||||||
|
|
||||||
```php
|
|
||||||
#[Extension('curl')]
|
|
||||||
class curl
|
|
||||||
{
|
|
||||||
#[BeforeStage('php', [php::class, 'makeForWindows'], 'ext-curl')]
|
|
||||||
public function patchBeforePhpBuild(): void
|
|
||||||
{
|
|
||||||
// Adjust env, generated build files, or linker flags.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Validation:
|
|
||||||
|
|
||||||
```php
|
|
||||||
#[Validate]
|
|
||||||
public function validate(): void
|
|
||||||
{
|
|
||||||
if (SystemTarget::getTargetOS() === 'Windows' && WindowsUtil::findCommand('perl.exe') === null) {
|
|
||||||
throw new EnvironmentException('You need to install perl first!');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Custom configure args should be used when YAML `arg-type` is `custom` or when args need package/install context:
|
|
||||||
|
|
||||||
```php
|
|
||||||
#[CustomPhpConfigureArg('Linux')]
|
|
||||||
public function configureArg(PhpExtensionPackage $ext): string
|
|
||||||
{
|
|
||||||
return '--with-example=' . $ext->getBuildRootPath();
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Failure-Safe Edits
|
|
||||||
|
|
||||||
- Make hooks conditional with the third `BeforeStage`/`AfterStage` argument when a dependency must be resolved before the hook should run.
|
|
||||||
- Keep platform-specific code under matching `#[BuildFor]` methods rather than branching heavily inside one method.
|
|
||||||
- If a patch changes upstream source, place patch files in `src/globals/patch/` and describe them with `#[PatchDescription]` where appropriate.
|
|
||||||
- If a class only mutates environment variables for another package, search for existing hooks first to avoid duplicate linker flags.
|
|
||||||
- After adding attributes, run registry/config tests because invalid stages and unknown packages are caught during loading.
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
# StaticPHP Package Reference
|
|
||||||
|
|
||||||
## Contents
|
|
||||||
|
|
||||||
- Package locations
|
|
||||||
- Package types
|
|
||||||
- Artifact model
|
|
||||||
- Common YAML fields
|
|
||||||
- PHP extension fields
|
|
||||||
- Platform suffixes
|
|
||||||
- Validation and tests
|
|
||||||
|
|
||||||
## Package Locations
|
|
||||||
|
|
||||||
StaticPHP v3 keeps package metadata in YAML and behavior in PHP classes.
|
|
||||||
|
|
||||||
| Kind | YAML | PHP class namespace | Typical attribute |
|
|
||||||
|---|---|---|---|
|
|
||||||
| PHP extension | `config/pkg/ext/ext-name.yml` | `Package\Extension` | `#[Extension('name')]` |
|
|
||||||
| Library | `config/pkg/lib/name.yml` | `Package\Library` | `#[Library('name')]` |
|
|
||||||
| Target | `config/pkg/target/name.yml` | `Package\Target` | `#[Target('name')]` |
|
|
||||||
| Virtual target | `config/pkg/target/name.yml` | `Package\Target` | `#[Target('name')]` |
|
|
||||||
| Tool | `config/pkg/tool/name.yml` | `Package\Tool` | `#[Tool('name')]` |
|
|
||||||
| Custom artifact | `config/artifact/name.yml` | `Package\Artifact` | artifact attributes |
|
|
||||||
|
|
||||||
Prefer one package per YAML file unless an existing file groups related definitions. Match nearby naming and ordering.
|
|
||||||
|
|
||||||
## Package Types
|
|
||||||
|
|
||||||
`php-extension` packages describe PHP extensions. Config package names must use the `ext-` prefix. Dependencies on extensions also use `ext-`.
|
|
||||||
|
|
||||||
`library` packages describe buildable dependency libraries. They usually define source artifacts plus verification fields such as headers, static libraries, pkg-config files, or binaries.
|
|
||||||
|
|
||||||
`target` packages represent final build outputs and inherit the library-style fields. StaticPHP automatically exposes build commands for targets.
|
|
||||||
|
|
||||||
`virtual-target` packages are abstract dependency/build scheduling nodes. They may omit `artifact`.
|
|
||||||
|
|
||||||
`tool` packages are helper programs or toolchains installed into `pkgroot/` or used by builds.
|
|
||||||
|
|
||||||
## Artifact Model
|
|
||||||
|
|
||||||
Artifacts define downloadable source archives or prebuilt binaries. Use inline artifacts for simple one-package sources and `config/artifact/*.yml` for shared, complex, or custom artifacts.
|
|
||||||
|
|
||||||
Top-level artifact sections:
|
|
||||||
|
|
||||||
- `source`: source archive, git checkout, PECL/PIE package, local directory, or custom source.
|
|
||||||
- `binary`: prebuilt binary by platform, or aliases such as `hosted`/`custom`.
|
|
||||||
- `metadata`: `license`, `license-files`, and `source-root`.
|
|
||||||
|
|
||||||
Common source types:
|
|
||||||
|
|
||||||
- `url`: fixed URL; supports `filename`, `version`, and `extract`.
|
|
||||||
- `git`: repository source; use `rev` for a fixed branch/tag/commit or `regex` with named `version` capture for update checks.
|
|
||||||
- `ghrel`: GitHub release asset by regex filename match.
|
|
||||||
- `ghtar`: generated GitHub release tarball.
|
|
||||||
- `ghtagtar`: generated GitHub tag tarball.
|
|
||||||
- `filelist`: scrape a download index and extract version/filename with regex.
|
|
||||||
- `pecl`: PECL extension by name.
|
|
||||||
- `pie`: Packagist PIE extension by `vendor/package`.
|
|
||||||
- `php-release`: official PHP source selected by build PHP version.
|
|
||||||
- `local`: local source directory for development/offline use.
|
|
||||||
- `custom`: PHP artifact class handles source or binary logic.
|
|
||||||
|
|
||||||
Use `metadata.source-root` when the actual build directory is inside an extracted subdirectory.
|
|
||||||
|
|
||||||
Use `metadata.license-files` for source licenses. `@/file.txt` points to bundled license files in `src/globals/licenses/`.
|
|
||||||
|
|
||||||
## Common YAML Fields
|
|
||||||
|
|
||||||
Shared fields:
|
|
||||||
|
|
||||||
- `type`: required package type.
|
|
||||||
- `description`: optional human-readable package description.
|
|
||||||
- `license`: package-level license annotation where applicable.
|
|
||||||
- `lang`: implementation language such as `c` or `c++`.
|
|
||||||
- `frameworks`: macOS framework tags.
|
|
||||||
- `artifact`: string reference or inline artifact object. Required for `library` and `target`; optional for built-in extensions and virtual targets.
|
|
||||||
- `depends`: hard dependencies.
|
|
||||||
- `suggests`: optional dependencies.
|
|
||||||
|
|
||||||
Library, target, and tool verification/installation fields:
|
|
||||||
|
|
||||||
- `headers`: expected files/directories under `buildroot/include`.
|
|
||||||
- `static-libs`: expected static libraries under `buildroot/lib`.
|
|
||||||
- `pkg-configs`: expected `.pc` files under `buildroot/lib/pkgconfig`.
|
|
||||||
- `static-bins`: expected executables under `buildroot/bin`.
|
|
||||||
- `path`: directories appended to PATH after install.
|
|
||||||
- `env`: environment variables set after install.
|
|
||||||
- `append-env`: values appended to existing environment variables.
|
|
||||||
|
|
||||||
Path placeholders in `path`, `env`, and `append-env`:
|
|
||||||
|
|
||||||
- `{build_root_path}`: `buildroot/`
|
|
||||||
- `{pkg_root_path}`: `pkgroot/`
|
|
||||||
- `{working_dir}`: repository or working directory
|
|
||||||
- `{download_path}`: `downloads/`
|
|
||||||
- `{source_path}`: `source/`
|
|
||||||
- `{spc_msys2_path}`: MSYS2 root on Windows
|
|
||||||
|
|
||||||
## PHP Extension Fields
|
|
||||||
|
|
||||||
Extension-specific fields live under `php-extension`.
|
|
||||||
|
|
||||||
- `arg-type`: configure argument behavior. Built-ins include `enable`, `enable-path`, `with`, `with-path`, `custom`, and `none`. Full strings are allowed.
|
|
||||||
- `zend-extension`: true for Zend extensions such as opcache/xdebug.
|
|
||||||
- `build-shared`: whether shared builds are allowed.
|
|
||||||
- `build-static`: whether static builds are allowed.
|
|
||||||
- `build-with-php`: true when built inside the PHP source tree.
|
|
||||||
- `display-name`: value used for `php --ri` smoke tests and license display; empty string skips the `--ri` check.
|
|
||||||
- `os`: allowed OS families: `Linux`, `Darwin`, `Windows`.
|
|
||||||
|
|
||||||
Configure string placeholders:
|
|
||||||
|
|
||||||
- `@build_root_path@`: absolute buildroot path.
|
|
||||||
- `@shared_suffix@`: `=shared` in shared builds, empty in static builds.
|
|
||||||
- `@shared_path_suffix@`: `=shared,{buildroot}` in shared builds, `={buildroot}` in static builds.
|
|
||||||
|
|
||||||
## Platform Suffixes
|
|
||||||
|
|
||||||
Many fields support platform suffixes:
|
|
||||||
|
|
||||||
- `@unix`: Linux and macOS.
|
|
||||||
- `@linux`: Linux only.
|
|
||||||
- `@macos`: macOS only.
|
|
||||||
- `@windows`: Windows only.
|
|
||||||
|
|
||||||
For Linux, specific fields override generic fields in this order: `field@linux`, then `field@unix`, then `field`.
|
|
||||||
|
|
||||||
Use suffixes for declarative differences in dependencies, headers, libraries, pkg-configs, extension args, and suggestions.
|
|
||||||
|
|
||||||
## Validation and Tests
|
|
||||||
|
|
||||||
Run config validation for most package edits:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
php bin/spc dev:lint-config
|
|
||||||
```
|
|
||||||
|
|
||||||
Run focused tests after config or registry changes:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
vendor/bin/phpunit tests/StaticPHP/Config tests/StaticPHP/Registry tests/StaticPHP/Util/DependencyResolverTest.php --no-coverage
|
|
||||||
```
|
|
||||||
|
|
||||||
Run broader checks for framework or class changes:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
composer test
|
|
||||||
composer analyse
|
|
||||||
```
|
|
||||||
|
|
||||||
Build commands are expensive. Use them for user-provided repros, package-specific fixes, or when validation cannot prove the behavior:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
php bin/spc build:libs "openssl,curl" -vvv
|
|
||||||
php bin/spc build:php "bcmath,openssl,curl" --build-cli -vvv
|
|
||||||
```
|
|
||||||
107
.github/workflows/build-linux-arm.yml
vendored
Normal file
107
.github/workflows/build-linux-arm.yml
vendored
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
name: CI on arm linux
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
operating-system:
|
||||||
|
required: true
|
||||||
|
description: Compile target arch (Linux only)
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- aarch64
|
||||||
|
version:
|
||||||
|
required: true
|
||||||
|
description: php version to compile
|
||||||
|
default: '8.2'
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- '8.3'
|
||||||
|
- '8.2'
|
||||||
|
- '8.1'
|
||||||
|
- '8.0'
|
||||||
|
- '7.4'
|
||||||
|
build-cli:
|
||||||
|
description: build cli binary
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
build-micro:
|
||||||
|
description: build phpmicro binary
|
||||||
|
type: boolean
|
||||||
|
build-fpm:
|
||||||
|
description: build fpm binary
|
||||||
|
type: boolean
|
||||||
|
extensions:
|
||||||
|
description: extensions to compile (comma separated)
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
debug:
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: build ${{ inputs.version }} on ${{ inputs.operating-system }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Cache downloaded source
|
||||||
|
- id: cache-download
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: downloads
|
||||||
|
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
|
||||||
|
|
||||||
|
# With or without debug
|
||||||
|
- if: inputs.debug == true
|
||||||
|
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# With target select: cli, micro or both
|
||||||
|
- if: ${{ inputs.build-cli == true }}
|
||||||
|
run: echo "SPC_BUILD_CLI=--build-cli" >> $GITHUB_ENV
|
||||||
|
- if: ${{ inputs.build-micro == true }}
|
||||||
|
run: echo "SPC_BUILD_MICRO=--build-micro" >> $GITHUB_ENV
|
||||||
|
- if: ${{ inputs.build-fpm == true }}
|
||||||
|
run: echo "SPC_BUILD_FPM=--build-fpm" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# If there's no dependencies cache, fetch sources, with or without debug
|
||||||
|
- if: steps.cache-download.outputs.cache-hit != 'true'
|
||||||
|
run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }}
|
||||||
|
|
||||||
|
# Run build command
|
||||||
|
- run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
|
||||||
|
|
||||||
|
# Upload cli executable
|
||||||
|
- if: ${{ inputs.build-cli == true }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: php-${{ inputs.version }}-linux-${{ inputs.operating-system }}
|
||||||
|
path: buildroot/bin/php
|
||||||
|
|
||||||
|
# Upload micro self-extracted executable
|
||||||
|
- if: ${{ inputs.build-micro == true }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: micro-${{ inputs.version }}-linux-${{ inputs.operating-system }}
|
||||||
|
path: buildroot/bin/micro.sfx
|
||||||
|
|
||||||
|
# Upload fpm executable
|
||||||
|
- if: ${{ inputs.build-fpm == true }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: php-fpm-${{ inputs.version }}-linux-${{ inputs.operating-system }}
|
||||||
|
path: buildroot/bin/php-fpm
|
||||||
|
|
||||||
|
# Upload extensions metadata
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: license-files
|
||||||
|
path: buildroot/license/
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: build-meta
|
||||||
|
path: |
|
||||||
|
buildroot/build-extensions.json
|
||||||
|
buildroot/build-libraries.json
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: CI on x86_64 Windows
|
name: CI on x86_64 linux
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -6,14 +6,14 @@ on:
|
|||||||
version:
|
version:
|
||||||
required: true
|
required: true
|
||||||
description: php version to compile
|
description: php version to compile
|
||||||
default: '8.4'
|
default: '8.2'
|
||||||
type: choice
|
type: choice
|
||||||
options:
|
options:
|
||||||
- '8.4'
|
|
||||||
- '8.3'
|
- '8.3'
|
||||||
- '8.2'
|
- '8.2'
|
||||||
- '8.1'
|
- '8.1'
|
||||||
- '8.0'
|
- '8.0'
|
||||||
|
- '7.4'
|
||||||
build-cli:
|
build-cli:
|
||||||
description: build cli binary
|
description: build cli binary
|
||||||
default: true
|
default: true
|
||||||
@@ -21,20 +21,14 @@ on:
|
|||||||
build-micro:
|
build-micro:
|
||||||
description: build phpmicro binary
|
description: build phpmicro binary
|
||||||
type: boolean
|
type: boolean
|
||||||
|
build-fpm:
|
||||||
|
description: build fpm binary
|
||||||
|
type: boolean
|
||||||
extensions:
|
extensions:
|
||||||
description: extensions to compile (comma separated)
|
description: extensions to compile (comma separated)
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
prefer-pre-built:
|
|
||||||
description: prefer pre-built binaries (reduce build time)
|
|
||||||
type: boolean
|
|
||||||
default: true
|
|
||||||
with-suggested-libs:
|
|
||||||
description: Build with suggested libs
|
|
||||||
type: boolean
|
|
||||||
default: true
|
|
||||||
debug:
|
debug:
|
||||||
description: enable debug logs
|
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -42,14 +36,14 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: build ${{ inputs.version }} on Windows x86_64
|
name: build ${{ inputs.version }} on Linux x86_64
|
||||||
runs-on: windows-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
# Cache composer dependencies
|
# Cache composer dependencies
|
||||||
- id: cache-composer-deps
|
- id: cache-composer-deps
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: vendor
|
path: vendor
|
||||||
key: composer-dependencies
|
key: composer-dependencies
|
||||||
@@ -58,61 +52,62 @@ jobs:
|
|||||||
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
|
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
|
||||||
run: composer update --no-dev --classmap-authoritative
|
run: composer update --no-dev --classmap-authoritative
|
||||||
|
|
||||||
- name: Generate hashed key for download cache
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
INPUT_HASH=$(echo "${{ runner.os }}-${{ inputs.version }}-${{ inputs.extensions }}" | sha256sum | awk '{print $1}')
|
|
||||||
echo "INPUT_HASH=${INPUT_HASH}" >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
# Cache downloaded source
|
# Cache downloaded source
|
||||||
- id: cache-download
|
- id: cache-download
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: downloads
|
path: downloads
|
||||||
key: php-${{ env.INPUT_HASH }}
|
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
|
||||||
|
|
||||||
# With or without debug
|
# With or without debug
|
||||||
- if: inputs.debug == true
|
- if: inputs.debug == true
|
||||||
run: echo "SPC_BUILD_DEBUG=--debug" >> $env:GITHUB_ENV
|
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
|
||||||
- if: inputs.prefer-pre-built == true
|
|
||||||
run: echo "SPC_PRE_BUILT=--prefer-pre-built" >> $env:GITHUB_ENV
|
|
||||||
|
|
||||||
# With target select: cli, micro or both
|
# With target select: cli, micro or both
|
||||||
- if: ${{ inputs.build-cli == true }}
|
- if: ${{ inputs.build-cli == true }}
|
||||||
run: echo "SPC_BUILD_CLI=--build-cli" >> $env:GITHUB_ENV
|
run: echo "SPC_BUILD_CLI=--build-cli" >> $GITHUB_ENV
|
||||||
- if: ${{ inputs.build-micro == true }}
|
- if: ${{ inputs.build-micro == true }}
|
||||||
run: echo "SPC_BUILD_MICRO=--build-micro" >> $env:GITHUB_ENV
|
run: echo "SPC_BUILD_MICRO=--build-micro" >> $GITHUB_ENV
|
||||||
|
- if: ${{ inputs.build-fpm == true }}
|
||||||
- run: ./bin/spc doctor
|
run: echo "SPC_BUILD_FPM=--build-fpm" >> $GITHUB_ENV
|
||||||
|
|
||||||
# If there's no dependencies cache, fetch sources, with or without debug
|
# If there's no dependencies cache, fetch sources, with or without debug
|
||||||
- if: steps.cache-download.outputs.cache-hit != 'true'
|
- if: steps.cache-download.outputs.cache-hit != 'true'
|
||||||
run: ./bin/spc download --with-php="${{ inputs.version }}" --for-extensions="${{ inputs.extensions }}" ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_PRE_BUILT }}
|
run: CACHE_API_EXEC=yes ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }}
|
||||||
|
|
||||||
# Run build command
|
# Run build command
|
||||||
- run: ./bin/spc build "${{ inputs.extensions }}" ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
|
- run: ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
|
||||||
|
|
||||||
# Upload cli executable
|
# Upload cli executable
|
||||||
- if: ${{ inputs.build-cli == true }}
|
- if: ${{ inputs.build-cli == true }}
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: php-${{ inputs.version }}
|
name: php-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
|
||||||
path: buildroot/bin/php.exe
|
path: buildroot/bin/php
|
||||||
|
|
||||||
# Upload micro self-extracted executable
|
# Upload micro self-extracted executable
|
||||||
- if: ${{ inputs.build-micro == true }}
|
- if: ${{ inputs.build-micro == true }}
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: micro-${{ inputs.version }}
|
name: micro-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
|
||||||
path: buildroot/bin/micro.sfx
|
path: buildroot/bin/micro.sfx
|
||||||
|
|
||||||
|
# Upload fpm executable
|
||||||
|
- if: ${{ inputs.build-fpm == true }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: php-fpm-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
|
||||||
|
path: buildroot/bin/php-fpm
|
||||||
|
|
||||||
# Upload extensions metadata
|
# Upload extensions metadata
|
||||||
- uses: actions/upload-artifact@v7
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: license-files
|
name: license-files
|
||||||
path: buildroot/license/
|
path: buildroot/license/
|
||||||
- uses: actions/upload-artifact@v7
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: build-meta
|
name: build-meta
|
||||||
path: |
|
path: |
|
||||||
buildroot/build-manifest.json
|
buildroot/build-extensions.json
|
||||||
|
buildroot/build-libraries.json
|
||||||
|
|
||||||
118
.github/workflows/build-macos-x86_64.yml
vendored
Normal file
118
.github/workflows/build-macos-x86_64.yml
vendored
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
name: CI on x86_64 macOS
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
required: true
|
||||||
|
description: php version to compile
|
||||||
|
default: '8.2'
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- '8.3'
|
||||||
|
- '8.2'
|
||||||
|
- '8.1'
|
||||||
|
- '8.0'
|
||||||
|
- '7.4'
|
||||||
|
build-cli:
|
||||||
|
description: build cli binary
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
build-micro:
|
||||||
|
description: build phpmicro binary
|
||||||
|
type: boolean
|
||||||
|
build-fpm:
|
||||||
|
description: build fpm binary
|
||||||
|
type: boolean
|
||||||
|
extensions:
|
||||||
|
description: extensions to compile (comma separated)
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
debug:
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: build ${{ inputs.version }} on macOS x86_64
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Install macOS missing packages and mark os suffix
|
||||||
|
- run: |
|
||||||
|
brew install automake gzip
|
||||||
|
echo "SPC_BUILD_OS=macos" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# Cache composer dependencies
|
||||||
|
- id: cache-composer-deps
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: vendor
|
||||||
|
key: composer-dependencies
|
||||||
|
|
||||||
|
# If there's no Composer cache, install dependencies
|
||||||
|
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
|
||||||
|
run: composer update --no-dev --classmap-authoritative
|
||||||
|
|
||||||
|
# Cache downloaded source
|
||||||
|
- id: cache-download
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: downloads
|
||||||
|
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
|
||||||
|
|
||||||
|
# With or without debug
|
||||||
|
- if: inputs.debug == true
|
||||||
|
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# With target select: cli, micro or both
|
||||||
|
- if: ${{ inputs.build-cli == true }}
|
||||||
|
run: echo "SPC_BUILD_CLI=--build-cli" >> $GITHUB_ENV
|
||||||
|
- if: ${{ inputs.build-micro == true }}
|
||||||
|
run: echo "SPC_BUILD_MICRO=--build-micro" >> $GITHUB_ENV
|
||||||
|
- if: ${{ inputs.build-fpm == true }}
|
||||||
|
run: echo "SPC_BUILD_FPM=--build-fpm" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# If there's no dependencies cache, fetch sources, with or without debug
|
||||||
|
- if: steps.cache-download.outputs.cache-hit != 'true'
|
||||||
|
run: ./bin/spc download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }}
|
||||||
|
|
||||||
|
# Run build command
|
||||||
|
- run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
|
||||||
|
|
||||||
|
# Upload cli executable
|
||||||
|
- if: ${{ inputs.build-cli == true }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: php-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
|
||||||
|
path: buildroot/bin/php
|
||||||
|
|
||||||
|
# Upload micro self-extracted executable
|
||||||
|
- if: ${{ inputs.build-micro == true }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: micro-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
|
||||||
|
path: buildroot/bin/micro.sfx
|
||||||
|
|
||||||
|
# Upload fpm executable
|
||||||
|
- if: ${{ inputs.build-fpm == true }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: php-fpm-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
|
||||||
|
path: buildroot/bin/php-fpm
|
||||||
|
|
||||||
|
# Upload extensions metadata
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: license-files
|
||||||
|
path: buildroot/license/
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: build-meta
|
||||||
|
path: |
|
||||||
|
buildroot/build-extensions.json
|
||||||
|
buildroot/build-libraries.json
|
||||||
|
|
||||||
334
.github/workflows/build-unix.yml
vendored
334
.github/workflows/build-unix.yml
vendored
@@ -1,334 +0,0 @@
|
|||||||
name: "CI on Unix"
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
os:
|
|
||||||
required: true
|
|
||||||
description: Build target OS
|
|
||||||
default: 'linux-x86_64'
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- 'linux-x86_64'
|
|
||||||
- 'linux-aarch64'
|
|
||||||
- 'linux-x86_64-glibc'
|
|
||||||
- 'linux-aarch64-glibc'
|
|
||||||
- 'macos-x86_64'
|
|
||||||
- 'macos-aarch64'
|
|
||||||
php-version:
|
|
||||||
required: true
|
|
||||||
description: PHP version to compile
|
|
||||||
default: '8.4'
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- '8.4'
|
|
||||||
- '8.3'
|
|
||||||
- '8.2'
|
|
||||||
- '8.1'
|
|
||||||
extensions:
|
|
||||||
description: Extensions to build (comma separated)
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
shared-extensions:
|
|
||||||
description: Shared extensions to build (optional, comma separated)
|
|
||||||
type: string
|
|
||||||
extra-libs:
|
|
||||||
description: Extra libraries to build (optional, comma separated)
|
|
||||||
type: string
|
|
||||||
build-cli:
|
|
||||||
description: Build cli binary
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
build-micro:
|
|
||||||
description: Build phpmicro binary
|
|
||||||
type: boolean
|
|
||||||
build-fpm:
|
|
||||||
description: Build fpm binary
|
|
||||||
type: boolean
|
|
||||||
build-frankenphp:
|
|
||||||
description: Build frankenphp binary (requires ZTS)
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
enable-zts:
|
|
||||||
description: Enable ZTS
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
prefer-pre-built:
|
|
||||||
description: Prefer pre-built binaries (reduce build time)
|
|
||||||
type: boolean
|
|
||||||
default: true
|
|
||||||
with-suggested-libs:
|
|
||||||
description: Build with suggested libs
|
|
||||||
type: boolean
|
|
||||||
default: true
|
|
||||||
debug:
|
|
||||||
description: Show full build logs
|
|
||||||
type: boolean
|
|
||||||
no-strip:
|
|
||||||
description: Keep debug symbols for debugging
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
os:
|
|
||||||
required: true
|
|
||||||
description: Build target OS
|
|
||||||
default: 'linux-x86_64'
|
|
||||||
type: string
|
|
||||||
php-version:
|
|
||||||
required: true
|
|
||||||
description: PHP version to compile
|
|
||||||
default: '8.4'
|
|
||||||
type: string
|
|
||||||
extensions:
|
|
||||||
description: Extensions to build (comma separated)
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
shared-extensions:
|
|
||||||
description: Shared extensions to build (optional, comma separated)
|
|
||||||
type: string
|
|
||||||
extra-libs:
|
|
||||||
description: Extra libraries to build (optional, comma separated)
|
|
||||||
type: string
|
|
||||||
build-cli:
|
|
||||||
description: Build cli binary
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
build-micro:
|
|
||||||
description: Build phpmicro binary
|
|
||||||
type: boolean
|
|
||||||
build-fpm:
|
|
||||||
description: Build fpm binary
|
|
||||||
type: boolean
|
|
||||||
build-frankenphp:
|
|
||||||
description: Build frankenphp binary (requires ZTS)
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
enable-zts:
|
|
||||||
description: Enable ZTS
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
prefer-pre-built:
|
|
||||||
description: Prefer pre-built binaries (reduce build time)
|
|
||||||
type: boolean
|
|
||||||
default: true
|
|
||||||
with-suggested-libs:
|
|
||||||
description: Include suggested libs
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
debug:
|
|
||||||
description: Show full build logs
|
|
||||||
type: boolean
|
|
||||||
no-strip:
|
|
||||||
description: Keep debug symbols for debugging
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
define-build:
|
|
||||||
name: "Define Build Scripts"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
run: ${{ steps.gendef.outputs.run }}
|
|
||||||
download: ${{ steps.gendef.outputs.download }}
|
|
||||||
build: ${{ steps.gendef.outputs.build }}
|
|
||||||
steps:
|
|
||||||
- name: "Checkout"
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: "Define"
|
|
||||||
id: gendef
|
|
||||||
run: |
|
|
||||||
case "${{ inputs.os }}" in
|
|
||||||
linux-x86_64)
|
|
||||||
DOWN_CMD="./bin/spc-alpine-docker download"
|
|
||||||
BUILD_CMD="./bin/spc-alpine-docker build"
|
|
||||||
RUNS_ON="ubuntu-latest"
|
|
||||||
;;
|
|
||||||
linux-aarch64)
|
|
||||||
DOWN_CMD="./bin/spc-alpine-docker download"
|
|
||||||
BUILD_CMD="./bin/spc-alpine-docker build"
|
|
||||||
RUNS_ON="ubuntu-24.04-arm"
|
|
||||||
;;
|
|
||||||
linux-x86_64-glibc)
|
|
||||||
DOWN_CMD="./bin/spc-gnu-docker download"
|
|
||||||
BUILD_CMD="./bin/spc-gnu-docker build"
|
|
||||||
RUNS_ON="ubuntu-22.04"
|
|
||||||
;;
|
|
||||||
linux-aarch64-glibc)
|
|
||||||
DOWN_CMD="./bin/spc-gnu-docker download"
|
|
||||||
BUILD_CMD="./bin/spc-gnu-docker build"
|
|
||||||
RUNS_ON="ubuntu-22.04-arm"
|
|
||||||
;;
|
|
||||||
macos-x86_64)
|
|
||||||
DOWN_CMD="composer update --no-dev --classmap-authoritative && ./bin/spc doctor --auto-fix && ./bin/spc download"
|
|
||||||
BUILD_CMD="./bin/spc build"
|
|
||||||
RUNS_ON="macos-15-intel"
|
|
||||||
;;
|
|
||||||
macos-aarch64)
|
|
||||||
DOWN_CMD="composer update --no-dev --classmap-authoritative && ./bin/spc doctor --auto-fix && ./bin/spc download"
|
|
||||||
BUILD_CMD="./bin/spc build"
|
|
||||||
RUNS_ON="macos-15"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
STATIC_EXTS="${{ inputs.extensions }}"
|
|
||||||
SHARED_EXTS="${{ inputs['shared-extensions'] }}"
|
|
||||||
BUILD_FRANKENPHP="${{ inputs['build-frankenphp'] }}"
|
|
||||||
ENABLE_ZTS="${{ inputs['enable-zts'] }}"
|
|
||||||
ALL_EXTS="$STATIC_EXTS"
|
|
||||||
if [ -n "$SHARED_EXTS" ]; then
|
|
||||||
ALL_EXTS="$ALL_EXTS,$SHARED_EXTS"
|
|
||||||
fi
|
|
||||||
DOWN_CMD="$DOWN_CMD --with-php=${{ inputs.php-version }} --for-extensions=$ALL_EXTS --ignore-cache-sources=php-src"
|
|
||||||
BUILD_CMD="$BUILD_CMD $STATIC_EXTS"
|
|
||||||
if [ -n "$SHARED_EXTS" ]; then
|
|
||||||
BUILD_CMD="$BUILD_CMD --build-shared=$SHARED_EXTS"
|
|
||||||
fi
|
|
||||||
if [ -n "${{ inputs.extra-libs }}" ]; then
|
|
||||||
DOWN_CMD="$DOWN_CMD --for-libs=${{ inputs.extra-libs }}"
|
|
||||||
BUILD_CMD="$BUILD_CMD --with-libs=${{ inputs.extra-libs }}"
|
|
||||||
fi
|
|
||||||
if [ ${{ inputs.debug }} == true ]; then
|
|
||||||
DOWN_CMD="$DOWN_CMD --debug"
|
|
||||||
BUILD_CMD="$BUILD_CMD --debug"
|
|
||||||
fi
|
|
||||||
if [ ${{ inputs.prefer-pre-built }} == true ]; then
|
|
||||||
DOWN_CMD="$DOWN_CMD --prefer-pre-built"
|
|
||||||
fi
|
|
||||||
if [ ${{ inputs.with-suggested-libs }} == true ]; then
|
|
||||||
BUILD_CMD="$BUILD_CMD --with-suggested-libs"
|
|
||||||
fi
|
|
||||||
if [ ${{ inputs.build-cli }} == true ]; then
|
|
||||||
BUILD_CMD="$BUILD_CMD --build-cli"
|
|
||||||
fi
|
|
||||||
if [ ${{ inputs.build-micro }} == true ]; then
|
|
||||||
BUILD_CMD="$BUILD_CMD --build-micro"
|
|
||||||
fi
|
|
||||||
if [ ${{ inputs.build-fpm }} == true ]; then
|
|
||||||
BUILD_CMD="$BUILD_CMD --build-fpm"
|
|
||||||
fi
|
|
||||||
if [ "$BUILD_FRANKENPHP" = "true" ]; then
|
|
||||||
BUILD_CMD="$BUILD_CMD --build-frankenphp"
|
|
||||||
fi
|
|
||||||
if [ "$ENABLE_ZTS" = "true" ]; then
|
|
||||||
BUILD_CMD="$BUILD_CMD --enable-zts"
|
|
||||||
fi
|
|
||||||
echo 'download='"$DOWN_CMD" >> "$GITHUB_OUTPUT"
|
|
||||||
echo 'build='"$BUILD_CMD" >> "$GITHUB_OUTPUT"
|
|
||||||
echo 'run='"$RUNS_ON" >> "$GITHUB_OUTPUT"
|
|
||||||
build:
|
|
||||||
name: "Build ${{ inputs.version }} on ${{ inputs.os }}"
|
|
||||||
runs-on: ${{ needs.define-build.outputs.run }}
|
|
||||||
needs: define-build
|
|
||||||
timeout-minutes: 240
|
|
||||||
steps:
|
|
||||||
- name: "Checkout"
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: "Setup PHP"
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: 8.4
|
|
||||||
tools: pecl, composer
|
|
||||||
extensions: curl, openssl, mbstring
|
|
||||||
ini-values: memory_limit=-1
|
|
||||||
env:
|
|
||||||
phpts: nts
|
|
||||||
|
|
||||||
- if: ${{ inputs['build-frankenphp'] == true }}
|
|
||||||
name: "Install go-xcaddy for FrankenPHP"
|
|
||||||
run: |
|
|
||||||
case "${{ inputs.os }}" in
|
|
||||||
linux-x86_64|linux-aarch64)
|
|
||||||
./bin/spc-alpine-docker install-pkg go-xcaddy
|
|
||||||
;;
|
|
||||||
linux-x86_64-glibc|linux-aarch64-glibc)
|
|
||||||
./bin/spc-gnu-docker install-pkg go-xcaddy
|
|
||||||
;;
|
|
||||||
macos-x86_64|macos-aarch64)
|
|
||||||
composer update --no-dev --classmap-authoritative
|
|
||||||
./bin/spc doctor --auto-fix
|
|
||||||
./bin/spc install-pkg go-xcaddy
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unsupported OS for go-xcaddy install: ${{ inputs.os }}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Cache downloaded source
|
|
||||||
- id: cache-download
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: downloads
|
|
||||||
key: php-dependencies-${{ inputs.os }}
|
|
||||||
- name: "Download sources"
|
|
||||||
run: ${{ needs.define-build.outputs.download }}
|
|
||||||
- name: "Build PHP"
|
|
||||||
run: ${{ needs.define-build.outputs.build }}
|
|
||||||
# - name: Setup tmate session
|
|
||||||
# if: ${{ failure() }}
|
|
||||||
# uses: mxschmitt/action-tmate@v3
|
|
||||||
|
|
||||||
# Upload debug logs
|
|
||||||
- if: ${{ inputs.debug && failure() }}
|
|
||||||
name: "Upload build logs on failure"
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: spc-logs-${{ inputs.php-version }}-${{ inputs.os }}
|
|
||||||
path: log/*.log
|
|
||||||
|
|
||||||
# Upload cli executable
|
|
||||||
- if: ${{ inputs.build-cli == true }}
|
|
||||||
name: "Upload PHP cli SAPI"
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: php-cli-${{ inputs.php-version }}-${{ inputs.os }}
|
|
||||||
path: buildroot/bin/php
|
|
||||||
|
|
||||||
# Upload micro self-extracted executable
|
|
||||||
- if: ${{ inputs.build-micro == true }}
|
|
||||||
name: "Upload PHP micro SAPI"
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: php-micro-${{ inputs.php-version }}-${{ inputs.os }}
|
|
||||||
path: buildroot/bin/micro.sfx
|
|
||||||
|
|
||||||
# Upload fpm executable
|
|
||||||
- if: ${{ inputs.build-fpm == true }}
|
|
||||||
name: "Upload PHP fpm SAPI"
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: php-fpm-${{ inputs.php-version }}-${{ inputs.os }}
|
|
||||||
path: buildroot/bin/php-fpm
|
|
||||||
|
|
||||||
# Upload frankenphp executable
|
|
||||||
- if: ${{ inputs['build-frankenphp'] == true }}
|
|
||||||
name: "Upload FrankenPHP SAPI"
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: php-frankenphp-${{ inputs.php-version }}-${{ inputs.os }}
|
|
||||||
path: buildroot/bin/frankenphp
|
|
||||||
|
|
||||||
# Upload extensions metadata
|
|
||||||
- if: ${{ inputs['shared-extensions'] != '' }}
|
|
||||||
name: "Upload shared extensions"
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
name: php-shared-ext-${{ inputs.php-version }}-${{ inputs.os }}
|
|
||||||
path: |
|
|
||||||
buildroot/modules/*.so
|
|
||||||
- uses: actions/upload-artifact@v7
|
|
||||||
name: "Upload License Files"
|
|
||||||
with:
|
|
||||||
name: license-files-${{ inputs.php-version }}-${{ inputs.os }}
|
|
||||||
path: buildroot/license/
|
|
||||||
- uses: actions/upload-artifact@v7
|
|
||||||
name: "Upload Build Metadata"
|
|
||||||
with:
|
|
||||||
name: build-meta-${{ inputs.php-version }}-${{ inputs.os }}
|
|
||||||
path: |
|
|
||||||
buildroot/build-manifest.json
|
|
||||||
40
.github/workflows/download-cache.yml
vendored
Normal file
40
.github/workflows/download-cache.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: archive download sources weekly
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: "* 14 * * 5"
|
||||||
|
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
download:
|
||||||
|
name: cache download sources
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php-version: [ "8.0", "8.1", "8.2", "8.3" ]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Cache composer dependencies
|
||||||
|
- id: cache-composer-deps
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: vendor
|
||||||
|
key: composer-dependencies
|
||||||
|
|
||||||
|
# If there's no Composer cache, install dependencies
|
||||||
|
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
|
||||||
|
run: composer update --no-dev
|
||||||
|
|
||||||
|
# If there's no dependencies cache, fetch sources, with or without debug
|
||||||
|
- if: steps.cache-download.outputs.cache-hit != 'true'
|
||||||
|
run: ./bin/spc download --with-php=${{ matrix.php-version }} --all --debug
|
||||||
|
|
||||||
|
# Upload downloaded files
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: download-files-${{ matrix.php-version }}
|
||||||
|
path: downloads/
|
||||||
140
.github/workflows/ext-matrix-tests.yml
vendored
140
.github/workflows/ext-matrix-tests.yml
vendored
@@ -1,140 +0,0 @@
|
|||||||
name: "Extension Matrix Tests"
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, labeled]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
|
|
||||||
runs-on: ${{ matrix.operating-system }}
|
|
||||||
if: contains(github.event.pull_request.labels.*.name, 'need-full-test')
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
extension:
|
|
||||||
- amqp
|
|
||||||
- apcu
|
|
||||||
- bcmath
|
|
||||||
- bz2
|
|
||||||
- calendar
|
|
||||||
- ctype
|
|
||||||
- curl
|
|
||||||
- dba
|
|
||||||
- dom
|
|
||||||
- ds
|
|
||||||
- event
|
|
||||||
- exif
|
|
||||||
- filter
|
|
||||||
- fileinfo
|
|
||||||
- ftp
|
|
||||||
- gd
|
|
||||||
- gettext
|
|
||||||
- gmp
|
|
||||||
- iconv
|
|
||||||
- igbinary
|
|
||||||
- imagick
|
|
||||||
- imap
|
|
||||||
- intl
|
|
||||||
- ldap
|
|
||||||
- mbstring,mbregex
|
|
||||||
- memcache
|
|
||||||
- mysqli,mysqlnd,pdo_mysql
|
|
||||||
- opcache
|
|
||||||
- openssl
|
|
||||||
- pcntl
|
|
||||||
- password-argon2
|
|
||||||
- pcntl
|
|
||||||
- pdo
|
|
||||||
- pgsql,pdo_pgsql
|
|
||||||
- phar
|
|
||||||
- posix
|
|
||||||
- rar
|
|
||||||
- protobuf
|
|
||||||
- readline
|
|
||||||
- redis
|
|
||||||
- session
|
|
||||||
- shmop
|
|
||||||
- simdjson
|
|
||||||
- simplexml,xml
|
|
||||||
- snappy
|
|
||||||
- soap
|
|
||||||
- sockets
|
|
||||||
- sodium
|
|
||||||
- sqlite3,pdo_sqlite
|
|
||||||
- sqlsrv
|
|
||||||
- ssh2
|
|
||||||
- swoole
|
|
||||||
- swoole,swoole-hook-pgsql,swoole-hook-mysql,swoole-hook-sqlite,swoole-hook-odbc
|
|
||||||
- swow
|
|
||||||
- sysvmsg,sysvsem,sysvshm
|
|
||||||
- tidy
|
|
||||||
- tokenizer
|
|
||||||
- uuid
|
|
||||||
- uv
|
|
||||||
- xhprof
|
|
||||||
- xlswriter
|
|
||||||
- xmlwriter,xmlreader
|
|
||||||
- xsl
|
|
||||||
- yac
|
|
||||||
- yaml
|
|
||||||
- zip
|
|
||||||
- zlib
|
|
||||||
- zstd
|
|
||||||
php-version:
|
|
||||||
- "8.4"
|
|
||||||
operating-system:
|
|
||||||
- "ubuntu-latest"
|
|
||||||
#- "macos-15-intel"
|
|
||||||
#- "debian-arm64-self-hosted"
|
|
||||||
- "macos-15"
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: "Checkout"
|
|
||||||
uses: "actions/checkout@v4"
|
|
||||||
|
|
||||||
- name: OS type
|
|
||||||
id: os-type
|
|
||||||
run: |
|
|
||||||
OS=""
|
|
||||||
if [ "${{ matrix.operating-system }}" = "ubuntu-latest" ]; then
|
|
||||||
OS="linux-x86_64"
|
|
||||||
elif [ "${{ matrix.operating-system }}" = "macos-15-intel" ]; then
|
|
||||||
OS="macos-x86_64"
|
|
||||||
elif [ "${{ matrix.operating-system }}" = "debian-arm64-self-hosted" ]; then
|
|
||||||
OS="linux-aarch64"
|
|
||||||
elif [ "${{ matrix.operating-system }}" = "macos-15" ]; then
|
|
||||||
OS="macos-aarch64"
|
|
||||||
fi
|
|
||||||
echo "OS=$OS" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: "Setup PHP"
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: 8.4
|
|
||||||
tools: pecl, composer
|
|
||||||
extensions: curl, openssl, mbstring
|
|
||||||
ini-values: memory_limit=-1
|
|
||||||
env:
|
|
||||||
phpts: nts
|
|
||||||
|
|
||||||
- name: "Install Dependencies"
|
|
||||||
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
|
||||||
|
|
||||||
- id: cache-download
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: downloads
|
|
||||||
key: php-${{ matrix.php-version }}-dependencies-for-tests
|
|
||||||
|
|
||||||
# If there's no dependencies cache, fetch sources
|
|
||||||
- name: "Download sources"
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: ./bin/spc download --with-php=${{ matrix.php-version }} --for-extensions=${{ matrix.extension }} --debug --ignore-cache-sources=php-src
|
|
||||||
|
|
||||||
- name: "Build library: ${{ matrix.library }}"
|
|
||||||
run: |
|
|
||||||
SPC_USE_SUDO=yes ./bin/spc doctor --auto-fix
|
|
||||||
./bin/spc build --build-cli --build-micro --build-fpm ${{ matrix.extension }} --debug --with-suggested-libs --with-suggested-exts
|
|
||||||
48
.github/workflows/post-test-bot-comment.yml
vendored
48
.github/workflows/post-test-bot-comment.yml
vendored
@@ -1,48 +0,0 @@
|
|||||||
name: Post Test Bot Comment
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_run:
|
|
||||||
workflows: ["v3 Tests"]
|
|
||||||
types: [completed]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
actions: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
post-comment:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 5
|
|
||||||
steps:
|
|
||||||
- name: Download bot output
|
|
||||||
id: download
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
continue-on-error: true
|
|
||||||
with:
|
|
||||||
name: bot-output
|
|
||||||
run-id: ${{ github.event.workflow_run.id }}
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Post/Update comment
|
|
||||||
if: steps.download.outcome == 'success'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
COMMENT_BODY=$(jq -r '.comment_body' bot-output.json)
|
|
||||||
PR_NUMBER=$(jq -r '.pr_number' bot-output.json)
|
|
||||||
MARKER="<!-- spc-test-bot -->"
|
|
||||||
|
|
||||||
# Find existing bot comment id
|
|
||||||
EXISTING_ID=$(gh api \
|
|
||||||
"repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" \
|
|
||||||
--jq "[.[] | select(.body | startswith(\"${MARKER}\")) | .id] | first // empty")
|
|
||||||
|
|
||||||
if [ -n "$EXISTING_ID" ]; then
|
|
||||||
gh api --method PATCH \
|
|
||||||
"repos/${{ github.repository }}/issues/comments/${EXISTING_ID}" \
|
|
||||||
-f body="$COMMENT_BODY"
|
|
||||||
else
|
|
||||||
gh pr comment "$PR_NUMBER" \
|
|
||||||
--repo "${{ github.repository }}" \
|
|
||||||
--body "$COMMENT_BODY"
|
|
||||||
fi
|
|
||||||
205
.github/workflows/release-build.yml
vendored
205
.github/workflows/release-build.yml
vendored
@@ -1,208 +1,47 @@
|
|||||||
name: Build SPC Binary
|
name: Upload SPC Binary (Release)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [ "main", "v3" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "main", "v3" ]
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/release-build.yml'
|
|
||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- published
|
- published
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
|
||||||
PHP_VERSION: 8.4
|
|
||||||
MICRO_VERSION: 8.4.11
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-release-artifacts:
|
build-release-artifacts:
|
||||||
name: "Build SPC Binary for ${{ matrix.operating-system.name }}"
|
name: "Upload SPC Binary (Release)"
|
||||||
runs-on: ${{ matrix.operating-system.os }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
operating-system:
|
operating-system:
|
||||||
- name: "linux-x86_64"
|
- "linux-x86_64"
|
||||||
os: "ubuntu-latest"
|
- "macos-x86_64"
|
||||||
filename: "spc-linux-x86_64.tar.gz"
|
- "linux-aarch64"
|
||||||
- name: "macos-x86_64"
|
- "macos-aarch64"
|
||||||
os: "macos-15-intel"
|
|
||||||
filename: "spc-macos-x86_64.tar.gz"
|
|
||||||
- name: "linux-aarch64"
|
|
||||||
os: "ubuntu-latest"
|
|
||||||
filename: "spc-linux-aarch64.tar.gz"
|
|
||||||
- name: "macos-aarch64"
|
|
||||||
os: "macos-14"
|
|
||||||
filename: "spc-macos-aarch64.tar.gz"
|
|
||||||
- name: "windows-x64"
|
|
||||||
os: "ubuntu-latest"
|
|
||||||
filename: "spc-windows-x64.exe"
|
|
||||||
permissions:
|
|
||||||
id-token: write
|
|
||||||
attestations: write
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: "actions/checkout@v5"
|
uses: "actions/checkout@v4"
|
||||||
|
|
||||||
- if: inputs.debug == true
|
- name: Reuse static-php-cli-hosted artifacts
|
||||||
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
|
uses: dawidd6/action-download-artifact@v2
|
||||||
|
|
||||||
- name: "Install PHP for official runners"
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
with:
|
||||||
coverage: none
|
repo: static-php/static-php-cli-hosted
|
||||||
tools: composer:v2
|
branch: master
|
||||||
php-version: "${{ env.PHP_VERSION }}"
|
workflow: build-spc-release.yml
|
||||||
ini-values: memory_limit=-1
|
name: "spc-${{ matrix.operating-system }}"
|
||||||
extensions: curl, openssl, mbstring
|
|
||||||
|
|
||||||
- name: "Get Composer Cache Directory"
|
- name: "Archive Executable"
|
||||||
id: composer-cache
|
|
||||||
run: |
|
run: |
|
||||||
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
tar -czf spc-${{ matrix.operating-system }}.tar.gz spc
|
||||||
|
echo "filename=spc-${{ matrix.operating-system }}.tar.gz" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: "Cache Composer dependencies"
|
- name: upload binaries to release
|
||||||
uses: "actions/cache@v5"
|
|
||||||
with:
|
|
||||||
path: "${{ steps.composer-cache.outputs.dir }}"
|
|
||||||
key: "php-${{ env.PHP_VERSION }}-locked-composer-${{ hashFiles('**/composer.lock') }}"
|
|
||||||
restore-keys: |
|
|
||||||
php-${{ env.PHP_VERSION }}-locked-composer
|
|
||||||
|
|
||||||
- name: "Install Locked Dependencies"
|
|
||||||
run: "composer install --no-interaction --no-progress"
|
|
||||||
|
|
||||||
- name: "Build PHAR File"
|
|
||||||
run: "composer build:phar"
|
|
||||||
|
|
||||||
- name: "Download Minimal Combination"
|
|
||||||
run: |
|
|
||||||
if [ "${{ matrix.operating-system.name }}" = "windows-x64" ]; then
|
|
||||||
curl -fsSL https://dl.static-php.dev/static-php-cli/windows/spc-min/php-${{ env.MICRO_VERSION }}-micro-win.zip -o tmp.zip
|
|
||||||
unzip tmp.zip
|
|
||||||
else
|
|
||||||
curl -fsSL https://dl.static-php.dev/static-php-cli/minimal/php-${{ env.MICRO_VERSION }}-micro-${{ matrix.operating-system.name }}.tar.gz -o tmp.tgz
|
|
||||||
tar -zxvf tmp.tgz
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: "Generate Executable"
|
|
||||||
run: |
|
|
||||||
bin/spc micro:combine spc.phar -M micro.sfx -O spc -I "memory_limit=2G"
|
|
||||||
if [ "${{ matrix.operating-system.name }}" = "windows-x64" ]; then
|
|
||||||
mv spc spc.exe
|
|
||||||
else
|
|
||||||
chmod +x spc
|
|
||||||
fi
|
|
||||||
if [ "${{ matrix.operating-system.name }}" = "macos-aarch64" ] || [ "${{ matrix.operating-system.name }}" = "macos-x86_64" ]; then
|
|
||||||
sudo xattr -cr ./spc
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: "Archive Executable and Validate Binary"
|
|
||||||
run: |
|
|
||||||
if [ "${{ matrix.operating-system.name }}" != "windows-x64" ]; then
|
|
||||||
tar -czf ${{ matrix.operating-system.filename }} spc
|
|
||||||
# validate spc binary
|
|
||||||
if [ "${{ matrix.operating-system.name }}" == "linux-x86_64" ]; then
|
|
||||||
./spc dev:info php
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: "Generate build provenance attestation"
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: actions/attest-build-provenance@v4
|
|
||||||
with:
|
|
||||||
subject-path: "${{ github.workspace }}/${{ matrix.operating-system.name == 'windows-x64' && 'spc.exe' || 'spc' }}"
|
|
||||||
|
|
||||||
- name: "Copy file"
|
|
||||||
run: |
|
|
||||||
if [ "${{ matrix.operating-system.name }}" != "windows-x64" ]; then
|
|
||||||
mkdir dist/ && cp ${{ matrix.operating-system.filename }} dist/ && cp spc dist/spc-${{ matrix.operating-system.name }}
|
|
||||||
else
|
|
||||||
mkdir dist/ && cp spc.exe dist/${{ matrix.operating-system.filename }}
|
|
||||||
echo "SUFFIX=.exe" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: "Upload Binaries to Release"
|
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: ${{startsWith(github.ref, 'refs/tags/') }}
|
if: ${{startsWith(github.ref, 'refs/tags/') }}
|
||||||
with:
|
with:
|
||||||
files: dist/${{ matrix.operating-system.filename }}
|
files: ${{ env.filename }}
|
||||||
|
|
||||||
- name: "Deploy to self-hosted OSS (nightly)"
|
|
||||||
# only run this step if the repository is static-php-cli and is push to v3 branch
|
|
||||||
if: ${{ github.repository == 'crazywhalecc/static-php-cli' && github.ref == 'refs/heads/v3' }}
|
|
||||||
uses: static-php/upload-s3-action@v1.0.0
|
|
||||||
with:
|
|
||||||
aws_key_id: ${{ secrets.AWS_KEY_ID }}
|
|
||||||
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
aws_bucket: ${{ secrets.AWS_BUCKET }}
|
|
||||||
source_dir: "dist/"
|
|
||||||
destination_dir: v3/spc-bin/nightly/
|
|
||||||
endpoint: ${{ secrets.AWS_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: "Deploy to self-hosted OSS (latest)"
|
|
||||||
# only run this step if the repository is static-php-cli and is release tag
|
|
||||||
if: ${{ github.repository == 'crazywhalecc/static-php-cli' && startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
uses: static-php/upload-s3-action@v1.0.0
|
|
||||||
with:
|
|
||||||
aws_key_id: ${{ secrets.AWS_KEY_ID }}
|
|
||||||
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
aws_bucket: ${{ secrets.AWS_BUCKET }}
|
|
||||||
source_dir: "dist/"
|
|
||||||
destination_dir: v3/spc-bin/latest/
|
|
||||||
endpoint: ${{ secrets.AWS_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: "Deploy to self-hosted OSS (versioned)"
|
|
||||||
# only run this step if the repository is static-php-cli and is release tag
|
|
||||||
if: ${{ github.repository == 'crazywhalecc/static-php-cli' && startsWith(github.ref, 'refs/tags/') }}
|
|
||||||
uses: static-php/upload-s3-action@v1.0.0
|
|
||||||
with:
|
|
||||||
aws_key_id: ${{ secrets.AWS_KEY_ID }}
|
|
||||||
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
aws_bucket: ${{ secrets.AWS_BUCKET }}
|
|
||||||
source_dir: "dist/"
|
|
||||||
destination_dir: v3/spc-bin/${{ github.ref_name }}/
|
|
||||||
endpoint: ${{ secrets.AWS_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: "Upload Artifact"
|
- name: "Upload Artifact"
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: spc${{ env.SUFFIX }}
|
path: spc
|
||||||
name: spc-${{ matrix.operating-system.name }}${{ env.SUFFIX }}
|
name: spc-${{ matrix.operating-system }}
|
||||||
test-spc:
|
|
||||||
name: "Test SPC Binary for ${{ matrix.operating-system.name }}"
|
|
||||||
runs-on: ${{ matrix.operating-system.os }}
|
|
||||||
needs: [build-release-artifacts]
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
operating-system:
|
|
||||||
- name: "linux-x86_64"
|
|
||||||
os: "ubuntu-latest"
|
|
||||||
- name: "macos-x86_64"
|
|
||||||
os: "macos-15-intel"
|
|
||||||
- name: "linux-aarch64"
|
|
||||||
os: "ubuntu-24.04-arm"
|
|
||||||
- name: "macos-aarch64"
|
|
||||||
os: "macos-15"
|
|
||||||
- name: "windows-x64"
|
|
||||||
os: "windows-latest"
|
|
||||||
steps:
|
|
||||||
- name: "Checkout"
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: "Download Artifact"
|
|
||||||
uses: actions/download-artifact@v5
|
|
||||||
env:
|
|
||||||
SUFFIX: ${{ matrix.operating-system.name == 'windows-x64' && '.exe' || '' }}
|
|
||||||
with:
|
|
||||||
name: spc-${{ matrix.operating-system.name }}${{ env.SUFFIX }}
|
|
||||||
|
|
||||||
- name: "Chmod"
|
|
||||||
if: matrix.operating-system.name != 'windows-x64'
|
|
||||||
run: chmod +x spc
|
|
||||||
|
|
||||||
- name: "Run SPC Tests"
|
|
||||||
env:
|
|
||||||
SUFFIX: ${{ matrix.operating-system.name == 'windows-x64' && '.exe' || '' }}
|
|
||||||
run: ./spc${{ env.SUFFIX }} dev:info php
|
|
||||||
|
|||||||
226
.github/workflows/tests.yml
vendored
226
.github/workflows/tests.yml
vendored
@@ -1,26 +1,13 @@
|
|||||||
name: v3 Tests
|
name: Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "v3" ]
|
branches: [ "main" ]
|
||||||
types: [ opened, synchronize, reopened, labeled, unlabeled ]
|
|
||||||
paths:
|
|
||||||
- 'src/**'
|
|
||||||
- 'config/**'
|
|
||||||
- '.github/workflows/tests.yml'
|
|
||||||
- 'bin/**'
|
|
||||||
- 'composer.json'
|
|
||||||
- 'box.json'
|
|
||||||
- '.php-cs-fixer.php'
|
|
||||||
|
|
||||||
permissions: read-all
|
permissions:
|
||||||
|
contents: read
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
php-cs-fixer:
|
php-cs-fixer:
|
||||||
@@ -33,7 +20,7 @@ jobs:
|
|||||||
- name: "Setup PHP"
|
- name: "Setup PHP"
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.4'
|
php-version: '8.1'
|
||||||
extensions: curl, openssl, mbstring
|
extensions: curl, openssl, mbstring
|
||||||
ini-values: memory_limit=-1
|
ini-values: memory_limit=-1
|
||||||
tools: pecl, composer, php-cs-fixer
|
tools: pecl, composer, php-cs-fixer
|
||||||
@@ -51,16 +38,14 @@ jobs:
|
|||||||
- name: "Setup PHP"
|
- name: "Setup PHP"
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.4'
|
php-version: '8.1'
|
||||||
extensions: curl, openssl, mbstring
|
extensions: curl, openssl, mbstring
|
||||||
ini-values: memory_limit=-1
|
ini-values: memory_limit=-1
|
||||||
tools: composer
|
tools: composer
|
||||||
env:
|
|
||||||
phpts: zts
|
|
||||||
|
|
||||||
- name: "Cache Composer packages"
|
- name: "Cache Composer packages"
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: vendor
|
path: vendor
|
||||||
key: ${{ runner.os }}-phpstan-${{ hashFiles('**/composer.lock') }}
|
key: ${{ runner.os }}-phpstan-${{ hashFiles('**/composer.lock') }}
|
||||||
@@ -80,7 +65,9 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- php: '8.4'
|
- php: '8.1'
|
||||||
|
- php: '8.2'
|
||||||
|
- php: '8.3'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
@@ -96,175 +83,64 @@ jobs:
|
|||||||
|
|
||||||
- name: "Cache Composer packages"
|
- name: "Cache Composer packages"
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: vendor
|
path: vendor
|
||||||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-php
|
${{ runner.os }}-php-
|
||||||
|
|
||||||
- name: "Install Dependencies"
|
- name: "Install Dependencies"
|
||||||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
||||||
|
|
||||||
- name: "Run PHPUnit Tests"
|
- name: "Run PHPUnit Tests"
|
||||||
run: vendor/bin/phpunit tests/ --no-coverage
|
|
||||||
|
|
||||||
check-gate:
|
|
||||||
name: "Check: need-test label"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
enabled: ${{ steps.gate.outputs.enabled }}
|
|
||||||
steps:
|
|
||||||
- name: Check label
|
|
||||||
id: gate
|
|
||||||
run: |
|
run: |
|
||||||
LABELS='${{ toJSON(github.event.pull_request.labels.*.name) }}'
|
vendor/bin/phpunit tests/ --no-coverage
|
||||||
if echo "$LABELS" | grep -q '"need-test"'; then
|
|
||||||
echo "enabled=true" >> "$GITHUB_OUTPUT"
|
|
||||||
else
|
|
||||||
echo "enabled=false" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
test-bot:
|
build:
|
||||||
name: "Test Bot: analyze PR"
|
name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})"
|
||||||
needs: check-gate
|
runs-on: ${{ matrix.os }}
|
||||||
if: needs.check-gate.outputs.enabled == 'true'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
outputs:
|
|
||||||
need_test: ${{ steps.bot.outputs.need_test }}
|
|
||||||
gen_matrix_args: ${{ steps.bot.outputs.gen_matrix_args }}
|
|
||||||
gen_matrix_args_tier2: ${{ steps.bot.outputs.gen_matrix_args_tier2 }}
|
|
||||||
php_versions: ${{ steps.bot.outputs.php_versions }}
|
|
||||||
tier2: ${{ steps.bot.outputs.tier2 }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: '8.4'
|
|
||||||
extensions: curl, openssl, mbstring
|
|
||||||
ini-values: memory_limit=-1
|
|
||||||
tools: composer
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-dev
|
|
||||||
|
|
||||||
- name: Run dev:test-bot
|
|
||||||
id: bot
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
BOT_JSON=$(php -d opcache.enable_cli=0 bin/spc dev:test-bot \
|
|
||||||
--pr=${{ github.event.pull_request.number }} \
|
|
||||||
--repo=${{ github.repository }} 2>/dev/null)
|
|
||||||
|
|
||||||
echo "need_test=$(echo "$BOT_JSON" | jq -r '.need_test')" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "gen_matrix_args=$(echo "$BOT_JSON" | jq -r '.gen_matrix_args')" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "gen_matrix_args_tier2=$(echo "$BOT_JSON" | jq -r '.gen_matrix_args_tier2')" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "php_versions=$(echo "$BOT_JSON" | jq -c '.php_versions')" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "tier2=$(echo "$BOT_JSON" | jq -r '.tier2')" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
# Save JSON for the comment-posting workflow
|
|
||||||
jq -n --argjson bot "$BOT_JSON" \
|
|
||||||
--arg pr '${{ github.event.pull_request.number }}' \
|
|
||||||
'$bot + {pr_number: $pr}' > bot-output.json
|
|
||||||
|
|
||||||
- name: Upload bot output
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: bot-output
|
|
||||||
path: bot-output.json
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
gen-matrix:
|
|
||||||
name: "Generate test matrix"
|
|
||||||
needs: test-bot
|
|
||||||
if: needs.test-bot.outputs.need_test == 'true'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
matrix: ${{ steps.build.outputs.matrix }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: '8.4'
|
|
||||||
extensions: curl, openssl, mbstring
|
|
||||||
ini-values: memory_limit=-1
|
|
||||||
tools: composer
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-dev
|
|
||||||
|
|
||||||
- name: Build matrix
|
|
||||||
id: build
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GEN_MATRIX_ARGS: ${{ needs.test-bot.outputs.gen_matrix_args }}
|
|
||||||
GEN_MATRIX_ARGS_TIER2: ${{ needs.test-bot.outputs.gen_matrix_args_tier2 }}
|
|
||||||
PHP_VERSIONS: ${{ needs.test-bot.outputs.php_versions }}
|
|
||||||
TIER2: ${{ needs.test-bot.outputs.tier2 }}
|
|
||||||
run: |
|
|
||||||
# Tier1 matrix
|
|
||||||
MATRIX1=$(bin/spc dev:gen-ext-test-matrix $GEN_MATRIX_ARGS 2>/dev/null)
|
|
||||||
|
|
||||||
# Merge Tier2 if requested
|
|
||||||
if [ "$TIER2" = "true" ] && [ -n "$GEN_MATRIX_ARGS_TIER2" ]; then
|
|
||||||
MATRIX2=$(bin/spc dev:gen-ext-test-matrix $GEN_MATRIX_ARGS_TIER2 2>/dev/null)
|
|
||||||
COMBINED=$(jq -n --argjson m1 "$MATRIX1" --argjson m2 "$MATRIX2" '$m1 + $m2')
|
|
||||||
else
|
|
||||||
COMBINED=$MATRIX1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expand PHP versions: cartesian product of entries × php_versions
|
|
||||||
FINAL=$(echo "$COMBINED" | jq --argjson versions "$PHP_VERSIONS" \
|
|
||||||
'[.[] | . as $entry | $versions[] | $entry + {"php-version": .}]')
|
|
||||||
|
|
||||||
echo "matrix=$(echo "$FINAL" | jq -c '{"combo": .}')" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
ext-test:
|
|
||||||
name: "Ext test: ${{ matrix.combo.extension }} [${{ matrix.combo.sapi }}] (PHP ${{ matrix.combo.php-version }} - ${{ matrix.combo.os }}-${{ matrix.combo.arch }})"
|
|
||||||
needs: gen-matrix
|
|
||||||
runs-on: ${{ matrix.combo.runner }}
|
|
||||||
timeout-minutes: 120
|
timeout-minutes: 120
|
||||||
strategy:
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php:
|
||||||
|
- "8.0"
|
||||||
|
- "8.1"
|
||||||
|
- "8.2"
|
||||||
|
- "8.3"
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- macos-latest
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix: ${{ fromJSON(needs.gen-matrix.outputs.matrix) }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: "Checkout"
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: "Setup PHP"
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: 8.4
|
php-version: 8.2
|
||||||
|
tools: pecl, composer
|
||||||
extensions: curl, openssl, mbstring
|
extensions: curl, openssl, mbstring
|
||||||
ini-values: memory_limit=-1
|
ini-values: memory_limit=-1
|
||||||
tools: composer
|
|
||||||
env:
|
|
||||||
phpts: nts
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: "Cache Composer packages"
|
||||||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-dev
|
id: composer-cache
|
||||||
|
uses: actions/cache@v3
|
||||||
- name: Build
|
|
||||||
env:
|
|
||||||
SPC_USE_SUDO: "yes"
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
./bin/spc doctor --auto-fix
|
|
||||||
${{ matrix.combo.build-args }} --dl-with-php=${{ matrix.combo.php-version }}
|
|
||||||
|
|
||||||
# - name: Setup upterm session
|
|
||||||
# if: ${{ failure() }}
|
|
||||||
# uses: owenthereal/action-upterm@v1
|
|
||||||
|
|
||||||
- name: Upload logs
|
|
||||||
if: always() && hashFiles('log/**') != ''
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: logs-${{ matrix.combo.os }}-${{ matrix.combo.arch }}-${{ matrix.combo.sapi }}-${{ matrix.combo.extension }}-php${{ matrix.combo.php-version }}
|
path: vendor
|
||||||
path: log
|
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-php-
|
||||||
|
|
||||||
|
- name: "Install Dependencies"
|
||||||
|
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
||||||
|
|
||||||
|
- name: "Run Build Tests (doctor)"
|
||||||
|
run: bin/spc doctor --auto-fix
|
||||||
|
|
||||||
|
- name: "Run Build Tests (download)"
|
||||||
|
run: bin/spc download --for-extensions="$(php src/globals/test-extensions.php)" --with-php=${{ matrix.php }} --debug
|
||||||
|
|
||||||
|
- name: "Run Build Tests (build)"
|
||||||
|
run: bin/spc build "$(php src/globals/test-extensions.php)" --build-cli --build-micro --build-fpm --debug
|
||||||
|
|||||||
73
.github/workflows/vitepress-deploy.yml
vendored
73
.github/workflows/vitepress-deploy.yml
vendored
@@ -1,73 +0,0 @@
|
|||||||
name: Docs build test and auto deploy
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [ "v3" ]
|
|
||||||
types: [ opened, synchronize, reopened ]
|
|
||||||
paths:
|
|
||||||
- 'config/**.yml'
|
|
||||||
- 'docs/**'
|
|
||||||
- 'package.json'
|
|
||||||
- 'yarn.lock'
|
|
||||||
- '.github/workflows/vitepress-deploy.yml'
|
|
||||||
push:
|
|
||||||
branches: [ "v3" ]
|
|
||||||
paths:
|
|
||||||
- 'config/**.yml'
|
|
||||||
- 'docs/**'
|
|
||||||
- 'package.json'
|
|
||||||
- 'yarn.lock'
|
|
||||||
- '.github/workflows/vitepress-deploy.yml'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Deploy docs
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'crazywhalecc/static-php-cli'
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 22
|
|
||||||
cache: yarn
|
|
||||||
|
|
||||||
- name: Install documentation dependencies
|
|
||||||
run: yarn install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: "Install PHP for official runners"
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
coverage: none
|
|
||||||
tools: composer:v2
|
|
||||||
php-version: 8.4
|
|
||||||
ini-values: memory_limit=-1
|
|
||||||
extensions: curl, openssl, mbstring
|
|
||||||
|
|
||||||
- name: "Get Composer Cache Directory"
|
|
||||||
id: composer-cache
|
|
||||||
run: |
|
|
||||||
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: "Cache Composer dependencies"
|
|
||||||
uses: "actions/cache@v4"
|
|
||||||
with:
|
|
||||||
path: "${{ steps.composer-cache.outputs.dir }}"
|
|
||||||
key: "php-8.2-locked-composer-${{ hashFiles('**/composer.lock') }}"
|
|
||||||
restore-keys: |
|
|
||||||
php-8.2-locked-composer
|
|
||||||
|
|
||||||
- name: "Install Locked Dependencies"
|
|
||||||
run: "composer install --no-interaction --no-progress"
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: yarn docs:build
|
|
||||||
|
|
||||||
# Deploy to GitHub Pages only when the workflow is triggered by a push to the v3 branch
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/v3'
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_dir: docs/.vitepress/dist
|
|
||||||
67
.gitignore
vendored
67
.gitignore
vendored
@@ -1,75 +1,30 @@
|
|||||||
.idea
|
.idea
|
||||||
/runtime/
|
runtime/
|
||||||
/docker/libraries/
|
docker/libraries/
|
||||||
/docker/extensions/
|
docker/extensions/
|
||||||
/docker/source/
|
docker/source/
|
||||||
|
|
||||||
# Vendor files
|
# Vendor files
|
||||||
/vendor/**
|
/vendor/
|
||||||
|
|
||||||
# default source extract directory
|
# default source extract directory
|
||||||
/source/**
|
/source/
|
||||||
|
|
||||||
# built by shared embed tests
|
|
||||||
/locale/
|
|
||||||
|
|
||||||
# default source download directory
|
# default source download directory
|
||||||
/downloads/**
|
/downloads/
|
||||||
|
|
||||||
# default source build root directory
|
# default source build root directory
|
||||||
/buildroot/**
|
/buildroot/
|
||||||
|
|
||||||
# default package root directory
|
|
||||||
/pkgroot/**
|
|
||||||
|
|
||||||
# Windows PHP SDK binary tools
|
|
||||||
/php-sdk-binary-tools/**
|
|
||||||
|
|
||||||
# default pack:lib and release directory
|
|
||||||
/dist/**
|
|
||||||
packlib_files.txt
|
|
||||||
|
|
||||||
# tools cache files
|
# tools cache files
|
||||||
.php-cs-fixer.cache
|
.php-cs-fixer.cache
|
||||||
.phpunit.result.cache
|
.phpunit.result.cache
|
||||||
|
|
||||||
# doctor cache fallback (when ~/.cache/spc/ is not writable)
|
|
||||||
.spc-doctor.lock
|
|
||||||
|
|
||||||
# exclude self-runtime
|
# exclude self-runtime
|
||||||
/bin/*
|
/bin/*
|
||||||
!/bin/spc*
|
!/bin/spc
|
||||||
!/bin/setup-runtime*
|
!/bin/setup-runtime
|
||||||
!/bin/docker-entrypoint.sh
|
!/bin/spc-alpine-docker
|
||||||
|
|
||||||
# exclude windows build tools
|
|
||||||
/php-sdk-binary-tools/
|
|
||||||
|
|
||||||
# default test directory
|
# default test directory
|
||||||
/tests/var/
|
/tests/var/
|
||||||
|
|
||||||
# VitePress
|
|
||||||
/node_modules/
|
|
||||||
/docs/.vitepress/dist/
|
|
||||||
/docs/.vitepress/cache/
|
|
||||||
/docs/.vitepress/.temp/
|
|
||||||
/docs/.vitepress/ext-data.json
|
|
||||||
/docs/.vitepress/deps-data.json
|
|
||||||
package-lock.json
|
|
||||||
pnpm-lock.yaml
|
|
||||||
|
|
||||||
# craft
|
|
||||||
craft.yml
|
|
||||||
|
|
||||||
# SPC logs
|
|
||||||
log/
|
|
||||||
|
|
||||||
# spc.phar
|
|
||||||
spc.phar
|
|
||||||
spc.exe
|
|
||||||
|
|
||||||
# dumped files from StaticPHP v3
|
|
||||||
/dump-*.json
|
|
||||||
|
|
||||||
# config parse cache
|
|
||||||
/.spc.cache.php
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
return (new PhpCsFixer\Config())
|
return (new PhpCsFixer\Config())
|
||||||
->setRiskyAllowed(true)
|
->setRiskyAllowed(true)
|
||||||
->setUnsupportedPhpVersionAllowed(true)
|
|
||||||
->setRules([
|
->setRules([
|
||||||
'@PSR12' => true,
|
'@PSR12' => true,
|
||||||
'@Symfony' => true,
|
'@Symfony' => true,
|
||||||
@@ -64,11 +63,7 @@ return (new PhpCsFixer\Config())
|
|||||||
'phpdoc_summary' => false,
|
'phpdoc_summary' => false,
|
||||||
'php_unit_test_class_requires_covers' => false,
|
'php_unit_test_class_requires_covers' => false,
|
||||||
'phpdoc_var_without_name' => false,
|
'phpdoc_var_without_name' => false,
|
||||||
'fully_qualified_strict_types' => false,
|
|
||||||
'operator_linebreak' => false,
|
|
||||||
'php_unit_data_provider_method_order' => false,
|
|
||||||
])
|
])
|
||||||
->setFinder(
|
->setFinder(
|
||||||
PhpCsFixer\Finder::create()->in([__DIR__ . '/src', __DIR__ . '/tests/StaticPHP'])
|
PhpCsFixer\Finder::create()->in([__DIR__ . '/src', __DIR__ . '/tests/SPC'])
|
||||||
)
|
);
|
||||||
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect());
|
|
||||||
|
|||||||
60
AGENTS.md
60
AGENTS.md
@@ -1,60 +0,0 @@
|
|||||||
# StaticPHP v3 Agent Guide
|
|
||||||
|
|
||||||
StaticPHP is a PHP CLI application for building static PHP binaries, PHP SAPIs, extensions, libraries, helper tools, and project bundles. Prefer the v3 architecture under `src/StaticPHP`, `src/Package`, `config/pkg`, and `config/artifact`.
|
|
||||||
|
|
||||||
This file is the shared entry point for coding agents such as Codex, OpenCode, Claude-compatible agents, and GitHub Copilot agents. GitHub Copilot also has `.github/copilot-instructions.md`.
|
|
||||||
|
|
||||||
## Skills
|
|
||||||
|
|
||||||
Detailed task workflows live in `.github/skills`. Use them when the task matches:
|
|
||||||
|
|
||||||
- `.github/skills/staticphp-package-maintenance`: add, modify, review, or validate package, artifact, extension, library, target, or tool definitions.
|
|
||||||
- `.github/skills/staticphp-build-troubleshooting`: diagnose build, download, doctor, shell, terminal, CI, smoke-test, or log failures.
|
|
||||||
- `.github/skills/staticphp-documentation-sync`: synchronize bilingual documentation (`docs/en/` and `docs/zh/`) when features, commands, configuration, APIs, or behavior change.
|
|
||||||
|
|
||||||
If your agent does not automatically discover skills from `.github/skills`, read the matching `SKILL.md` manually before working on that task.
|
|
||||||
|
|
||||||
## Project Map
|
|
||||||
|
|
||||||
- `bin/spc`: primary CLI entrypoint.
|
|
||||||
- `composer.json`: PHP 8.4+, Symfony Console, DI, YAML, logger; useful scripts are `composer test`, `composer analyse`, `composer lint-config`, and `composer cs-fix`.
|
|
||||||
- `spc.registry.yml`: built-in `core` registry.
|
|
||||||
- `config/pkg/ext`: PHP extension package YAML, usually named `ext-*.yml`.
|
|
||||||
- `config/pkg/lib`: library package YAML.
|
|
||||||
- `config/pkg/target`: final build target and virtual target YAML.
|
|
||||||
- `config/pkg/tool`: helper tool package YAML.
|
|
||||||
- `config/artifact`: standalone artifact YAML for shared or complex sources/binaries.
|
|
||||||
- `log/`: build and shell execution logs (`spc.output.log`, `spc.shell.log`, and per-package CMake/config logs); controlled by `SPC_LOGS_DIR` and `SPC_ENABLE_LOG_FILE`.
|
|
||||||
- `src/StaticPHP`: framework core: registry loading, config validation, dependency resolution, package install/build pipeline, doctor, toolchains, runtime shell/executors, exceptions.
|
|
||||||
- `src/Package`: package-specific build logic registered by PHP attributes.
|
|
||||||
- `src/globals`: constants, helper functions, patches, smoke tests, bundled license text.
|
|
||||||
- `tests`: PHPUnit tests for config, registry, artifacts, dependency resolver, DI, commands, and utilities.
|
|
||||||
- `docs/en/develop` and `docs/zh/develop`: developer documentation. Some pages may be TODO; verify against source when behavior matters.
|
|
||||||
|
|
||||||
## Working Rules
|
|
||||||
|
|
||||||
- Keep changes scoped to the requested package, artifact, command, docs, or tests.
|
|
||||||
- Prefer existing package patterns over new abstractions. Search for a similar package first.
|
|
||||||
- Use structured YAML config; do not encode dependency logic in PHP when config fields are enough.
|
|
||||||
- Match package names exactly: extension packages use `ext-` in config and dependencies; `#[Extension('curl')]` expands to `ext-curl`.
|
|
||||||
- Use platform suffixes such as `@unix`, `@linux`, `@macos`, and `@windows` instead of runtime conditionals when the difference is declarative.
|
|
||||||
- Add or update PHP package classes only when build commands, validation, custom configure args, hooks, or source patching are required.
|
|
||||||
- Do not edit generated build directories (`buildroot/`, `source/`, `downloads/`, `pkgroot/`) as a fix.
|
|
||||||
|
|
||||||
## Validation
|
|
||||||
|
|
||||||
For config or package changes, run CS checks first:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
bin/spc dev:lint-config
|
|
||||||
composer cs-fix
|
|
||||||
```
|
|
||||||
|
|
||||||
For broader PHP code changes, also run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
composer test
|
|
||||||
composer analyse
|
|
||||||
```
|
|
||||||
|
|
||||||
Use build commands only when needed for the task or when the user provided a repro, because full static builds can be slow and platform-sensitive.
|
|
||||||
3
README-en.md
Executable file
3
README-en.md
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
# static-php-cli
|
||||||
|
|
||||||
|
English README has been moved to [README.md](README.md).
|
||||||
340
README-zh.md
340
README-zh.md
@@ -1,156 +1,254 @@
|
|||||||
# StaticPHP
|
# static-php-cli
|
||||||
|
|
||||||
[](README-zh.md)
|
Build single static PHP binary, with PHP project together, with popular extensions included.
|
||||||
[](README.md)
|
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/releases)
|
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
|
|
||||||
[](https://discord.gg/xf6Rd4pEAk)
|
|
||||||
|
|
||||||
**StaticPHP** 是一个强大的工具,用于构建可移植的可执行文件,包括 PHP、扩展等。
|
🌐 **[中文](README-zh.md)** | **[English](README.md)**
|
||||||
|
|
||||||
> [!IMPORTANT]
|
编译纯静态的 PHP Binary 二进制文件,带有各种扩展,让 PHP-cli 应用变得更便携!(cli SAPI)
|
||||||
> 我们正准备发布 **v3** 版本,届时项目名称将从 **static-php-cli** 更改为 **StaticPHP**。
|
|
||||||
> 此分支对应 v3 版本。v2 版本请查看 [v2 分支](https://github.com/crazywhalecc/static-php-cli/tree/main)。
|
|
||||||
> 请更新您的参考资料,并关注正式版发布。
|
|
||||||
|
|
||||||
## 特性
|
<img width="600" alt="截屏2023-05-02 15 53 13" src="https://user-images.githubusercontent.com/20330940/235610282-23e58d68-bd35-4092-8465-171cff2d5ba8.png">
|
||||||
|
|
||||||
- :elephant: 支持多个 PHP 版本 - PHP 8.1, 8.2, 8.3, 8.4, 8.5
|
同时可以使用 micro 二进制文件,将 PHP 源码和 PHP 二进制构建为一个文件分发!(micro SAPI)
|
||||||
- :handbag: 构建零依赖的单文件 PHP 可执行程序
|
|
||||||
- :hamburger: 构建 **[phpmicro](https://github.com/static-php/phpmicro)** 自解压可执行文件(将 PHP 二进制和源码合并为单个文件)
|
|
||||||
- :pill: 自动构建环境检查器,支持自动修复
|
|
||||||
- :zap: 支持 `Linux`、`macOS`、`Windows`
|
|
||||||
- :wrench: 通过 vendor 模式和自定义注册表实现便捷扩展
|
|
||||||
- :books: 智能依赖管理
|
|
||||||
- 📦 自包含 `spc` 可执行文件,便于自安装
|
|
||||||
- :fire: 支持 100+ 热门 [PHP 扩展](https://static-php.dev/en/guide/extensions.html)
|
|
||||||
- :floppy_disk: 支持 UPX 压缩(二进制体积可缩小 30-50%)
|
|
||||||
|
|
||||||
**单文件独立 php-cli:**
|
<img width="600" alt="截屏2023-05-02 15 52 33" src="https://user-images.githubusercontent.com/20330940/235610318-2ef4e3f1-278b-4ca4-99f4-b38120efc395.png">
|
||||||
|
|
||||||
<img width="700" alt="out1" src="https://github.com/crazywhalecc/static-php-cli/assets/20330940/01a2e60f-13b0-4242-a645-f7afa4936396">
|
> 该 SAPI 源自 [dixyes/phpmicro](https://github.com/dixyes/phpmicro) 的 [Fork 仓库](https://github.com/static-php/phpmicro)。
|
||||||
|
|
||||||
**使用 phpmicro 将 PHP 代码与 PHP 解释器结合:**
|
[]()
|
||||||
|
[]()
|
||||||
|
[](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-common.yml)
|
||||||
|
[]()
|
||||||
|
[]()
|
||||||
|
|
||||||
<img width="700" alt="out2" src="https://github.com/crazywhalecc/static-php-cli/assets/20330940/46b7128d-fb72-4169-957e-48564c3ff3e2">
|
> 项目名称是 static-php-cli,但其实支持 cli、fpm、micro 和 embed SAPI 😎
|
||||||
|
|
||||||
## 快速开始
|
|
||||||
|
|
||||||
### 1. 下载 spc 二进制
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# For Linux x86_64
|
|
||||||
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/nightly/spc-linux-x86_64
|
|
||||||
# For Linux aarch64
|
|
||||||
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/nightly/spc-linux-aarch64
|
|
||||||
# macOS x86_64 (Intel)
|
|
||||||
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/nightly/spc-macos-x86_64
|
|
||||||
# macOS aarch64 (Apple)
|
|
||||||
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/nightly/spc-macos-aarch64
|
|
||||||
# Windows (x86_64, win10 build 17063 or later, please install VS2022 first)
|
|
||||||
curl.exe -fsSL -o spc.exe https://dl.static-php.dev/v3/spc-bin/nightly/spc-windows-x64.exe
|
|
||||||
```
|
|
||||||
|
|
||||||
对于 macOS 和 Linux,请先添加可执行权限:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
chmod +x ./spc
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. 构建静态 PHP
|
|
||||||
|
|
||||||
首先,创建 `craft.yml` 文件,并从 [扩展列表](https://static-php.dev/en/guide/extensions.html) 或 [命令生成器](https://static-php.dev/en/guide/cli-generator.html) 指定要包含的扩展:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
# PHP version support: 8.1, 8.2, 8.3, 8.4, 8.5
|
|
||||||
php-version: 8.5
|
|
||||||
# Put your extension list here
|
|
||||||
extensions: "apcu,bcmath,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,gd,iconv,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,readline,redis,session,simplexml,sockets,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib"
|
|
||||||
sapi:
|
|
||||||
- cli
|
|
||||||
- micro
|
|
||||||
download-options:
|
|
||||||
parallel: 10
|
|
||||||
```
|
|
||||||
|
|
||||||
运行命令:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./spc craft
|
|
||||||
|
|
||||||
# 输出完整控制台日志
|
|
||||||
./spc craft -vvv
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. 静态 PHP 使用
|
|
||||||
|
|
||||||
现在你可以将 StaticPHP 构建的二进制复制到另一台机器并在无依赖环境下运行:
|
|
||||||
|
|
||||||
```
|
|
||||||
# php-cli
|
|
||||||
buildroot/bin/php -v
|
|
||||||
|
|
||||||
# phpmicro
|
|
||||||
echo '<?php echo "Hello world!\n";' > a.php
|
|
||||||
./spc micro:combine a.php -O my-app
|
|
||||||
./my-app
|
|
||||||
```
|
|
||||||
|
|
||||||
## 文档
|
## 文档
|
||||||
|
|
||||||
当前 README 包含基础用法。有关 StaticPHP 的完整功能集,
|
目前 README 编写了基本用法。有关 static-php-cli 所有的功能,请点击这里查看文档:<https://static-php.dev>。
|
||||||
请访问 <https://static-php.dev>。
|
|
||||||
|
|
||||||
## 直接下载
|
## 自托管直接下载
|
||||||
|
|
||||||
如果你暂时不想构建,或只想先测试,可以从 [Actions](https://github.com/static-php/hosted/actions/workflows/build-php-bulk.yml) 下载示例预编译产物,或从自托管服务器下载。
|
如果你不想自行编译 PHP,可以从本项目现有的示例 Action 下载 Artifact,也可以从自托管的服务器下载。
|
||||||
|
|
||||||
我们为每个 PHP 版本提供 2 种扩展集合:
|
- [扩展组合 - common](https://dl.static-php.dev/static-php-cli/common/):common 组合包含了约 [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) 个常用扩展,体积为 22MB 左右。
|
||||||
|
- [扩展组合 - bulk](https://dl.static-php.dev/static-php-cli/bulk/):bulk 组合包含了 [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) 个扩展,体积为 70MB 左右。
|
||||||
|
- [扩展组合 - minimal](https://dl.static-php.dev/static-php-cli/minimal/):minimal 组合包含了 [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) 个扩展,体积为 6MB 左右。
|
||||||
|
|
||||||
- **gigantic**:尽可能包含更多扩展,二进制大小约 100-150MB。
|
## 使用 static-php-cli 构建 PHP
|
||||||
- **base**:仅包含 StaticPHP 自身使用的少量扩展,二进制大小约 10MB。
|
|
||||||
|
|
||||||
> WIP
|
### 编译环境需求
|
||||||
|
|
||||||
### 在线构建(使用 GitHub Actions)
|
是的,本项目采用 PHP 编写,编译前需要一个 PHP 环境,比较滑稽。
|
||||||
|
但本项目默认可通过自身构建的 micro 和 static-php 二进制运行,其他只需要包含 mbstring、pcntl 扩展和 PHP 版本大于等于 8.1 即可。
|
||||||
|
|
||||||
当上方直接下载的二进制无法满足你的需求时,
|
下面是架构支持情况,:octocat: 代表支持 GitHub Action 构建,:computer: 代表支持本地构建,空 代表暂不支持。
|
||||||
你可以使用 GitHub Actions 轻松构建静态编译的 PHP,
|
|
||||||
并同时自定义要编译的扩展列表。
|
|
||||||
|
|
||||||
1. Fork 此仓库。
|
| | x86_64 | aarch64 |
|
||||||
2. 进入项目的 Actions 并选择 `CI`。
|
|---------|----------------------|----------------------|
|
||||||
3. 选择 `Run workflow`,填写你要编译的 PHP 版本、目标类型和扩展列表。(扩展用逗号分隔,例如 `bcmath,curl,mbstring`)
|
| macOS | :octocat: :computer: | :computer: |
|
||||||
4. 等待工作流执行完成后,进入对应运行记录并下载 `Artifacts`。
|
| Linux | :octocat: :computer: | :octocat: :computer: |
|
||||||
|
| Windows | | |
|
||||||
|
| FreeBSD | :computer: | :computer: |
|
||||||
|
|
||||||
如果你启用 `debug`,构建时将输出所有日志,包括编译日志,便于排查问题。
|
> macOS-arm64 因 GitHub 暂未提供 arm runner,如果要构建 arm 二进制,可以使用手动构建。
|
||||||
|
|
||||||
> 我们也计划在未来提供可复用的 GitHub Actions 工作流,
|
目前支持编译的 PHP 版本为:`7.3`,`7.4`,`8.0`,`8.1`,`8.2`,`8.3`。
|
||||||
> 这样你无需 fork 本项目,也能在自己的仓库中轻松构建 static PHP。
|
|
||||||
|
### 支持的扩展情况
|
||||||
|
|
||||||
|
请先根据下方扩展列表选择你要编译的扩展。
|
||||||
|
|
||||||
|
- [扩展支持列表](https://static-php.dev/zh/guide/extensions.html)
|
||||||
|
- [编译命令生成器](https://static-php.dev/zh/guide/cli-generator.html)
|
||||||
|
|
||||||
|
> 如果这里没有你需要的扩展,可以提交 Issue。
|
||||||
|
|
||||||
|
### 使用 Actions 构建
|
||||||
|
|
||||||
|
使用 GitHub Action 可以方便地构建一个静态编译的 PHP,同时可以自行定义要编译的扩展。
|
||||||
|
|
||||||
|
1. Fork 本项目。
|
||||||
|
2. 进入项目的 Actions,选择 CI。
|
||||||
|
3. 选择 `Run workflow`,填入你要编译的 PHP 版本、目标类型、扩展列表。(扩展列表使用英文逗号分割,例如 `bcmath,curl,mbstring`)
|
||||||
|
4. 等待大约一段时间后,进入对应的任务中,获取 `Artifacts`。
|
||||||
|
|
||||||
|
如果你选择了 `debug`,则会在构建时输出所有日志,包括编译的日志,以供排查错误。
|
||||||
|
|
||||||
|
### 手动构建(使用 SPC 二进制)
|
||||||
|
|
||||||
|
本项目提供了一个 static-php-cli 的二进制文件,你可以直接下载对应平台的二进制文件,然后使用它来构建静态的 PHP。目前 `spc` 二进制支持的平台有 Linux 和 macOS。
|
||||||
|
|
||||||
|
下面是从 GitHub Action 下载的方法:
|
||||||
|
|
||||||
|
1. 进入 [GitHub Action](https://github.com/crazywhalecc/static-php-cli/actions/workflows/release-build.yml)。
|
||||||
|
2. 选择一个最新的构建任务,进入后选择 `Artifacts`,下载对应平台的二进制文件。
|
||||||
|
3. 解压 `.zip` 文件。解压后,为其添加执行权限:`chmod +x ./spc`。
|
||||||
|
|
||||||
|
你也可以从自托管的服务器下载二进制文件:[进入](https://dl.static-php.dev/static-php-cli/spc-bin/nightly/)。
|
||||||
|
|
||||||
|
### 手动构建(使用源码)
|
||||||
|
|
||||||
|
先克隆本项目:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/crazywhalecc/static-php-cli.git
|
||||||
|
```
|
||||||
|
|
||||||
|
如果你本机没有安装 PHP,你需要先使用包管理(例如 brew、apt、yum、apk 等)安装 php。
|
||||||
|
|
||||||
|
你也可以通过 `bin/setup-runtime` 命令下载静态编译好的 php-cli 和 Composer。下载的 php 和 Composer 将保存为 `bin/php` 和 `bin/composer`。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd static-php-cli
|
||||||
|
chmod +x bin/setup-runtime
|
||||||
|
./bin/setup-runtime
|
||||||
|
|
||||||
|
# 使用独立的 php 运行 static-php-cli
|
||||||
|
./bin/php bin/spc
|
||||||
|
|
||||||
|
# 使用 composer
|
||||||
|
./bin/php bin/composer
|
||||||
|
|
||||||
|
# 初始化本项目
|
||||||
|
cd static-php-cli
|
||||||
|
composer update
|
||||||
|
chmod +x bin/spc
|
||||||
|
```
|
||||||
|
|
||||||
|
### 使用 static-php-cli 命令行程序
|
||||||
|
|
||||||
|
下面是使用 static-php-cli 编译静态 php 和 micro 的基础用法:
|
||||||
|
|
||||||
|
> 如果你使用的是打包好的 `spc` 二进制,你需要将下列命令的 `bin/spc` 替换为 `./spc`。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 检查环境依赖,并根据提示的命令安装缺失的编译工具
|
||||||
|
./bin/spc doctor
|
||||||
|
# 拉取所有依赖库
|
||||||
|
./bin/spc fetch --all
|
||||||
|
# 只拉取编译指定扩展需要的所有依赖
|
||||||
|
./bin/spc download --for-extensions=openssl,pcntl,mbstring,pdo_sqlite
|
||||||
|
# 构建包含 bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl 扩展的 php-cli 和 micro.sfx
|
||||||
|
./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl" --build-cli --build-micro
|
||||||
|
```
|
||||||
|
|
||||||
|
你也可以使用参数 `--with-php=x.y` 来指定下载的 PHP 版本,目前支持 7.3 ~ 8.3:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 优先考虑使用 >= 8.0 的 PHP 版本,因为 phpmicro 不支持在 PHP7 中构建
|
||||||
|
./bin/spc download --with-php=8.2 --all
|
||||||
|
```
|
||||||
|
|
||||||
|
其中,目前支持构建 cli,micro,fpm 三种静态二进制,使用以下参数的一个或多个来指定编译的 SAPI:
|
||||||
|
|
||||||
|
- `--build-cli`:构建 cli 二进制
|
||||||
|
- `--build-micro`:构建 phpmicro 自执行二进制
|
||||||
|
- `--build-fpm`:构建 fpm
|
||||||
|
- `--build-embed`:构建 embed(libphp)
|
||||||
|
- `--build-all`:构建所有
|
||||||
|
|
||||||
|
如果出现了任何错误,可以使用 `--debug` 参数来展示完整的输出日志,以供排查错误:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./bin/spc build openssl,pcntl,mbstring --debug --build-all
|
||||||
|
./bin/spc fetch --all --debug
|
||||||
|
```
|
||||||
|
|
||||||
|
此外,默认编译的 PHP 为 NTS 版本。如需编译线程安全版本(ZTS),只需添加参数 `--enable-zts` 即可。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./bin/spc build openssl,pcntl --build-all --enable-zts
|
||||||
|
```
|
||||||
|
|
||||||
|
同时,你也可以使用参数 `--no-strip` 来关闭裁剪,关闭裁剪后可以使用 gdb 等工具调试,但这样会让静态二进制体积变大。
|
||||||
|
|
||||||
|
## 不同 SAPI 的使用
|
||||||
|
|
||||||
|
### 使用 cli
|
||||||
|
|
||||||
|
> php-cli 是一个静态的二进制文件,类似 Go、Rust 语言编译后的单个可移植的二进制文件。
|
||||||
|
|
||||||
|
采用参数 `--build-cli` 或`--build-all` 参数时,最后编译结果会输出一个 `./php` 的二进制文件,此文件可分发、可直接使用。
|
||||||
|
该文件编译后会存放在 `buildroot/bin/` 目录中,名称为 `php`,拷贝出来即可。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd buildroot/bin/
|
||||||
|
./php -v # 检查版本
|
||||||
|
./php -m # 检查编译的扩展
|
||||||
|
./php your_code.php # 运行代码
|
||||||
|
./php your_project.phar # 运行打包为 phar 单文件的项目
|
||||||
|
```
|
||||||
|
|
||||||
|
### 使用 micro
|
||||||
|
|
||||||
|
> phpmicro 是一个提供自执行二进制 PHP 的项目,本项目依赖 phpmicro 进行编译自执行二进制。详见 [dixyes/phpmicro](https://github.com/dixyes/phpmicro)。
|
||||||
|
|
||||||
|
采用项目参数 `--build-micro` 或 `--build-all` 时,最后编译结果会输出一个 `./micro.sfx` 的文件,此文件需要配合你的 PHP 源码使用。
|
||||||
|
该文件编译后会存放在 `buildroot/bin/` 目录中,拷贝出来即可。
|
||||||
|
|
||||||
|
使用时应准备好你的项目源码文件,可以是单个 PHP 文件,也可以是 Phar 文件。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
echo "<?php echo 'Hello world' . PHP_EOL;" > code.php
|
||||||
|
cat micro.sfx code.php > single-app && chmod +x single-app
|
||||||
|
./single-app
|
||||||
|
```
|
||||||
|
|
||||||
|
如果打包 PHAR 文件,仅需把 code.php 更换为 phar 文件路径即可。
|
||||||
|
你可以使用 [box-project/box](https://github.com/box-project/box) 将你的 CLI 项目打包为 Phar,
|
||||||
|
然后将它与 phpmicro 结合,生成独立可执行的二进制文件。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 使用 static-php-cli 生成的 micro.sfx 结合,也可以直接使用 cat 命令结合它们
|
||||||
|
bin/spc micro:combine my-app.phar
|
||||||
|
cat buildroot/bin/micro.sfx my-app.phar > my-app && chmod +x my-app
|
||||||
|
|
||||||
|
# 使用 micro:combine 结合可以将 INI 选项注入到二进制中
|
||||||
|
bin/spc micro:combine my-app.phar -I "memory_limit=4G" -I "disable_functions=system" --output my-app-2
|
||||||
|
```
|
||||||
|
|
||||||
|
> 有些情况下的 phar 文件或 PHP 项目可能无法在 micro 环境下运行。
|
||||||
|
|
||||||
|
### 使用 fpm
|
||||||
|
|
||||||
|
采用项目参数 `--build-fpm` 或 `--build-all` 时,最后编译结果会输出一个 `./php-fpm` 的文件。
|
||||||
|
该文件存放在 `buildroot/bin/` 目录,拷贝出来即可使用。
|
||||||
|
|
||||||
|
在正常的 Linux 发行版和 macOS 系统中,安装 php-fpm 后包管理会自动生成默认的 fpm 配置文件。
|
||||||
|
因为 php-fpm 必须指定配置文件才可启动,本项目编译的 php-fpm 不会带任何配置文件,所以需自行编写 `php-fpm.conf` 和 `pool.conf` 配置文件。
|
||||||
|
|
||||||
|
指定 `php-fpm.conf` 可以使用命令参数 `-y`,例如:`./php-fpm -y php-fpm.conf`。
|
||||||
|
|
||||||
|
### 使用 embed
|
||||||
|
|
||||||
|
采用项目参数 `--build-embed` 或 `--build-all` 时,最后编译结果会输出一个 `libphp.a`、`php-config` 以及一系列头文件,存放在 `buildroot/`,你可以在你的其他代码中引入它们。
|
||||||
|
|
||||||
|
如果你知道 [embed SAPI](https://github.com/php/php-src/tree/master/sapi/embed),你应该知道如何使用它。对于有可能编译用到引入其他库的问题,你可以使用 `buildroot/bin/php-config` 来获取编译时的配置。
|
||||||
|
|
||||||
|
另外,有关如何使用此功能的高级示例,请查看[如何使用它构建 FrankenPHP 的静态版本](https://github.com/dunglas/frankenphp/blob/main/docs/static.md)。
|
||||||
|
|
||||||
## 贡献
|
## 贡献
|
||||||
|
|
||||||
如果你需要的扩展缺失,可以创建 issue。
|
如果缺少你需要的扩展,可发起 Issue。如果你对本项目较熟悉,也欢迎为本项目发起 Pull Request。
|
||||||
如果你熟悉本项目,也欢迎发起 pull request。
|
|
||||||
|
|
||||||
如果你想贡献文档,请直接编辑 `docs/`。
|
另外,添加新扩展的贡献方式,可以参考下方 `进阶`。
|
||||||
|
|
||||||
|
如果你想贡献文档内容,请到项目仓库 [static-php/static-php-cli-docs](https://github.com/static-php/static-php-cli-docs) 贡献。
|
||||||
|
|
||||||
## 赞助本项目
|
## 赞助本项目
|
||||||
|
|
||||||
你可以通过 [GitHub Sponsor](https://github.com/crazywhalecc) 赞助我或我的项目。你捐赠的一部分将用于维护 **static-php.dev** 服务器。
|
你可以在 [我的个人赞助页](https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md) 支持我和我的项目。
|
||||||
|
|
||||||
**特别感谢以下赞助商:**
|
## 开源协议
|
||||||
|
|
||||||
<a href="https://beyondco.de/"><img src="/docs/public/images/beyondcode-seeklogo.png" width="300" alt="Beyond Code Logo" /></a>
|
本项目依据旧版本惯例采用 MIT License 开源,部分扩展的集成编译命令参考或修改自以下项目:
|
||||||
|
|
||||||
<a href="https://nativephp.com/"><img src="/docs/public/images/nativephp-logo.svg" width="300" alt="NativePHP Logo" /></a>
|
- [dixyes/lwmbs](https://github.com/dixyes/lwmbs)(木兰宽松许可证)
|
||||||
|
- [swoole/swoole-cli](https://github.com/swoole/swoole-cli)(Apache 2.0 LICENSE、SWOOLE-CLI LICENSE)
|
||||||
|
|
||||||
## 开源许可证
|
因本项目的特殊性,使用项目编译过程中会使用很多其他开源项目,例如 curl、protobuf 等,它们都有各自的开源协议。
|
||||||
|
请在编译完成后,使用命令 `bin/spc dump-license` 导出项目使用项目的开源协议,并遵守对应项目的 LICENSE。
|
||||||
|
|
||||||
本项目本身采用 MIT 许可证。
|
## 进阶
|
||||||
一些新添加的扩展和依赖可能来自其他项目。
|
|
||||||
这些源码文件头部也可能包含额外的 LICENSE 和 AUTHOR 信息。
|
|
||||||
|
|
||||||
请在编译后使用 `bin/spc dump-license` 命令导出项目中使用的开源许可证,
|
本项目重构分支为模块化编写。如果你对本项目感兴趣,想加入开发,可以参照文档的 [贡献指南](https://static-php.dev) 贡献代码或文档。
|
||||||
并遵守对应项目的 LICENSE。
|
|
||||||
|
|||||||
360
README.md
360
README.md
@@ -1,156 +1,290 @@
|
|||||||
# StaticPHP
|
# static-php-cli
|
||||||
|
|
||||||
[](README-zh.md)
|
Build single static PHP binary, with PHP project together, with popular extensions included.
|
||||||
[](README.md)
|
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/releases)
|
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
|
|
||||||
[](https://discord.gg/xf6Rd4pEAk)
|
|
||||||
|
|
||||||
**StaticPHP** is a powerful tool designed for building portable executables including PHP, extensions, and more.
|
🌐 **[中文](README-zh.md)** | **[English](README.md)**
|
||||||
|
|
||||||
> [!IMPORTANT]
|
The project name is static-php-cli, but it actually supports cli, fpm, micro and embed SAPI 😎
|
||||||
> We are preparing to release **v3**, which will include a project rename from **static-php-cli** to **StaticPHP**.
|
|
||||||
> And this branch is for v3. For v2, please check the [v2 branch](https://github.com/crazywhalecc/static-php-cli/tree/main).
|
|
||||||
> Please update your references and stay tuned for the official release.
|
|
||||||
|
|
||||||
## Features
|
Compile a purely static php-cli binary file with various extensions to make PHP applications more portable! (cli SAPI)
|
||||||
|
|
||||||
- :elephant: Support multiple PHP versions - PHP 8.1, 8.2, 8.3, 8.4, 8.5
|
<img width="600" alt="2023-05-02 15 53 13" src="https://user-images.githubusercontent.com/20330940/235610282-23e58d68-bd35-4092-8465-171cff2d5ba8.png">
|
||||||
- :handbag: Build single-file PHP executable with zero dependencies
|
|
||||||
- :hamburger: Build **[phpmicro](https://github.com/static-php/phpmicro)** self-extracting executables (combines PHP binary and source code into one file)
|
|
||||||
- :pill: Automatic build environment checker with auto-fix capabilities
|
|
||||||
- :zap: `Linux`, `macOS`, `Windows` support
|
|
||||||
- :wrench: Easy to extend with vendor mode and custom registries
|
|
||||||
- :books: Intelligent dependency management
|
|
||||||
- 📦 Self-contained `spc` executable for easy self-installation
|
|
||||||
- :fire: Support 100+ popular [PHP extensions](https://static-php.dev/en/guide/extensions.html)
|
|
||||||
- :floppy_disk: UPX compression support (reduces binary size by 30-50%)
|
|
||||||
|
|
||||||
**Single-file standalone php-cli:**
|
You can also use the micro binary file to combine php binary and php source code into one for distribution! (micro SAPI)
|
||||||
|
|
||||||
<img width="700" alt="out1" src="https://github.com/crazywhalecc/static-php-cli/assets/20330940/01a2e60f-13b0-4242-a645-f7afa4936396">
|
<img width="600" alt="2023-05-02 15 52 33" src="https://user-images.githubusercontent.com/20330940/235610318-2ef4e3f1-278b-4ca4-99f4-b38120efc395.png">
|
||||||
|
|
||||||
**Combine PHP code with PHP interpreter using phpmicro:**
|
> This SAPI feature is from the [Fork](https://github.com/static-php/phpmicro) of [dixyes/phpmicro](https://github.com/dixyes/phpmicro).
|
||||||
|
|
||||||
<img width="700" alt="out2" src="https://github.com/crazywhalecc/static-php-cli/assets/20330940/46b7128d-fb72-4169-957e-48564c3ff3e2">
|
[]()
|
||||||
|
[]()
|
||||||
|
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
||||||
|
|
||||||
## Quickstart
|
[]([https://static-php.dev/](https://static-php.dev/en/guide/extensions.html))
|
||||||
|
[]()
|
||||||
### 1. Download spc binary
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# For Linux x86_64
|
|
||||||
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/nightly/spc-linux-x86_64
|
|
||||||
# For Linux aarch64
|
|
||||||
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/nightly/spc-linux-aarch64
|
|
||||||
# macOS x86_64 (Intel)
|
|
||||||
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/nightly/spc-macos-x86_64
|
|
||||||
# macOS aarch64 (Apple)
|
|
||||||
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/nightly/spc-macos-aarch64
|
|
||||||
# Windows (x86_64, win10 build 17063 or later, please install VS2022 first)
|
|
||||||
curl.exe -fsSL -o spc.exe https://dl.static-php.dev/v3/spc-bin/nightly/spc-windows-x64.exe
|
|
||||||
```
|
|
||||||
|
|
||||||
For macOS and Linux, add execute permission first:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
chmod +x ./spc
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. Build Static PHP
|
|
||||||
|
|
||||||
First, create a `craft.yml` file and specify which extensions you want to include from [extension list](https://static-php.dev/en/guide/extensions.html) or [command generator](https://static-php.dev/en/guide/cli-generator.html):
|
|
||||||
|
|
||||||
```yml
|
|
||||||
# PHP version support: 8.1, 8.2, 8.3, 8.4, 8.5
|
|
||||||
php-version: 8.5
|
|
||||||
# Put your extension list here
|
|
||||||
extensions: "apcu,bcmath,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,gd,iconv,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,readline,redis,session,simplexml,sockets,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib"
|
|
||||||
sapi:
|
|
||||||
- cli
|
|
||||||
- micro
|
|
||||||
download-options:
|
|
||||||
parallel: 10
|
|
||||||
```
|
|
||||||
|
|
||||||
Run command:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./spc craft
|
|
||||||
|
|
||||||
# Output full console log
|
|
||||||
./spc craft -vvv
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. Static PHP usage
|
|
||||||
|
|
||||||
Now you can copy binaries built by StaticPHP to another machine and run with no dependencies:
|
|
||||||
|
|
||||||
```
|
|
||||||
# php-cli
|
|
||||||
buildroot/bin/php -v
|
|
||||||
|
|
||||||
# phpmicro
|
|
||||||
echo '<?php echo "Hello world!\n";' > a.php
|
|
||||||
./spc micro:combine a.php -O my-app
|
|
||||||
./my-app
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
The current README contains basic usage. For the complete feature set of StaticPHP,
|
The current README contains basic usage. For all the features of static-php-cli,
|
||||||
see <https://static-php.dev> .
|
see <https://static-php.dev> .
|
||||||
|
|
||||||
## Direct Download
|
## Direct Download
|
||||||
|
|
||||||
If you do not want to build yet or just want to test first, you can download example pre-compiled artifacts from [Actions](https://github.com/static-php/hosted/actions/workflows/build-php-bulk.yml) or from a self-hosted server.
|
If you don't want to compile yourself, you can download example pre-compiled artifact from [Actions](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-common.yml), or from self-hosted server.
|
||||||
|
|
||||||
We offer 2 types of extension sets for each PHP version:
|
Below are several precompiled static-php binaries with different extension combinations,
|
||||||
|
which can be downloaded directly according to your needs.
|
||||||
|
|
||||||
- **gigantic**: Includes as many extensions as possible, the binary size is about 100-150MB.
|
- [Extension-Combination - common](https://dl.static-php.dev/static-php-cli/common/): `common` contains about [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) commonly used extensions, and the size is about 22MB.
|
||||||
- **base**: Only includes a few extensions used by StaticPHP itself, the binary size is about 10MB.
|
- [Extension-Combination - bulk](https://dl.static-php.dev/static-php-cli/bulk/): `bulk` contains [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) extensions and is about 70MB in size.
|
||||||
|
- [Extension-Combination - minimal](https://dl.static-php.dev/static-php-cli/minimal/): `minimal` contains [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) extensions and is about 6MB in size.
|
||||||
|
|
||||||
> WIP
|
## Use static-php-cli to build PHP
|
||||||
|
|
||||||
### Build Online (using GitHub Actions)
|
### Compilation Requirements
|
||||||
|
|
||||||
When the direct-download binaries above cannot meet your needs,
|
Yes, this project is written in PHP, pretty funny.
|
||||||
you can use GitHub Actions to easily build a statically compiled PHP
|
But static-php-cli runtime only requires an environment above PHP 8.1 and `mbstring`, `pcntl` extension.
|
||||||
while defining your own extension list.
|
|
||||||
|
|
||||||
1. Fork this repository.
|
Here is the architecture support status, where :octocat: represents support for GitHub Action builds,
|
||||||
|
:computer: represents support for local manual builds, and blank represents not currently supported.
|
||||||
|
|
||||||
|
| | x86_64 | aarch64 |
|
||||||
|
|---------|----------------------|----------------------|
|
||||||
|
| macOS | :octocat: :computer: | :computer: |
|
||||||
|
| Linux | :octocat: :computer: | :octocat: :computer: |
|
||||||
|
| Windows | | |
|
||||||
|
| FreeBSD | :computer: | :computer: |
|
||||||
|
|
||||||
|
> macOS-arm64 is not supported for GitHub Actions, if you are going to build on arm, you can build it manually on your own machine.
|
||||||
|
|
||||||
|
Currently supported PHP versions for compilation are: `7.3`, `7.4`, `8.0`, `8.1`, `8.2`, `8.3`.
|
||||||
|
|
||||||
|
### Supported Extensions
|
||||||
|
|
||||||
|
Please first select the extension you want to compile based on the extension list below.
|
||||||
|
|
||||||
|
- [Supported Extension List](https://static-php.dev/en/guide/extensions.html)
|
||||||
|
- [Command Generator](https://static-php.dev/en/guide/cli-generator.html)
|
||||||
|
|
||||||
|
> If an extension you need is missing, you can submit an issue.
|
||||||
|
|
||||||
|
Here is the current planned roadmap for extension support: [#152](https://github.com/crazywhalecc/static-php-cli/issues/152) .
|
||||||
|
|
||||||
|
### GitHub Actions Build
|
||||||
|
|
||||||
|
Use GitHub Action to easily build a statically compiled PHP,
|
||||||
|
and at the same time define the extensions to be compiled by yourself.
|
||||||
|
|
||||||
|
1. Fork me.
|
||||||
2. Go to the Actions of the project and select `CI`.
|
2. Go to the Actions of the project and select `CI`.
|
||||||
3. Select `Run workflow`, fill in the PHP version you want to compile, the target type, and the list of extensions. (extensions comma separated, e.g. `bcmath,curl,mbstring`)
|
3. Select `Run workflow`, fill in the PHP version you want to compile, the target type, and the list of extensions. (extensions comma separated, e.g. `bcmath,curl,mbstring`)
|
||||||
4. After waiting for the workflow to finish, open the corresponding run and download `Artifacts`.
|
4. After waiting for about a period of time, enter the corresponding task and get `Artifacts`.
|
||||||
|
|
||||||
If you enable `debug`, all logs will be output at build time, including compiled logs, for troubleshooting.
|
If you enable `debug`, all logs will be output at build time, including compiled logs, for troubleshooting.
|
||||||
|
|
||||||
> We are also planning to provide a reusable GitHub Actions workflow in the future,
|
- When using ubuntu-latest, it will build linux-x86_64 binary.
|
||||||
> so that you can easily build static PHP in your own repository, without forking this project.
|
- When using macos-latest, it will build macOS-x86_64 binary.
|
||||||
|
|
||||||
|
### Manual build (using SPC binary)
|
||||||
|
|
||||||
|
This project provides a binary file of static-php-cli.
|
||||||
|
You can directly download the binary file of the corresponding platform and then use it to build static PHP.
|
||||||
|
Currently, the platforms supported by `spc` binary are Linux and macOS.
|
||||||
|
|
||||||
|
Here's how to download from GitHub Actions:
|
||||||
|
|
||||||
|
1. Enter [GitHub Actions](https://github.com/crazywhalecc/static-php-cli/actions/workflows/release-build.yml) or [self-hosted nightly builds](https://dl.static-php.dev/static-php-cli/spc-bin/nightly/).
|
||||||
|
2. If you download from GHA, select the latest build task, select `Artifacts`, and download the binary file of the corresponding platform.
|
||||||
|
3. If you download from GHA, unzip the `.zip` file. After decompressing, add execution permissions to it: `chmod +x ./spc`.
|
||||||
|
4. If you download from self-hosted server, download `spc-$os-$arch` file and just use it (don't forget `chmod +x`).
|
||||||
|
|
||||||
|
> SPC single-file binary is built by phpmicro and box, and it doesn't need to install PHP. Just treat `spc` as a standalone executable.
|
||||||
|
|
||||||
|
### Manual build (using source code)
|
||||||
|
|
||||||
|
Clone repo first:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/crazywhalecc/static-php-cli.git
|
||||||
|
```
|
||||||
|
|
||||||
|
If you have not installed php on your system, you can use package management to install PHP (such as brew, apt, yum, apk etc.).
|
||||||
|
|
||||||
|
And you can also download single-file php binary and composer using command `bin/setup-runtime`.
|
||||||
|
The PHP runtime for static-php-cli itself will be downloaded at `bin/php`, and composer is at `bin/composer`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd static-php-cli
|
||||||
|
chmod +x bin/setup-runtime
|
||||||
|
# It will download php-cli from self-hosted server and composer from getcomposer.org
|
||||||
|
./bin/setup-runtime
|
||||||
|
|
||||||
|
# Use this php runtime to run static-php-cli compiler
|
||||||
|
./bin/php bin/spc
|
||||||
|
|
||||||
|
# Use composer
|
||||||
|
./bin/php bin/composer
|
||||||
|
|
||||||
|
# Initialize this project
|
||||||
|
cd static-php-cli
|
||||||
|
composer update
|
||||||
|
chmod +x bin/spc
|
||||||
|
```
|
||||||
|
|
||||||
|
### Use static-php-cli
|
||||||
|
|
||||||
|
Basic usage for building php and micro with some extensions:
|
||||||
|
|
||||||
|
> If you are using the packaged `spc` binary, you need to replace `bin/spc` with `./spc` in the following commands.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check system tool dependencies, fix them if possible
|
||||||
|
./bin/spc doctor
|
||||||
|
# fetch all libraries
|
||||||
|
./bin/spc download --all
|
||||||
|
# only fetch necessary sources by needed extensions
|
||||||
|
./bin/spc download --for-extensions=openssl,pcntl,mbstring,pdo_sqlite
|
||||||
|
# with bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl extension, build both CLI and phpmicro SAPI
|
||||||
|
./bin/spc build bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl --build-cli --build-micro
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also use the parameter `--with-php=x.y` to specify the downloaded PHP version, currently supports 7.4 ~ 8.3:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Using PHP >= 8.0 is recommended, because PHP7 cannot use phpmicro
|
||||||
|
./bin/spc fetch --with-php=8.2 --all
|
||||||
|
```
|
||||||
|
|
||||||
|
Now we support `cli`, `micro`, `fpm`, you can use one or more of the following parameters to specify the compiled SAPI:
|
||||||
|
|
||||||
|
- `--build-cli`: build static cli executable
|
||||||
|
- `--build-micro`: build static phpmicro self-extracted executable
|
||||||
|
- `--build-fpm`: build static fpm binary
|
||||||
|
- `--build-embed`: build embed (libphp)
|
||||||
|
- `--build-all`: build all
|
||||||
|
|
||||||
|
If anything goes wrong, use `--debug` option to display full terminal output:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./bin/spc build openssl,pcntl,mbstring --debug --build-all
|
||||||
|
./bin/spc fetch --all --debug
|
||||||
|
```
|
||||||
|
|
||||||
|
In addition, we build NTS (non-thread-safe) by default. If you are going to build ZTS version, just add `--enable-zts` option.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./bin/spc build openssl,pcntl --build-all --enable-zts
|
||||||
|
```
|
||||||
|
|
||||||
|
Adding option `--no-strip` can produce binaries with debug symbols, in order to debug (using gdb). Disabling strip will increase the size of static binary.
|
||||||
|
|
||||||
|
## Different SAPI Usage
|
||||||
|
|
||||||
|
### Use cli
|
||||||
|
|
||||||
|
> php-cli is a single static binary, you can use it like normal php installed on your system.
|
||||||
|
|
||||||
|
When using the parameter `--build-cli` or `--build-all`,
|
||||||
|
the final compilation result will output a binary file named `./php`,
|
||||||
|
which can be distributed and used directly.
|
||||||
|
This file will be located in the directory `buildroot/bin/`, copy it out for use.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd buildroot/bin/
|
||||||
|
./php -v # check version
|
||||||
|
./php -m # check extensions
|
||||||
|
./php your_code.php # run your php code
|
||||||
|
./php your_project.phar # run your phar (project archive)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Use micro
|
||||||
|
|
||||||
|
> phpmicro is a SelF-extracted eXecutable SAPI module,
|
||||||
|
> provided by [phpmicro](https://github.com/dixyes/phpmicro) project.
|
||||||
|
> But this project is using a [fork](https://github.com/static-php/phpmicro) of phpmicro, because we need to add some features to it.
|
||||||
|
> It can put php runtime and your source code together.
|
||||||
|
|
||||||
|
When using the parameter `--build-all` or `--build-micro`,
|
||||||
|
the final compilation result will output a file named `./micro.sfx`,
|
||||||
|
which needs to be used with your PHP source code like `code.php`.
|
||||||
|
This file will be located in the path `buildroot/bin/micro.sfx`, simply copy it out for use.
|
||||||
|
|
||||||
|
Prepare your project source code, which can be a single PHP file or a Phar file, for use.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
echo "<?php echo 'Hello world' . PHP_EOL;" > code.php
|
||||||
|
cat micro.sfx code.php > single-app && chmod +x single-app
|
||||||
|
./single-app
|
||||||
|
```
|
||||||
|
|
||||||
|
If you package a PHAR file, just replace `code.php` with the phar file path.
|
||||||
|
You can use [box-project/box](https://github.com/box-project/box) to package your CLI project as Phar,
|
||||||
|
It is then combined with phpmicro to produce a standalone executable binary.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Use the micro.sfx generated by static-php-cli to combine,
|
||||||
|
bin/spc micro:combine my-app.phar
|
||||||
|
# or you can directly use the cat command to combine them.
|
||||||
|
cat buildroot/bin/micro.sfx my-app.phar > my-app && chmod +x my-app
|
||||||
|
|
||||||
|
# Use micro:combine combination to inject INI options into the binary.
|
||||||
|
bin/spc micro:combine my-app.phar -I "memory_limit=4G" -I "disable_functions=system" --output my-app-2
|
||||||
|
```
|
||||||
|
|
||||||
|
> In some cases, PHAR files may not run in a micro environment. Overall, micro is not production ready.
|
||||||
|
|
||||||
|
### Use fpm
|
||||||
|
|
||||||
|
When using the parameter `--build-all` or `--build-fpm`,
|
||||||
|
the final compilation result will output a file named `./php-fpm`,
|
||||||
|
This file will be located in the path `buildroot/bin/`, simply copy it out for use.
|
||||||
|
|
||||||
|
In common Linux distributions and macOS systems, the package manager will automatically generate a default fpm configuration file after installing php-fpm.
|
||||||
|
Because php-fpm must specify a configuration file before running, the php-fpm compiled by this project will not have any configuration files, so you need to write `php-fpm.conf` and `pool.conf` configuration files yourself.
|
||||||
|
|
||||||
|
Specifying `php-fpm.conf` can use the command parameter `-y`, for example: `./php-fpm -y php-fpm.conf`.
|
||||||
|
|
||||||
|
### Use embed
|
||||||
|
|
||||||
|
When using the project parameters `--build-embed` or `--build-all`,
|
||||||
|
the final compilation result will output a `libphp.a`, `php-config` and a series of header files,
|
||||||
|
stored in `buildroot/`. You can introduce them in your other projects.
|
||||||
|
|
||||||
|
If you know [embed SAPI](https://github.com/php/php-src/tree/master/sapi/embed), you should know how to use it.
|
||||||
|
You may require the introduction of other libraries during compilation,
|
||||||
|
you can use `buildroot/bin/php-config` to obtain the compile-time configuration.
|
||||||
|
|
||||||
|
For an advanced example of how to use this feature, take a look at [how to use it to build a static version of FrankenPHP](https://github.com/dunglas/frankenphp/blob/main/docs/static.md).
|
||||||
|
|
||||||
## Contribution
|
## Contribution
|
||||||
|
|
||||||
If the extension you need is missing, you can create an issue.
|
If the extension you need is missing, you can create an issue.
|
||||||
If you are familiar with this project, you are also welcome to initiate a pull request.
|
If you are familiar with this project, you are also welcome to initiate a pull request.
|
||||||
|
|
||||||
If you want to contribute documentation, please just edit in `docs/`.
|
If you want to contribute documentation, please go to [static-php/static-php-cli-docs](https://github.com/static-php/static-php-cli-docs).
|
||||||
|
|
||||||
|
Now there is a [static-php](https://github.com/static-php) organization, which is used to store the repo related to the project.
|
||||||
|
|
||||||
## Sponsor this project
|
## Sponsor this project
|
||||||
|
|
||||||
You can sponsor me or my project from [GitHub Sponsor](https://github.com/crazywhalecc). A portion of your donation will be used to maintain the **static-php.dev** server.
|
You can sponsor my project on [this page](https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md).
|
||||||
|
|
||||||
**Special thanks to sponsors below**:
|
|
||||||
|
|
||||||
<a href="https://beyondco.de/"><img src="/docs/public/images/beyondcode-seeklogo.png" width="300" alt="Beyond Code Logo" /></a>
|
|
||||||
|
|
||||||
<a href="https://nativephp.com/"><img src="/docs/public/images/nativephp-logo.svg" width="300" alt="NativePHP Logo" /></a>
|
|
||||||
|
|
||||||
## Open-Source License
|
## Open-Source License
|
||||||
|
|
||||||
This project itself is licensed under MIT.
|
This project itself is based on MIT License,
|
||||||
Some newly added extensions and dependencies may originate from other projects.
|
some newly added extensions and dependencies may originate from the the other projects,
|
||||||
The headers of those source files may also include additional LICENSE and AUTHOR information.
|
and the headers of these code files will also be given additional instructions LICENSE and AUTHOR.
|
||||||
|
|
||||||
|
These are similar projects:
|
||||||
|
|
||||||
|
- [dixyes/lwmbs](https://github.com/dixyes/lwmbs)
|
||||||
|
- [swoole/swoole-cli](https://github.com/swoole/swoole-cli)
|
||||||
|
|
||||||
|
Due to the special nature of this project,
|
||||||
|
many other open source projects such as curl and protobuf will be used during the project compilation process,
|
||||||
|
and they all have their own open source licenses.
|
||||||
|
|
||||||
Please use the `bin/spc dump-license` command to export the open source licenses used in the project after compilation,
|
Please use the `bin/spc dump-license` command to export the open source licenses used in the project after compilation,
|
||||||
and comply with the corresponding project's LICENSE.
|
and comply with the corresponding project's LICENSE.
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
TARGET_DIR="/app/pkgroot/$(uname -m)-linux"
|
|
||||||
BACKUP_DIR="/app/pkgroot-private"
|
|
||||||
# copy private pkgroot to pkgroot if pkgroot is empty
|
|
||||||
if [ ! -d "$TARGET_DIR" ] || [ -z "$(ls -A "$TARGET_DIR")" ]; then
|
|
||||||
echo "* Copying private pkgroot to pkgroot ..."
|
|
||||||
rm -rf "$TARGET_DIR"
|
|
||||||
cp -r "$BACKUP_DIR" "$TARGET_DIR"
|
|
||||||
fi
|
|
||||||
exec "$@"
|
|
||||||
@@ -25,7 +25,7 @@ __DIR__=$(cd "$(dirname "$0")" && pwd)
|
|||||||
__PROJECT__=$(cd "${__DIR__}"/../ && pwd)
|
__PROJECT__=$(cd "${__DIR__}"/../ && pwd)
|
||||||
|
|
||||||
# set download dir
|
# set download dir
|
||||||
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.2.13-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
||||||
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
|
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
|
||||||
|
|
||||||
# use china mirror
|
# use china mirror
|
||||||
@@ -35,6 +35,7 @@ while [ $# -gt 0 ]; do
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
--mirror)
|
--mirror)
|
||||||
mirror="$2"
|
mirror="$2"
|
||||||
|
shift
|
||||||
;;
|
;;
|
||||||
--*)
|
--*)
|
||||||
echo "Illegal option $1"
|
echo "Illegal option $1"
|
||||||
@@ -45,8 +46,8 @@ done
|
|||||||
|
|
||||||
case "$mirror" in
|
case "$mirror" in
|
||||||
china)
|
china)
|
||||||
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.2.13-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
||||||
__COMPOSER_URL__="https://mirrors.tencent.com/composer/composer.phar"
|
__COMPOSER_URL__="https://mirrors.aliyun.com/composer/composer.phar"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
@@ -61,7 +62,7 @@ test -f "${__PROJECT__}"/downloads/runtime.tar.gz || { echo "Downloading $__PHP_
|
|||||||
test -f "${__DIR__}"/php || { tar -xf "${__PROJECT__}"/downloads/runtime.tar.gz -C "${__DIR__}"/ ; }
|
test -f "${__DIR__}"/php || { tar -xf "${__PROJECT__}"/downloads/runtime.tar.gz -C "${__DIR__}"/ ; }
|
||||||
chmod +x "${__DIR__}"/php
|
chmod +x "${__DIR__}"/php
|
||||||
# download composer
|
# download composer
|
||||||
test -f "${__DIR__}"/composer || { echo "Downloading Composer from $__COMPOSER_URL__" && curl -#fSL -o "${__DIR__}"/composer "$__COMPOSER_URL__" ; }
|
test -f "${__DIR__}"/composer || curl -#fSL -o "${__DIR__}"/composer "$__COMPOSER_URL__"
|
||||||
chmod +x "${__DIR__}"/composer
|
chmod +x "${__DIR__}"/composer
|
||||||
# sanity check for php and composer
|
# sanity check for php and composer
|
||||||
"${__DIR__}"/php -v >/dev/null || { echo "Failed to run php" && exit 1; }
|
"${__DIR__}"/php -v >/dev/null || { echo "Failed to run php" && exit 1; }
|
||||||
|
|||||||
@@ -1,116 +0,0 @@
|
|||||||
param (
|
|
||||||
[string] ${action}
|
|
||||||
)
|
|
||||||
|
|
||||||
function AddToPath {
|
|
||||||
param (
|
|
||||||
[string]$pathToAdd
|
|
||||||
)
|
|
||||||
|
|
||||||
$currentPath = [System.Environment]::GetEnvironmentVariable('Path', 'User')
|
|
||||||
|
|
||||||
if ($currentPath -notlike "*$pathToAdd*") {
|
|
||||||
$newPath = $currentPath + ";$pathToAdd"
|
|
||||||
[System.Environment]::SetEnvironmentVariable('Path', $newPath, 'User')
|
|
||||||
Write-Host "Added '$pathToAdd' to Path."
|
|
||||||
Write-Host "To remove path, use: " -NoNewline
|
|
||||||
Write-Host "bin/setup-runtime remove-path" -ForegroundColor Cyan
|
|
||||||
} else {
|
|
||||||
Write-Host "Path already exists."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function RemoveFromPath {
|
|
||||||
param (
|
|
||||||
[string]$pathToRemove
|
|
||||||
)
|
|
||||||
|
|
||||||
$currentPath = [System.Environment]::GetEnvironmentVariable('Path', 'User')
|
|
||||||
|
|
||||||
if ($currentPath -like "*$pathToRemove*") {
|
|
||||||
$newPath = $currentPath -replace [regex]::Escape(';' + $pathToRemove), ''
|
|
||||||
[System.Environment]::SetEnvironmentVariable('Path', $newPath, 'User')
|
|
||||||
Write-Host "Removed Path '$pathToRemove'"
|
|
||||||
} else {
|
|
||||||
Write-Host "Path '$pathToRemove' not in Path"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# working dir
|
|
||||||
$WorkingDir = (Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Definition))
|
|
||||||
|
|
||||||
if ($action -eq 'add-path') {
|
|
||||||
AddToPath ($WorkingDir + '\runtime')
|
|
||||||
exit 0
|
|
||||||
} elseif ($action -eq 'remove-path') {
|
|
||||||
RemoveFromPath ($WorkingDir + '\runtime')
|
|
||||||
exit 0
|
|
||||||
} elseif (-not($action -eq '')) {
|
|
||||||
Write-Host ("Invalid action: " + $action) -ForegroundColor Red
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# get php 8.1 specific version
|
|
||||||
|
|
||||||
# php windows download
|
|
||||||
$PHPRuntimeUrl = "https://windows.php.net/downloads/releases/archives/php-8.4.4-nts-Win32-vs17-x64.zip"
|
|
||||||
Write-Host "Downloading PHP from: " -NoNewline
|
|
||||||
Write-Host $PHPRuntimeUrl -ForegroundColor Cyan
|
|
||||||
$ComposerUrl = "https://getcomposer.org/download/latest-stable/composer.phar"
|
|
||||||
|
|
||||||
# create dir
|
|
||||||
New-Item -Path "downloads" -ItemType Directory -Force | Out-Null
|
|
||||||
|
|
||||||
# download php
|
|
||||||
if (-not(Test-Path "downloads\php.zip"))
|
|
||||||
{
|
|
||||||
Write-Host "Downloading PHP ..."
|
|
||||||
Invoke-WebRequest $PHPRuntimeUrl -OutFile "downloads\php.zip"
|
|
||||||
}
|
|
||||||
|
|
||||||
# extract php
|
|
||||||
New-Item -Path "runtime" -ItemType Directory -Force | Out-Null
|
|
||||||
Write-Host "Extracting php.zip ..."
|
|
||||||
Expand-Archive -Path "downloads/php.zip" -DestinationPath "runtime" -Force
|
|
||||||
# make php.ini
|
|
||||||
Move-Item -Path "runtime\php.ini-production" -Destination "runtime\php.ini" -Force
|
|
||||||
$OriginINI = Get-Content -Path "runtime\php.ini" -Raw
|
|
||||||
$OriginINI = $OriginINI -replace ';extension=openssl', 'extension=openssl'
|
|
||||||
$OriginINI = $OriginINI -replace ';extension=curl', 'extension=curl'
|
|
||||||
$OriginINI = $OriginINI -replace ';extension=mbstring', 'extension=mbstring'
|
|
||||||
$OriginINI = $OriginINI -replace ';extension=sodium', 'extension=sodium'
|
|
||||||
$OriginINI = $OriginINI -replace ';extension_dir = "./"', ('extension_dir = "' + (Split-Path -Parent $MyInvocation.MyCommand.Definition) + '\..\runtime\ext"')
|
|
||||||
$OriginINI | Set-Content -Path "runtime\php.ini"
|
|
||||||
|
|
||||||
# download composer
|
|
||||||
if (-not(Test-Path "runtime\composer.phar"))
|
|
||||||
{
|
|
||||||
Write-Host "Downloading composer ..."
|
|
||||||
Invoke-WebRequest $ComposerUrl -OutFile "downloads\composer.phar"
|
|
||||||
Move-Item -Path "downloads\composer.phar" -Destination "runtime\composer.phar" -Force
|
|
||||||
}
|
|
||||||
|
|
||||||
# create runtime\composer.ps1
|
|
||||||
$ComposerContent = '
|
|
||||||
$WorkingDir = (Split-Path -Parent $MyInvocation.MyCommand.Definition)
|
|
||||||
& ($WorkingDir + "\php.exe") (Join-Path $WorkingDir "\composer.phar") @args
|
|
||||||
'
|
|
||||||
$ComposerContent | Set-Content -Path 'runtime\composer.ps1' -Encoding UTF8
|
|
||||||
|
|
||||||
Write-Host "Successfully downloaded PHP and Composer !" -ForegroundColor Green
|
|
||||||
Write-Host "Use static-php-cli: " -NoNewline
|
|
||||||
Write-Host "bin/spc" -ForegroundColor Cyan
|
|
||||||
Write-Host "Use php: " -NoNewline
|
|
||||||
Write-Host "runtime/php" -ForegroundColor Cyan
|
|
||||||
Write-Host "Use composer: " -NoNewline
|
|
||||||
Write-Host "runtime/composer" -ForegroundColor Cyan
|
|
||||||
Write-Host ""
|
|
||||||
Write-Host "Don't forget installing composer dependencies '" -NoNewline
|
|
||||||
Write-Host "runtime/composer install" -ForegroundColor Cyan -NoNewline
|
|
||||||
Write-Host "' before using static-php-cli !"
|
|
||||||
Write-Host ""
|
|
||||||
Write-Host "If you want to use this PHP for quality tools (like phpstan, php-cs-fixer) or other project,"
|
|
||||||
Write-Host "or use PHP, Composer as system executable,"
|
|
||||||
Write-Host "use '" -NoNewline
|
|
||||||
Write-Host "bin/setup-runtime add-path" -ForegroundColor Cyan -NoNewline
|
|
||||||
Write-Host "' to add runtime dir in Path."
|
|
||||||
26
bin/spc
26
bin/spc
@@ -1,28 +1,18 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use StaticPHP\ConsoleApplication;
|
use SPC\ConsoleApplication;
|
||||||
use StaticPHP\Exception\ExceptionHandler;
|
use SPC\exception\ExceptionHandler;
|
||||||
use StaticPHP\Exception\SPCException;
|
|
||||||
|
|
||||||
if (file_exists(dirname(__DIR__) . '/vendor/autoload.php')) {
|
require_once __DIR__ . '/../vendor/autoload.php';
|
||||||
// Current: ./bin (git/project mode)
|
|
||||||
require_once dirname(__DIR__) . '/vendor/autoload.php';
|
|
||||||
} else {
|
|
||||||
// Current: ./vendor/crazywhalecc/static-php-cli/bin (composer library mode)
|
|
||||||
require_once dirname(__DIR__, 3) . '/autoload.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Print deprecation notice on PHP < 8.4, use red and highlight background
|
// 防止 Micro 打包状态下不支持中文的显示(虽然这个项目目前好像没输出过中文?)
|
||||||
if (PHP_VERSION_ID < 80400) {
|
if (PHP_OS_FAMILY === 'Windows' && Phar::running()) {
|
||||||
echo "\e[43mDeprecation Notice: PHP < 8.4 is deprecated, please upgrade your PHP version.\e[0m\n";
|
exec('CHCP 65001');
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
(new ConsoleApplication())->run();
|
(new ConsoleApplication())->run();
|
||||||
} catch (SPCException $e) {
|
} catch (Exception $e) {
|
||||||
exit(ExceptionHandler::handleSPCException($e));
|
ExceptionHandler::getInstance()->handle($e);
|
||||||
} catch (\Throwable $e) {
|
|
||||||
exit(ExceptionHandler::handleDefaultException($e));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# This file is using docker to run commands
|
# This file is using docker to run commands
|
||||||
SPC_DOCKER_VERSION=v7
|
|
||||||
|
|
||||||
# Detect docker can run
|
# Detect docker can run
|
||||||
if ! which docker >/dev/null; then
|
if ! which docker >/dev/null; then
|
||||||
@@ -24,48 +21,27 @@ if [ $(id -u) -ne 0 ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Convert uname to gnu arch
|
|
||||||
CURRENT_ARCH=$(uname -m)
|
|
||||||
if [ "$CURRENT_ARCH" = "arm64" ]; then
|
# to check if qemu-docker run
|
||||||
CURRENT_ARCH=aarch64
|
if [ "$SPC_USE_ARCH" = "" ]; then
|
||||||
fi
|
|
||||||
if [ -z "$SPC_USE_ARCH" ]; then
|
|
||||||
SPC_USE_ARCH=$CURRENT_ARCH
|
|
||||||
fi
|
|
||||||
# parse SPC_USE_ARCH
|
|
||||||
case $SPC_USE_ARCH in
|
|
||||||
x86_64|amd64)
|
|
||||||
SPC_USE_ARCH=x86_64
|
SPC_USE_ARCH=x86_64
|
||||||
if [ "$CURRENT_ARCH" != "x86_64" ]; then
|
|
||||||
PLATFORM_ARG="--platform linux/amd64"
|
|
||||||
ALPINE_FROM=multiarch/alpine:x86_64-edge
|
|
||||||
fi
|
fi
|
||||||
|
case $SPC_USE_ARCH in
|
||||||
|
x86_64)
|
||||||
|
ALPINE_FROM=alpine:edge
|
||||||
;;
|
;;
|
||||||
aarch64|arm64)
|
aarch64)
|
||||||
SPC_USE_ARCH=aarch64
|
|
||||||
if [ "$CURRENT_ARCH" != "aarch64" ]; then
|
|
||||||
PLATFORM_ARG="--platform linux/arm64"
|
|
||||||
ALPINE_FROM=multiarch/alpine:aarch64-edge
|
ALPINE_FROM=multiarch/alpine:aarch64-edge
|
||||||
fi
|
# shellcheck disable=SC2039
|
||||||
|
echo -e "\e[033m* Using different arch needs to setup qemu-static for docker !\e[0m"
|
||||||
|
$DOCKER_EXECUTABLE run --rm --privileged multiarch/qemu-user-static:register --reset > /dev/null
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Current arch is not supported to run in docker: $SPC_USE_ARCH"
|
echo "Current arch is not supported to run in docker: $SPC_USE_ARCH"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# if ALPINE_FROM is not set, use alpine:3.21
|
|
||||||
if [ -z "$ALPINE_FROM" ]; then
|
|
||||||
ALPINE_FROM=alpine:3.21
|
|
||||||
fi
|
|
||||||
if [ "$SPC_USE_ARCH" != "$CURRENT_ARCH" ]; then
|
|
||||||
echo "* Using different arch needs to setup qemu-static for docker !"
|
|
||||||
ALPINE_FROM=multiarch/alpine:$SPC_USE_ARCH-edge
|
|
||||||
if [ "$(uname -s)" = "Linux" ]; then
|
|
||||||
$DOCKER_EXECUTABLE run --rm --privileged multiarch/qemu-user-static:register --reset > /dev/null
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
ALPINE_FROM=alpine:3.21
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$SPC_USE_MIRROR" = "yes" ]; then
|
if [ "$SPC_USE_MIRROR" = "yes" ]; then
|
||||||
SPC_USE_MIRROR="RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories"
|
SPC_USE_MIRROR="RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories"
|
||||||
@@ -74,13 +50,12 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Detect docker env is setup
|
# Detect docker env is setup
|
||||||
if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION; then
|
if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-$SPC_USE_ARCH; then
|
||||||
echo "Docker container does not exist. Building docker image ..."
|
echo "Docker container does not exist. Building docker image ..."
|
||||||
$DOCKER_EXECUTABLE build $PLATFORM_ARG -t cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION -f- . <<EOF
|
$DOCKER_EXECUTABLE build -t cwcc-spc-$SPC_USE_ARCH -f- . <<EOF
|
||||||
FROM $ALPINE_FROM
|
FROM $ALPINE_FROM
|
||||||
$SPC_USE_MIRROR
|
$SPC_USE_MIRROR
|
||||||
RUN apk update; \
|
RUN apk update; \
|
||||||
apk upgrade -a; \
|
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
autoconf \
|
autoconf \
|
||||||
automake \
|
automake \
|
||||||
@@ -103,33 +78,26 @@ RUN apk update; \
|
|||||||
linux-headers \
|
linux-headers \
|
||||||
m4 \
|
m4 \
|
||||||
make \
|
make \
|
||||||
|
php82 \
|
||||||
|
php82-common \
|
||||||
|
php82-pcntl \
|
||||||
|
php82-phar \
|
||||||
|
php82-posix \
|
||||||
|
php82-sodium \
|
||||||
|
php82-tokenizer \
|
||||||
|
php82-dom \
|
||||||
|
php82-xml \
|
||||||
|
php82-xmlwriter \
|
||||||
|
composer \
|
||||||
pkgconfig \
|
pkgconfig \
|
||||||
re2c \
|
|
||||||
wget \
|
wget \
|
||||||
xz \
|
xz
|
||||||
gettext-dev \
|
|
||||||
binutils-gold
|
|
||||||
|
|
||||||
RUN curl -#fSL https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-linux-\$(uname -m).tar.gz | tar -xz -C /usr/local/bin && \
|
|
||||||
chmod +x /usr/local/bin/php
|
|
||||||
|
|
||||||
RUN curl -#fSL https://getcomposer.org/download/latest-stable/composer.phar -o /usr/local/bin/composer && \
|
|
||||||
chmod +x /usr/local/bin/composer
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ADD ./src /app/src
|
ADD ./src /app/src
|
||||||
COPY ./composer.* /app/
|
COPY ./composer.* /app/
|
||||||
ADD ./bin /app/bin
|
ADD ./bin /app/bin
|
||||||
RUN composer install --no-dev
|
RUN composer install --no-dev --classmap-authoritative
|
||||||
ADD ./config /app/config
|
|
||||||
ADD ./spc.registry.yml /app/spc.registry.yml
|
|
||||||
RUN bin/spc doctor --auto-fix
|
|
||||||
RUN bin/spc install-pkg upx
|
|
||||||
|
|
||||||
RUN mv /app/pkgroot/\$(uname -m)-linux /app/pkgroot-private
|
|
||||||
ADD bin/docker-entrypoint.sh /bin/docker-entrypoint.sh
|
|
||||||
RUN chmod +x /bin/docker-entrypoint.sh
|
|
||||||
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
|
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -140,89 +108,6 @@ else
|
|||||||
INTERACT=''
|
INTERACT=''
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Mounting volumes
|
|
||||||
MOUNT_LIST=""
|
|
||||||
# shellcheck disable=SC2089
|
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/config:/app/config"
|
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/src:/app/src"
|
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/buildroot:/app/buildroot"
|
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/source:/app/source"
|
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/app/dist"
|
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/downloads:/app/downloads"
|
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/pkgroot:/app/pkgroot"
|
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/log:/app/log"
|
|
||||||
if [ -f "$(pwd)/craft.yml" ]; then
|
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/craft.yml:/app/craft.yml"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Environment variable passthrough
|
|
||||||
ENV_LIST=""
|
|
||||||
ENV_LIST="$ENV_LIST -e SPC_FIX_DEPLOY_ROOT="$(pwd)""
|
|
||||||
if [ ! -z "$GITHUB_TOKEN" ]; then
|
|
||||||
ENV_LIST="$ENV_LIST -e GITHUB_TOKEN=$GITHUB_TOKEN"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Intercept and rewrite --with-frankenphp-app option, and mount host path to /app/app
|
|
||||||
FRANKENPHP_APP_PATH=""
|
|
||||||
NEW_ARGS=()
|
|
||||||
while [ $# -gt 0 ]; do
|
|
||||||
case "$1" in
|
|
||||||
--with-frankenphp-app=*)
|
|
||||||
FRANKENPHP_APP_PATH="${1#*=}"
|
|
||||||
NEW_ARGS+=("--with-frankenphp-app=/app/app")
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--with-frankenphp-app)
|
|
||||||
if [ -n "${2:-}" ]; then
|
|
||||||
FRANKENPHP_APP_PATH="$2"
|
|
||||||
NEW_ARGS+=("--with-frankenphp-app=/app/app")
|
|
||||||
shift 2
|
|
||||||
else
|
|
||||||
NEW_ARGS+=("$1")
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
NEW_ARGS+=("$1")
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# Normalize the path and add mount if provided
|
|
||||||
if [ -n "$FRANKENPHP_APP_PATH" ]; then
|
|
||||||
# expand ~ to $HOME
|
|
||||||
if [ "${FRANKENPHP_APP_PATH#~}" != "$FRANKENPHP_APP_PATH" ]; then
|
|
||||||
FRANKENPHP_APP_PATH="$HOME${FRANKENPHP_APP_PATH#~}"
|
|
||||||
fi
|
|
||||||
# make absolute if relative
|
|
||||||
case "$FRANKENPHP_APP_PATH" in
|
|
||||||
/*) ABS_APP_PATH="$FRANKENPHP_APP_PATH" ;;
|
|
||||||
*) ABS_APP_PATH="$(pwd)/$FRANKENPHP_APP_PATH" ;;
|
|
||||||
esac
|
|
||||||
MOUNT_LIST="$MOUNT_LIST -v $ABS_APP_PATH:/app/app"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Run docker
|
# Run docker
|
||||||
# shellcheck disable=SC2068
|
# shellcheck disable=SC2068
|
||||||
# shellcheck disable=SC2086
|
$DOCKER_EXECUTABLE run --rm $INTERACT -e SPC_FIX_DEPLOY_ROOT="$(pwd)" -v "$(pwd)"/config:/app/config -v "$(pwd)"/src:/app/src -v "$(pwd)"/buildroot:/app/buildroot -v "$(pwd)"/source:/app/source -v "$(pwd)"/downloads:/app/downloads cwcc-spc-$SPC_USE_ARCH bin/spc $@
|
||||||
# shellcheck disable=SC2090
|
|
||||||
if [ "$SPC_DOCKER_DEBUG" = "yes" ]; then
|
|
||||||
echo "* Debug mode enabled, run docker in interactive mode."
|
|
||||||
echo "* You can use 'exit' to exit the docker container."
|
|
||||||
echo "* You can use 'bin/spc' like normal builds."
|
|
||||||
echo "*"
|
|
||||||
echo "* Mounted directories:"
|
|
||||||
echo "* ./config: $(pwd)/config"
|
|
||||||
echo "* ./src: $(pwd)/src"
|
|
||||||
echo "* ./buildroot: $(pwd)/buildroot"
|
|
||||||
echo "* ./source: $(pwd)/source"
|
|
||||||
echo "* ./dist: $(pwd)/dist"
|
|
||||||
echo "* ./downloads: $(pwd)/downloads"
|
|
||||||
echo "* ./pkgroot: $(pwd)/pkgroot"
|
|
||||||
echo "*"
|
|
||||||
set -ex
|
|
||||||
$DOCKER_EXECUTABLE run $PLATFORM_ARG --rm $INTERACT $ENV_LIST $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION /bin/bash
|
|
||||||
else
|
|
||||||
$DOCKER_EXECUTABLE run $PLATFORM_ARG --rm $INTERACT $ENV_LIST $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION bin/spc "${NEW_ARGS[@]}"
|
|
||||||
fi
|
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Use SPC_XDEBUG=profile to enable Xdebug profiling mode, which will generate profiling files in /tmp.
|
|
||||||
# Otherwise, it will enable Xdebug debugging mode, which allows you to connect a debugger to port 9003.
|
|
||||||
if [ "$SPC_XDEBUG" = "profile" ]; then
|
|
||||||
XDEBUG_PREFIX="-d xdebug.mode=profile -d xdebug.start_with_request=yes -d xdebug.output_dir=/tmp -d xdebug.output_name=spc-profile.%t.%p.%r"
|
|
||||||
else
|
|
||||||
XDEBUG_PREFIX="-d xdebug.mode=debug -d xdebug.client_host=127.0.0.1 -d xdebug.client_port=9003 -d xdebug.start_with_request=yes"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# This script runs the 'spc' command with Xdebug enabled for debugging purposes.
|
|
||||||
php $XDEBUG_PREFIX "$(dirname "$0")/../bin/spc" "$@"
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
$PHP_Exec = ".\runtime\php.exe"
|
|
||||||
|
|
||||||
if (-not(Test-Path $PHP_Exec)) {
|
|
||||||
$PHP_Exec = Get-Command php.exe -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Definition
|
|
||||||
if (-not $PHP_Exec) {
|
|
||||||
Write-Host "Error: PHP not found, you need to install PHP on your system or use 'bin/setup-runtime'." -ForegroundColor Red
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
& "$PHP_Exec" -d xdebug.mode=debug -d xdebug.client_host=127.0.0.1 -d xdebug.client_port=9003 -d xdebug.start_with_request=yes ("bin/spc") @args
|
|
||||||
exit $LASTEXITCODE
|
|
||||||
12
bin/spc.ps1
12
bin/spc.ps1
@@ -1,12 +0,0 @@
|
|||||||
$PHP_Exec = ".\runtime\php.exe"
|
|
||||||
|
|
||||||
if (-not(Test-Path $PHP_Exec)) {
|
|
||||||
$PHP_Exec = Get-Command php.exe -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Definition
|
|
||||||
if (-not $PHP_Exec) {
|
|
||||||
Write-Host "Error: PHP not found, you need to install PHP on your system or use 'bin/setup-runtime'." -ForegroundColor Red
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
& "$PHP_Exec" ("bin/spc") @args
|
|
||||||
exit $LASTEXITCODE
|
|
||||||
9
box.json
9
box.json
@@ -4,19 +4,16 @@
|
|||||||
"blacklist": [
|
"blacklist": [
|
||||||
".github"
|
".github"
|
||||||
],
|
],
|
||||||
"compression": "GZ",
|
|
||||||
"check-requirements": false,
|
|
||||||
"directories": [
|
"directories": [
|
||||||
"config",
|
"config",
|
||||||
"src",
|
"src",
|
||||||
"vendor/psr",
|
"vendor/psr",
|
||||||
|
"vendor/laravel/prompts",
|
||||||
|
"vendor/illuminate",
|
||||||
"vendor/symfony",
|
"vendor/symfony",
|
||||||
"vendor/php-di",
|
|
||||||
"vendor/zhamao"
|
"vendor/zhamao"
|
||||||
],
|
],
|
||||||
"files": [
|
|
||||||
"spc.registry.yml"
|
|
||||||
],
|
|
||||||
"git-commit-short": "git_commit_short",
|
"git-commit-short": "git_commit_short",
|
||||||
|
"metadata": "ConsoleApplication::VERSION",
|
||||||
"output": "spc.phar"
|
"output": "spc.phar"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"enabled": true,
|
"enabled": true,
|
||||||
"actions": [
|
"actions": [
|
||||||
{
|
{
|
||||||
"action": "php vendor/bin/phpstan analyse --memory-limit 300M"
|
"action": "composer analyse"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -11,22 +11,13 @@
|
|||||||
"enabled": true,
|
"enabled": true,
|
||||||
"actions": [
|
"actions": [
|
||||||
{
|
{
|
||||||
"action": "php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --diff {$STAGED_FILES|of-type:php} --sequential",
|
"action": "composer cs-fix -- --config=.php-cs-fixer.php --dry-run --diff {$STAGED_FILES|of-type:php}",
|
||||||
"conditions": [
|
"conditions": [
|
||||||
{
|
{
|
||||||
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\OfType",
|
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\OfType",
|
||||||
"args": ["php"]
|
"args": ["php"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"action": "php bin/spc dev:lint-config --check",
|
|
||||||
"conditions": [
|
|
||||||
{
|
|
||||||
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\InDirectory",
|
|
||||||
"args": ["config"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,26 +9,25 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.4",
|
"php": ">= 8.1",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-zlib": "*",
|
"ext-pcntl": "*",
|
||||||
"php-di/php-di": "^7.1",
|
"laravel/prompts": "^0.1.12",
|
||||||
"symfony/console": "^5.4 || ^6 || ^7",
|
"symfony/console": "^5.4 || ^6 || ^7",
|
||||||
"symfony/yaml": "^7.2",
|
"zhamao/logger": "^1.0"
|
||||||
"zhamao/logger": "^1.1.4"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"captainhook/captainhook-phar": "^5.23",
|
"captainhook/captainhook": "^5.10",
|
||||||
"captainhook/hook-installer": "^1.0",
|
"captainhook/plugin-composer": "^5.3",
|
||||||
"friendsofphp/php-cs-fixer": "^3.60",
|
"friendsofphp/php-cs-fixer": "^3.25",
|
||||||
"humbug/box": "^4.5.0 || ^4.6.0",
|
"humbug/box": "^4.3",
|
||||||
"phpstan/phpstan": "^2.1",
|
"nunomaduro/collision": "^7.8",
|
||||||
"phpunit/phpunit": "^10.3 || ^9.5"
|
"phpstan/phpstan": "^1.10",
|
||||||
|
"phpunit/phpunit": "^10.3"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"StaticPHP\\": "src/StaticPHP",
|
"SPC\\": "src/SPC"
|
||||||
"Package\\": "src/Package"
|
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"src/globals/defines.php",
|
"src/globals/defines.php",
|
||||||
@@ -37,7 +36,7 @@
|
|||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Tests\\StaticPHP\\": "tests/StaticPHP"
|
"SPC\\Tests\\": "tests/SPC"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bin": [
|
"bin": [
|
||||||
@@ -46,27 +45,15 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"analyse": "phpstan analyse --memory-limit 300M",
|
"analyse": "phpstan analyse --memory-limit 300M",
|
||||||
"cs-fix": "php-cs-fixer fix",
|
"cs-fix": "php-cs-fixer fix",
|
||||||
"lint-config": "php bin/spc dev:lint-config",
|
|
||||||
"test": "vendor/bin/phpunit tests/ --no-coverage",
|
"test": "vendor/bin/phpunit tests/ --no-coverage",
|
||||||
"build:phar": "vendor/bin/box compile"
|
"build:phar": "vendor/bin/box compile"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"allow-plugins": {
|
"allow-plugins": {
|
||||||
"phpstan/extension-installer": true,
|
"phpstan/extension-installer": true,
|
||||||
"captainhook/hook-installer": true,
|
"captainhook/plugin-composer": true
|
||||||
"captainhook/plugin-composer": true,
|
|
||||||
"captainhook/captainhook-phar": true
|
|
||||||
},
|
},
|
||||||
"optimize-autoloader": true,
|
"optimize-autoloader": true,
|
||||||
"sort-packages": true
|
"sort-packages": true
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"ext-yaml": "Speeds up YAML config file parsing"
|
|
||||||
},
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"type": "other",
|
|
||||||
"url": "https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md"
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
4583
composer.lock
generated
4583
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,9 +0,0 @@
|
|||||||
glfw:
|
|
||||||
metadata:
|
|
||||||
license-files:
|
|
||||||
- LICENSE
|
|
||||||
license: MIT
|
|
||||||
source:
|
|
||||||
type: git
|
|
||||||
url: 'https://github.com/mario-deluna/php-glfw'
|
|
||||||
rev: master
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
musl-wrapper:
|
|
||||||
source: 'https://musl.libc.org/releases/musl-1.2.5.tar.gz'
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
ncurses:
|
|
||||||
metadata:
|
|
||||||
license-files:
|
|
||||||
- COPYING
|
|
||||||
source:
|
|
||||||
type: filelist
|
|
||||||
url: 'https://ftp.gnu.org/gnu/ncurses/'
|
|
||||||
regex: '/href="(?<file>ncurses-(?<version>[^"]+)\.tar\.gz)"/'
|
|
||||||
source-mirror:
|
|
||||||
type: filelist
|
|
||||||
url: 'https://ftpmirror.gnu.org/gnu/ncurses/'
|
|
||||||
regex: '/href="(?<file>ncurses-(?<version>[^"]+)\.tar\.gz)"/'
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
php-src:
|
|
||||||
metadata:
|
|
||||||
license-files:
|
|
||||||
- LICENSE
|
|
||||||
license: PHP-3.01
|
|
||||||
source:
|
|
||||||
type: php-release
|
|
||||||
domain: 'https://www.php.net'
|
|
||||||
source-mirror:
|
|
||||||
type: php-release
|
|
||||||
domain: 'https://phpmirror.static-php.dev'
|
|
||||||
171
config/env.ini
171
config/env.ini
@@ -1,171 +0,0 @@
|
|||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
; static-php-cli (spc) env configuration
|
|
||||||
;
|
|
||||||
; This file is used to set default env vars for static-php-cli build.
|
|
||||||
; As dynamic build process, some of these vars can be overwritten by CLI options.
|
|
||||||
; And you can also overwrite these vars by setting them in your shell environment.
|
|
||||||
; The value should be changed only if you know what you are doing. Otherwise, please leave them as default.
|
|
||||||
;
|
|
||||||
; We need to use some pre-defined internal env vars, like `BUILD_ROOT_PATH`, `DOWNLOAD_PATH`, etc.
|
|
||||||
; Please note that these vars cannot be defined in this file, they should only be defined before static-php-cli running.
|
|
||||||
;
|
|
||||||
; Here's a list of env vars, these variables will be defined if not defined:
|
|
||||||
;
|
|
||||||
; BUILD_ROOT_PATH: the root path of the build process. (default: `$(pwd)/buildroot`)
|
|
||||||
; BUILD_INCLUDE_PATH: the path of the include files. (default: `$BUILD_ROOT_PATH/include`)
|
|
||||||
; BUILD_LIB_PATH: the path of the lib files. (default: `$BUILD_ROOT_PATH/lib`)
|
|
||||||
; BUILD_BIN_PATH: the path of the bin files. (default: `$BUILD_ROOT_PATH/bin`)
|
|
||||||
; BUILD_MODULES_PATH: the path of the php modules (shared extensions) files. (default: `$BUILD_ROOT_PATH/modules`)
|
|
||||||
; PKG_ROOT_PATH: the root path of the package files. (default: `$(pwd)/pkgroot/$GNU_ARCH-{darwin|linux|windows}`)
|
|
||||||
; SOURCE_PATH: the path of the source files. (default: `$(pwd)/source`)
|
|
||||||
; DOWNLOAD_PATH: the path of the download files. (default: `$(pwd)/downloads`)
|
|
||||||
; PATH: (*nix only) static-php-cli will add `$BUILD_BIN_PATH` to PATH.
|
|
||||||
; PKG_CONFIG_PATH: (*nix only) static-php-cli will set `$BUILD_LIB_PATH/pkgconfig` to PKG_CONFIG_PATH.
|
|
||||||
;
|
|
||||||
; Here's a list of env vars, these variables is defined in SPC and cannot be changed anywhere:
|
|
||||||
;
|
|
||||||
; SPC_VERSION: the version of static-php-cli.
|
|
||||||
; WORKING_DIR: the working directory of the build process. (default: `$(pwd)`)
|
|
||||||
; ROOT_DIR: the root directory of static-php-cli. (default: `/path/to/static-php-cli`, when running in phar or micro mode: `phar://path/to/spc.phar`)
|
|
||||||
; CPU_COUNT: the count of the CPU cores. (default: `$(nproc)`)
|
|
||||||
; SPC_ARCH: the arch of the current system, for some libraries needed `--host=XXX` args. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`, `arm64`)
|
|
||||||
; GNU_ARCH: the GNU arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`)
|
|
||||||
; MAC_ARCH: the MAC arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `arm64`)
|
|
||||||
; PKG_CONFIG: (*nix only) static-php-cli will set `$BUILD_BIN_PATH/pkg-config` to PKG_CONFIG.
|
|
||||||
; SPC_DEFAULT_CC: (*nix only) the default compiler for selected toolchain.
|
|
||||||
; SPC_DEFAULT_CXX: (*nix only) the default c++ compiler selected toolchain.
|
|
||||||
; SPC_DEFAULT_AR: (*nix only) the default archiver for selected toolchain.
|
|
||||||
; SPC_DEFAULT_LD: (*nix only) the default linker for selected toolchain.
|
|
||||||
; SPC_EXTRA_PHP_VARS: (linux only) the extra vars for building php, used in `configure` and `make` command.
|
|
||||||
|
|
||||||
[global]
|
|
||||||
; Build concurrency for make -jN, default is CPU_COUNT, this value are used in every libs.
|
|
||||||
SPC_CONCURRENCY=${CPU_COUNT}
|
|
||||||
; Ignore PHP version check before building some extensions
|
|
||||||
SPC_SKIP_PHP_VERSION_CHECK="no"
|
|
||||||
; Ignore some check item for bin/spc doctor command, comma separated (e.g. SPC_SKIP_DOCTOR_CHECK_ITEMS="if homebrew has installed")
|
|
||||||
SPC_SKIP_DOCTOR_CHECK_ITEMS=""
|
|
||||||
; extra modules that xcaddy will include in the FrankenPHP build
|
|
||||||
SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES="--with github.com/dunglas/mercure/caddy --with github.com/dunglas/vulcain/caddy --with github.com/dunglas/caddy-cbrotli"
|
|
||||||
; The display message for php version output (PHP >= 8.4 available)
|
|
||||||
PHP_BUILD_PROVIDER="StaticPHP ${SPC_VERSION}"
|
|
||||||
; Whether to enable log file (if you are using vendor mode)
|
|
||||||
SPC_ENABLE_LOG_FILE="yes"
|
|
||||||
; The LOG DIR for spc logs
|
|
||||||
SPC_LOGS_DIR="${WORKING_DIR}/log"
|
|
||||||
; Preserve old logs when running new builds (code checks SPC_PRESERVE_LOG, not SPC_PRESERVE_LOGS)
|
|
||||||
SPC_PRESERVE_LOG="no"
|
|
||||||
|
|
||||||
; EXTENSION_DIR where the built php will look for extension when a .ini instructs to load them
|
|
||||||
; only useful for builds targeting not pure-static linking
|
|
||||||
; default paths
|
|
||||||
; Ubuntu/Debian: /usr/lib/php/{PHP_VERSION}/
|
|
||||||
; RHEL: /usr/lib64/php/modules
|
|
||||||
; Alpine: /usr/lib/php{PHP_VERSION}/modules
|
|
||||||
; where {PHP_VERSION} is 84 for php 8.4
|
|
||||||
; EXTENSION_DIR=
|
|
||||||
|
|
||||||
[windows]
|
|
||||||
; build target: win7-static
|
|
||||||
SPC_TARGET=native-windows
|
|
||||||
; MSYS2 root directory (msys64 subfolder), used by the Windows toolchain
|
|
||||||
SPC_MSYS2_PATH="${PKG_ROOT_PATH}\msys2-build-essentials\msys64"
|
|
||||||
; upx executable path
|
|
||||||
UPX_EXEC="${PKG_ROOT_PATH}\bin\upx.exe"
|
|
||||||
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
|
||||||
SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream,cli_static,win32_api
|
|
||||||
|
|
||||||
[linux]
|
|
||||||
; Linux can use different build toolchains.
|
|
||||||
; - musl (default, when SPC_LIBC=musl): used for general linux distros, can build `musl` (statically linked) only.
|
|
||||||
; - zig (will become default): usable on all Linux distros, can build `-musl`, `arch-linux-musl -dynamic` and `arch-linux-gnu` targets. Can specify version such as `x86_64-linux-gnu.2.17`.
|
|
||||||
; - musl-native: used for alpine linux, can build `musl` and `musl -dynamic` target.
|
|
||||||
; - gnu-native: used for general linux distros, can build gnu target for the installed glibc version only.
|
|
||||||
|
|
||||||
; option to specify the target, superceded by SPC_TARGET if set
|
|
||||||
; SPC_LIBC=musl
|
|
||||||
; uncomment to link libc dynamically on musl
|
|
||||||
; SPC_MUSL_DYNAMIC=true
|
|
||||||
|
|
||||||
; Recommended: specify your target here. Zig toolchain will be used.
|
|
||||||
; examples:
|
|
||||||
; `native-native-gnu` - links against glibc, current OS version
|
|
||||||
; `native-native-gnu.2.17` - links against glibc, version 2.17
|
|
||||||
; `native-native` - links against system libc dynamically
|
|
||||||
; `native-native-musl` - links against musl libc statically
|
|
||||||
; `native-native-musl -dynamic` - links against musl libc dynamically
|
|
||||||
SPC_TARGET=${GNU_ARCH}-linux-musl
|
|
||||||
|
|
||||||
; compiler environments (default value is defined by selected toolchain)
|
|
||||||
CC=${SPC_DEFAULT_CC}
|
|
||||||
CXX=${SPC_DEFAULT_CXX}
|
|
||||||
AR=${SPC_DEFAULT_AR}
|
|
||||||
LD=${SPC_DEFAULT_LD}
|
|
||||||
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
|
|
||||||
SPC_DEFAULT_CFLAGS="-fPIC -O3 -pipe -fno-plt -fno-semantic-interposition -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffunction-sections -fdata-sections -Wno-unused-command-line-argument"
|
|
||||||
SPC_DEFAULT_CXXFLAGS="${SPC_DEFAULT_CFLAGS}"
|
|
||||||
SPC_DEFAULT_LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -Wl,-z,noexecstack -Wl,--gc-sections"
|
|
||||||
; upx executable path
|
|
||||||
UPX_EXEC=${PKG_ROOT_PATH}/bin/upx
|
|
||||||
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
|
||||||
SPC_MICRO_PATCHES=cli_checks,disable_huge_page
|
|
||||||
|
|
||||||
; *** default build command for building php ***
|
|
||||||
; buildconf command
|
|
||||||
SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
|
|
||||||
; configure command
|
|
||||||
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --disable-shared --enable-static --disable-all --disable-phpdbg --enable-rtld-now --enable-re2c-cgoto --disable-rpath --with-pic"
|
|
||||||
|
|
||||||
; *** default build vars for building php ***
|
|
||||||
; embed type for php, static (libphp.a) or shared (libphp.so)
|
|
||||||
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
|
|
||||||
; EXTRA_CFLAGS for `configure` and `make` php
|
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fPIE -fvisibility=hidden -fvisibility-inlines-hidden ${SPC_DEFAULT_CFLAGS}"
|
|
||||||
; EXTRA_CXXFLAGS for `configure` and `make` php
|
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_CXXFLAGS="-g -fstack-protector-strong -fno-ident -fPIE -fvisibility=hidden -fvisibility-inlines-hidden ${SPC_DEFAULT_CXXFLAGS}"
|
|
||||||
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
|
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""
|
|
||||||
; EXTRA_LDFLAGS_PROGRAM for `make` php; appended only to SAPI executable links (cli/fpm/cgi/micro/embed). Used by PGO to inject -fprofile-use= without polluting libphp.{a,so}.
|
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM=""
|
|
||||||
|
|
||||||
; optional, path to openssl conf. This affects where openssl will look for the default CA.
|
|
||||||
; default on Debian/Alpine: /etc/ssl, default on RHEL: /etc/pki/tls
|
|
||||||
OPENSSLDIR=""
|
|
||||||
|
|
||||||
[macos]
|
|
||||||
; build target: macho or macho (possibly we could support macho-universal in the future)
|
|
||||||
; Currently we do not support universal and cross-compilation for macOS.
|
|
||||||
SPC_TARGET=native-macos
|
|
||||||
; Whether to use brew version of llvm or system version (valid options: 'system', 'brew', default: 'system')
|
|
||||||
SPC_USE_LLVM=system
|
|
||||||
; compiler environments (default value is defined by selected toolchain)
|
|
||||||
CC=${SPC_DEFAULT_CC}
|
|
||||||
CXX=${SPC_DEFAULT_CXX}
|
|
||||||
AR=${SPC_DEFAULT_AR}
|
|
||||||
LD=${SPC_DEFAULT_LD}
|
|
||||||
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
|
|
||||||
SPC_DEFAULT_CFLAGS="--target=${MAC_ARCH}-apple-darwin -O3 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffunction-sections -fdata-sections"
|
|
||||||
SPC_DEFAULT_CXXFLAGS="${SPC_DEFAULT_CFLAGS}"
|
|
||||||
SPC_DEFAULT_LDFLAGS="-Wl,-dead_strip"
|
|
||||||
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
|
||||||
SPC_MICRO_PATCHES=cli_checks,macos_iconv
|
|
||||||
|
|
||||||
; *** default build command for building php ***
|
|
||||||
; buildconf command
|
|
||||||
SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
|
|
||||||
; configure command
|
|
||||||
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --disable-shared --enable-static --disable-all --disable-phpdbg --enable-rtld-now --enable-re2c-cgoto --disable-rpath --with-pic"
|
|
||||||
|
|
||||||
; *** default build vars for building php ***
|
|
||||||
; embed type for php, static (libphp.a) or shared (libphp.dylib)
|
|
||||||
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
|
|
||||||
; EXTRA_CFLAGS for `configure` and `make` php
|
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -fvisibility=hidden -fvisibility-inlines-hidden -Werror=unknown-warning-option ${SPC_DEFAULT_CFLAGS}"
|
|
||||||
; EXTRA_CXXFLAGS for `configure` and `make` php
|
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_CXXFLAGS="-g -fstack-protector-strong -fno-ident -fpie -fvisibility=hidden -fvisibility-inlines-hidden -Werror=unknown-warning-option ${SPC_DEFAULT_CXXFLAGS}"
|
|
||||||
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.dylib
|
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""
|
|
||||||
; EXTRA_LDFLAGS_PROGRAM for `make` php; appended only to SAPI executable links (cli/fpm/cgi/micro/embed). Used by PGO to inject -fprofile-use= without polluting libphp.{a,dylib}.
|
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM=""
|
|
||||||
; minimum compatible macOS version (LLVM vars, availability not guaranteed)
|
|
||||||
MACOSX_DEPLOYMENT_TARGET=12.0
|
|
||||||
562
config/ext.json
Normal file
562
config/ext.json
Normal file
@@ -0,0 +1,562 @@
|
|||||||
|
{
|
||||||
|
"apcu": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "apcu"
|
||||||
|
},
|
||||||
|
"bcmath": {
|
||||||
|
"type": "builtin"
|
||||||
|
},
|
||||||
|
"bz2": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"bzip2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"calendar": {
|
||||||
|
"type": "builtin"
|
||||||
|
},
|
||||||
|
"crypto": {
|
||||||
|
"type": "external",
|
||||||
|
"arg-type": "with",
|
||||||
|
"source": "ext-crypto",
|
||||||
|
"lib-depends": [
|
||||||
|
"openssl"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ctype": {
|
||||||
|
"type": "builtin"
|
||||||
|
},
|
||||||
|
"curl": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with",
|
||||||
|
"lib-depends": [
|
||||||
|
"curl"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dba": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type-windows": "with"
|
||||||
|
},
|
||||||
|
"dom": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"arg-type-windows": "with",
|
||||||
|
"lib-depends": [
|
||||||
|
"libxml2",
|
||||||
|
"zlib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"event": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-event",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-depends": [
|
||||||
|
"libevent"
|
||||||
|
],
|
||||||
|
"ext-depends": [
|
||||||
|
"openssl"
|
||||||
|
],
|
||||||
|
"ext-suggests": [
|
||||||
|
"sockets"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"exif": {
|
||||||
|
"type": "builtin"
|
||||||
|
},
|
||||||
|
"ffi": {
|
||||||
|
"arg-type": "custom",
|
||||||
|
"type": "builtin",
|
||||||
|
"lib-depends": [
|
||||||
|
"libffi"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"fileinfo": {
|
||||||
|
"type": "builtin"
|
||||||
|
},
|
||||||
|
"filter": {
|
||||||
|
"type": "builtin"
|
||||||
|
},
|
||||||
|
"ftp": {
|
||||||
|
"type": "builtin",
|
||||||
|
"lib-suggests": [
|
||||||
|
"openssl"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"gd": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"arg-type-windows": "with",
|
||||||
|
"lib-depends": [
|
||||||
|
"zlib",
|
||||||
|
"libpng"
|
||||||
|
],
|
||||||
|
"ext-depends": [
|
||||||
|
"zlib"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"libavif",
|
||||||
|
"libwebp",
|
||||||
|
"libjpeg",
|
||||||
|
"freetype"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"gettext": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with",
|
||||||
|
"lib-depends": [
|
||||||
|
"gettext"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"glfw": {
|
||||||
|
"type": "external",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"source": "ext-glfw",
|
||||||
|
"lib-depends": [
|
||||||
|
"glfw"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"gmp": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"gmp"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"iconv": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"libiconv"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"igbinary": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "igbinary"
|
||||||
|
},
|
||||||
|
"imagick": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-imagick",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-depends": [
|
||||||
|
"imagemagick"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"imap": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-depends": [
|
||||||
|
"imap"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"openssl"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"inotify": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "inotify"
|
||||||
|
},
|
||||||
|
"intl": {
|
||||||
|
"type": "builtin",
|
||||||
|
"lib-depends": [
|
||||||
|
"icu"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ldap": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"ldap"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"gmp",
|
||||||
|
"libsodium"
|
||||||
|
],
|
||||||
|
"ext-suggests": [
|
||||||
|
"openssl"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"leveldb": {
|
||||||
|
"type": "external",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"source": "pmmp-leveldb",
|
||||||
|
"lib-depends": [
|
||||||
|
"leveldb"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mbregex": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"ext-depends": [
|
||||||
|
"mbstring"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"onig"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mbstring": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom"
|
||||||
|
},
|
||||||
|
"memcache": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-memcache",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-depends": [
|
||||||
|
"zlib"
|
||||||
|
],
|
||||||
|
"ext-depends": [
|
||||||
|
"session"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"memcached": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "memcached",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"cpp-extension": true,
|
||||||
|
"lib-depends": [
|
||||||
|
"libmemcached"
|
||||||
|
],
|
||||||
|
"ext-depends": [
|
||||||
|
"session",
|
||||||
|
"zlib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mongodb": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "mongodb",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-suggests": [
|
||||||
|
"icu",
|
||||||
|
"openssl",
|
||||||
|
"zstd",
|
||||||
|
"zlib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"morton": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-morton"
|
||||||
|
},
|
||||||
|
"mysqli": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with",
|
||||||
|
"ext-depends": [
|
||||||
|
"mysqlnd"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mysqlnd": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type-windows": "with",
|
||||||
|
"lib-depends": [
|
||||||
|
"zlib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"opcache": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom"
|
||||||
|
},
|
||||||
|
"openssl": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-depends": [
|
||||||
|
"openssl",
|
||||||
|
"zlib"
|
||||||
|
],
|
||||||
|
"ext-depends": [
|
||||||
|
"zlib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"password-argon2": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"libargon2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"pcntl": {
|
||||||
|
"type": "builtin",
|
||||||
|
"unix-only": true
|
||||||
|
},
|
||||||
|
"pdo": {
|
||||||
|
"type": "builtin"
|
||||||
|
},
|
||||||
|
"pdo_mysql": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with",
|
||||||
|
"ext-depends": [
|
||||||
|
"pdo",
|
||||||
|
"mysqlnd"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"pdo_pgsql": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"ext-depends": [
|
||||||
|
"pdo",
|
||||||
|
"pgsql"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"postgresql"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"pdo_sqlite": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with",
|
||||||
|
"ext-depends": [
|
||||||
|
"pdo",
|
||||||
|
"sqlite3"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"sqlite"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"pgsql": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"postgresql"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"phar": {
|
||||||
|
"type": "builtin",
|
||||||
|
"ext-depends": [
|
||||||
|
"zlib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"pmmp-chunkutils2": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "pmmp-chunkutils2",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"cpp-extension": true
|
||||||
|
},
|
||||||
|
"pmmpthread": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "pmmpthread"
|
||||||
|
},
|
||||||
|
"posix": {
|
||||||
|
"type": "builtin",
|
||||||
|
"unix-only": true
|
||||||
|
},
|
||||||
|
"protobuf": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "protobuf"
|
||||||
|
},
|
||||||
|
"pspell": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with",
|
||||||
|
"lib-depends": [
|
||||||
|
"aspell"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"rar": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "rar",
|
||||||
|
"cpp-extension": true
|
||||||
|
},
|
||||||
|
"readline": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"readline"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"redis": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "redis",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"ext-suggests": [
|
||||||
|
"session"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"session": {
|
||||||
|
"type": "builtin"
|
||||||
|
},
|
||||||
|
"shmop": {
|
||||||
|
"type": "builtin"
|
||||||
|
},
|
||||||
|
"simplexml": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"arg-type-windows": "with",
|
||||||
|
"lib-depends": [
|
||||||
|
"libxml2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"snappy": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-snappy",
|
||||||
|
"cpp-extension": true,
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-depends": [
|
||||||
|
"snappy"
|
||||||
|
],
|
||||||
|
"ext-suggest": [
|
||||||
|
"apcu"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"snmp": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with",
|
||||||
|
"lib-depends": [
|
||||||
|
"net-snmp"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"soap": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-depends": [
|
||||||
|
"libxml2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sockets": {
|
||||||
|
"type": "builtin"
|
||||||
|
},
|
||||||
|
"sodium": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with",
|
||||||
|
"lib-depends": [
|
||||||
|
"libsodium"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sqlite3": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"sqlite"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ssh2": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-ssh2",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"libssh2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"swoole": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "swoole",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"cpp-extension": true,
|
||||||
|
"lib-depends": [
|
||||||
|
"openssl"
|
||||||
|
],
|
||||||
|
"ext-depends": [
|
||||||
|
"openssl"
|
||||||
|
],
|
||||||
|
"ext-suggests": [
|
||||||
|
"curl",
|
||||||
|
"pgsql"
|
||||||
|
],
|
||||||
|
"unix-only": true
|
||||||
|
},
|
||||||
|
"swow": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "swow",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-suggests": [
|
||||||
|
"openssl",
|
||||||
|
"curl"
|
||||||
|
],
|
||||||
|
"ext-suggests": [
|
||||||
|
"openssl",
|
||||||
|
"curl"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sysvmsg": {
|
||||||
|
"type": "builtin",
|
||||||
|
"unix-only": true
|
||||||
|
},
|
||||||
|
"sysvsem": {
|
||||||
|
"type": "builtin",
|
||||||
|
"unix-only": true
|
||||||
|
},
|
||||||
|
"sysvshm": {
|
||||||
|
"type": "builtin",
|
||||||
|
"unix-only": true
|
||||||
|
},
|
||||||
|
"tidy": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"tidy"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"tokenizer": {
|
||||||
|
"type": "builtin"
|
||||||
|
},
|
||||||
|
"xlswriter": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "xlswriter",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"ext-depends": [
|
||||||
|
"zlib",
|
||||||
|
"zip"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"xml": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"arg-type-windows": "with",
|
||||||
|
"lib-depends": [
|
||||||
|
"libxml2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"xmlreader": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-depends": [
|
||||||
|
"libxml2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"xmlwriter": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-depends": [
|
||||||
|
"libxml2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"xsl": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"libxslt"
|
||||||
|
],
|
||||||
|
"ext-depends": [
|
||||||
|
"xml",
|
||||||
|
"dom"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"yaml": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "yaml",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"libyaml"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"zip": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"arg-type-windows": "enable",
|
||||||
|
"lib-depends": [
|
||||||
|
"libzip"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"zlib": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"arg-type-windows": "enable",
|
||||||
|
"lib-depends": [
|
||||||
|
"zlib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"zstd": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-zstd",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-depends": [
|
||||||
|
"zstd"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
562
config/lib.json
Normal file
562
config/lib.json
Normal file
@@ -0,0 +1,562 @@
|
|||||||
|
{
|
||||||
|
"brotli": {
|
||||||
|
"source": "brotli",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libbrotlidec-static.a",
|
||||||
|
"libbrotlienc-static.a",
|
||||||
|
"libbrotlicommon-static.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
"brotlicommon-static.lib",
|
||||||
|
"brotlienc-static.lib",
|
||||||
|
"brotlidec-static.lib"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"brotli"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"bzip2": {
|
||||||
|
"source": "bzip2",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libbz2.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
[
|
||||||
|
"libbz2.lib",
|
||||||
|
"libbz2_a.lib"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"bzlib.h"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"curl": {
|
||||||
|
"source": "curl",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libcurl.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
"libcurl.lib"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"curl"
|
||||||
|
],
|
||||||
|
"lib-depends-unix": [
|
||||||
|
"openssl",
|
||||||
|
"zlib"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"libssh2",
|
||||||
|
"brotli",
|
||||||
|
"nghttp2",
|
||||||
|
"zstd"
|
||||||
|
],
|
||||||
|
"lib-suggests-windows": [
|
||||||
|
"zlib",
|
||||||
|
"libssh2",
|
||||||
|
"brotli",
|
||||||
|
"nghttp2",
|
||||||
|
"zstd",
|
||||||
|
"openssl",
|
||||||
|
"idn2",
|
||||||
|
"psl"
|
||||||
|
],
|
||||||
|
"frameworks": [
|
||||||
|
"CoreFoundation",
|
||||||
|
"CoreServices",
|
||||||
|
"SystemConfiguration"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"freetype": {
|
||||||
|
"source": "freetype",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libfreetype.a"
|
||||||
|
],
|
||||||
|
"headers-unix": [
|
||||||
|
"freetype2/freetype/freetype.h",
|
||||||
|
"freetype2/ft2build.h"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"zlib"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"libpng",
|
||||||
|
"bzip2",
|
||||||
|
"brotli"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"glfw": {
|
||||||
|
"source": "ext-glfw",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libglfw3.a"
|
||||||
|
],
|
||||||
|
"frameworks": [
|
||||||
|
"CoreVideo",
|
||||||
|
"OpenGL",
|
||||||
|
"Cocoa",
|
||||||
|
"IOKit"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"gmp": {
|
||||||
|
"source": "gmp",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libgmp.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
"libgmp.lib"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"gmp.h"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"icu": {
|
||||||
|
"source": "icu",
|
||||||
|
"cpp-library": true,
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libicui18n.a",
|
||||||
|
"libicuio.a",
|
||||||
|
"libicuuc.a",
|
||||||
|
"libicudata.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"imagemagick": {
|
||||||
|
"source": "imagemagick",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libMagick++-7.Q16HDRI.a",
|
||||||
|
"libMagickWand-7.Q16HDRI.a",
|
||||||
|
"libMagickCore-7.Q16HDRI.a"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"zlib",
|
||||||
|
"libpng",
|
||||||
|
"libjpeg",
|
||||||
|
"libwebp",
|
||||||
|
"freetype"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"zstd",
|
||||||
|
"xz",
|
||||||
|
"bzip2",
|
||||||
|
"libzip",
|
||||||
|
"libxml2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"imap": {
|
||||||
|
"source": "imap",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libc-client.a"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"openssl"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ldap": {
|
||||||
|
"source": "ldap",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"liblber.a",
|
||||||
|
"libldap.a"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"openssl",
|
||||||
|
"zlib",
|
||||||
|
"gmp",
|
||||||
|
"libsodium"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"leveldb": {
|
||||||
|
"source": "leveldb",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libleveldb.a"
|
||||||
|
],
|
||||||
|
"cpp-library": true
|
||||||
|
},
|
||||||
|
"libargon2": {
|
||||||
|
"source": "libargon2",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libargon2.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libavif": {
|
||||||
|
"source": "libavif",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libavif.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libevent": {
|
||||||
|
"source": "libevent",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libevent.a",
|
||||||
|
"libevent_core.a",
|
||||||
|
"libevent_extra.a",
|
||||||
|
"libevent_openssl.a"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"openssl"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libffi": {
|
||||||
|
"source": "libffi",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libffi.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
"libffi.lib"
|
||||||
|
],
|
||||||
|
"headers-unix": [
|
||||||
|
"ffi.h",
|
||||||
|
"ffitarget.h"
|
||||||
|
],
|
||||||
|
"headers-windows": [
|
||||||
|
"ffi.h",
|
||||||
|
"fficonfig.h",
|
||||||
|
"ffitarget.h"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libiconv": {
|
||||||
|
"source": "libiconv",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libiconv.a",
|
||||||
|
"libcharset.a"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"iconv.h",
|
||||||
|
"libcharset.h",
|
||||||
|
"localcharset.h"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libjpeg": {
|
||||||
|
"source": "libjpeg",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libjpeg.a",
|
||||||
|
"libturbojpeg.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libmcrypt": {
|
||||||
|
"source": "libmcrypt",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libmcrypt.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libmemcached": {
|
||||||
|
"source": "libmemcached",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libmemcached.a",
|
||||||
|
"libmemcachedutil.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libpng": {
|
||||||
|
"source": "libpng",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libpng16.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
"libpng16_static.lib"
|
||||||
|
],
|
||||||
|
"headers-unix": [
|
||||||
|
"png.h",
|
||||||
|
"pngconf.h",
|
||||||
|
"pnglibconf.h"
|
||||||
|
],
|
||||||
|
"headers-windows": [
|
||||||
|
"png.h",
|
||||||
|
"pngconf.h"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"zlib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libsodium": {
|
||||||
|
"source": "libsodium",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libsodium.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libssh2": {
|
||||||
|
"source": "libssh2",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libssh2.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
"libssh2.lib"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"libssh2.h",
|
||||||
|
"libssh2_publickey.h",
|
||||||
|
"libssh2_sftp.h"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"openssl"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"zlib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libwebp": {
|
||||||
|
"source": "libwebp",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libwebp.a",
|
||||||
|
"libwebpdecoder.a",
|
||||||
|
"libwebpdemux.a",
|
||||||
|
"libwebpmux.a",
|
||||||
|
"libsharpyuv.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libxml2": {
|
||||||
|
"source": "libxml2",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libxml2.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
[
|
||||||
|
"libxml2s.lib",
|
||||||
|
"libxml2_a.lib"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"libxml2"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"libiconv",
|
||||||
|
"zlib"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"xz",
|
||||||
|
"icu"
|
||||||
|
],
|
||||||
|
"lib-suggests-windows": [
|
||||||
|
"icu",
|
||||||
|
"xz"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libxslt": {
|
||||||
|
"source": "libxslt",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libxslt.a",
|
||||||
|
"libexslt.a"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"libxml2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libyaml": {
|
||||||
|
"source": "libyaml",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libyaml.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
"yaml.lib"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"yaml.h"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"libzip": {
|
||||||
|
"source": "libzip",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libzip.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
[
|
||||||
|
"zip.lib",
|
||||||
|
"libzip_a.lib"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"zip.h",
|
||||||
|
"zipconf.h"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"zlib"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"bzip2",
|
||||||
|
"xz",
|
||||||
|
"zstd",
|
||||||
|
"openssl"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mcrypt": {
|
||||||
|
"source": "mcrypt",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libmcrypt.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ncurses": {
|
||||||
|
"source": "ncurses",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libncurses.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nghttp2": {
|
||||||
|
"source": "nghttp2",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libnghttp2.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
"nghttp2.lib"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"nghttp2"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"zlib",
|
||||||
|
"openssl"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"libxml2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"onig": {
|
||||||
|
"source": "onig",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libonig.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
[
|
||||||
|
"onig.lib",
|
||||||
|
"onig_a.lib"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"oniggnu.h",
|
||||||
|
"oniguruma.h"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"openssl": {
|
||||||
|
"source": "openssl",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libssl.a",
|
||||||
|
"libcrypto.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
"libssl.lib",
|
||||||
|
"libcrypto.lib"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"openssl"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"zlib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"pkg-config": {
|
||||||
|
"source": "pkg-config"
|
||||||
|
},
|
||||||
|
"postgresql": {
|
||||||
|
"source": "postgresql",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libpq.a",
|
||||||
|
"libpgport.a",
|
||||||
|
"libpgcommon.a"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"libiconv",
|
||||||
|
"libxml2",
|
||||||
|
"openssl",
|
||||||
|
"zlib",
|
||||||
|
"readline"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"icu",
|
||||||
|
"libxslt",
|
||||||
|
"ldap",
|
||||||
|
"zstd"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"readline": {
|
||||||
|
"source": "readline",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libreadline.a"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"ncurses"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"snappy": {
|
||||||
|
"source": "snappy",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libsnappy.a"
|
||||||
|
],
|
||||||
|
"headers-unix": [
|
||||||
|
"snappy.h",
|
||||||
|
"snappy-c.h",
|
||||||
|
"snappy-sinksource.h",
|
||||||
|
"snappy-stubs-public.h"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"zlib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sqlite": {
|
||||||
|
"source": "sqlite",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libsqlite3.a"
|
||||||
|
],
|
||||||
|
"headers-unix": [
|
||||||
|
"sqlite3.h",
|
||||||
|
"sqlite3ext.h"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"tidy": {
|
||||||
|
"source": "tidy",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libtidy.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"xz": {
|
||||||
|
"source": "xz",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"liblzma.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
[
|
||||||
|
"liblzma.lib",
|
||||||
|
"liblzma_a.lib"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"headers-unix": [
|
||||||
|
"lzma"
|
||||||
|
],
|
||||||
|
"headers-windows": [
|
||||||
|
"lzma",
|
||||||
|
"lzma.h"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"libiconv"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"zlib": {
|
||||||
|
"source": "zlib",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libz.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
"zlib_a.lib"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"zlib.h",
|
||||||
|
"zconf.h"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"zstd": {
|
||||||
|
"source": "zstd",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libzstd.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
[
|
||||||
|
"zstd.lib",
|
||||||
|
"zstd_static.lib"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"headers-unix": [
|
||||||
|
"zdict.h",
|
||||||
|
"zstd.h",
|
||||||
|
"zstd_errors.h"
|
||||||
|
],
|
||||||
|
"headers-windows": [
|
||||||
|
"zstd.h",
|
||||||
|
"zstd_errors.h"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,380 +0,0 @@
|
|||||||
ext-bcmath:
|
|
||||||
type: php-extension
|
|
||||||
ext-bz2:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- bzip2
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: with-path
|
|
||||||
arg-type@windows: with
|
|
||||||
ext-calendar:
|
|
||||||
type: php-extension
|
|
||||||
ext-com_dotnet:
|
|
||||||
type: php-extension
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Windows
|
|
||||||
arg-type@windows: '--enable-com-dotnet=yes'
|
|
||||||
ext-ctype:
|
|
||||||
type: php-extension
|
|
||||||
ext-curl:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- curl
|
|
||||||
depends@windows:
|
|
||||||
- curl
|
|
||||||
- ext-zlib
|
|
||||||
- ext-openssl
|
|
||||||
php-extension:
|
|
||||||
arg-type: with
|
|
||||||
ext-dba:
|
|
||||||
type: php-extension
|
|
||||||
suggests:
|
|
||||||
- qdbm
|
|
||||||
php-extension:
|
|
||||||
arg-type: custom
|
|
||||||
ext-dom:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-xml
|
|
||||||
php-extension:
|
|
||||||
arg-type: enable
|
|
||||||
arg-type@windows: with
|
|
||||||
ext-exif:
|
|
||||||
type: php-extension
|
|
||||||
depends@windows:
|
|
||||||
- ext-mbstring
|
|
||||||
ext-ffi:
|
|
||||||
type: php-extension
|
|
||||||
depends@unix:
|
|
||||||
- libffi
|
|
||||||
depends@windows:
|
|
||||||
- libffi-win
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: '--with-ffi=@shared_suffix@ --enable-zend-signals'
|
|
||||||
arg-type@windows: with
|
|
||||||
ext-fileinfo:
|
|
||||||
type: php-extension
|
|
||||||
ext-filter:
|
|
||||||
type: php-extension
|
|
||||||
ext-ftp:
|
|
||||||
type: php-extension
|
|
||||||
suggests:
|
|
||||||
- ext-openssl
|
|
||||||
ext-gd:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- zlib
|
|
||||||
- libpng
|
|
||||||
- ext-zlib
|
|
||||||
suggests:
|
|
||||||
- libavif
|
|
||||||
- libwebp
|
|
||||||
- libjpeg
|
|
||||||
- freetype
|
|
||||||
php-extension:
|
|
||||||
arg-type: custom
|
|
||||||
arg-type@windows: with
|
|
||||||
ext-gettext:
|
|
||||||
type: php-extension
|
|
||||||
depends@unix:
|
|
||||||
- gettext
|
|
||||||
depends@windows:
|
|
||||||
- gettext-win
|
|
||||||
php-extension:
|
|
||||||
arg-type: with-path
|
|
||||||
arg-type@windows: with
|
|
||||||
ext-gmp:
|
|
||||||
type: php-extension
|
|
||||||
depends@unix:
|
|
||||||
- gmp
|
|
||||||
depends@windows:
|
|
||||||
- mpir
|
|
||||||
php-extension:
|
|
||||||
arg-type: with-path
|
|
||||||
arg-type@windows: with
|
|
||||||
ext-iconv:
|
|
||||||
type: php-extension
|
|
||||||
depends@unix:
|
|
||||||
- libiconv
|
|
||||||
depends@windows:
|
|
||||||
- libiconv-win
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: with-path
|
|
||||||
arg-type@windows: with
|
|
||||||
ext-intl:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- icu
|
|
||||||
ext-ldap:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ldap
|
|
||||||
suggests:
|
|
||||||
- gmp
|
|
||||||
- libsodium
|
|
||||||
- ext-openssl
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: with-path
|
|
||||||
arg-type@windows: with
|
|
||||||
ext-libxml:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- libxml2
|
|
||||||
php-extension:
|
|
||||||
build-with-php: true
|
|
||||||
build-shared: false
|
|
||||||
arg-type@unix: with-path
|
|
||||||
arg-type@windows: with
|
|
||||||
ext-mbregex:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- onig
|
|
||||||
- ext-mbstring
|
|
||||||
php-extension:
|
|
||||||
arg-type: custom
|
|
||||||
build-shared: false
|
|
||||||
build-static: true
|
|
||||||
display-name: mbstring
|
|
||||||
ext-mbstring:
|
|
||||||
type: php-extension
|
|
||||||
php-extension:
|
|
||||||
arg-type: custom
|
|
||||||
ext-mysqli:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-mysqlnd
|
|
||||||
php-extension:
|
|
||||||
arg-type: with
|
|
||||||
build-with-php: true
|
|
||||||
ext-mysqlnd:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- zlib
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: enable
|
|
||||||
arg-type@windows: with
|
|
||||||
build-with-php: true
|
|
||||||
ext-odbc:
|
|
||||||
type: php-extension
|
|
||||||
depends@unix:
|
|
||||||
- unixodbc
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: '--with-unixODBC@shared_path_suffix@'
|
|
||||||
arg-type@windows: enable
|
|
||||||
ext-opcache:
|
|
||||||
type: php-extension
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: custom
|
|
||||||
arg-type@windows: enable
|
|
||||||
zend-extension: true
|
|
||||||
display-name: 'Zend Opcache'
|
|
||||||
ext-openssl:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- openssl
|
|
||||||
- zlib
|
|
||||||
- ext-zlib
|
|
||||||
php-extension:
|
|
||||||
arg-type: custom
|
|
||||||
arg-type@windows: with
|
|
||||||
build-with-php: true
|
|
||||||
ext-password-argon2:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- libargon2
|
|
||||||
suggests:
|
|
||||||
- ext-openssl
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: custom
|
|
||||||
display-name: ''
|
|
||||||
ext-pcntl:
|
|
||||||
type: php-extension
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
ext-pdo:
|
|
||||||
type: php-extension
|
|
||||||
ext-pdo_mysql:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-pdo
|
|
||||||
- ext-mysqlnd
|
|
||||||
php-extension:
|
|
||||||
arg-type: with
|
|
||||||
ext-pdo_odbc:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-pdo
|
|
||||||
depends@unix:
|
|
||||||
- unixodbc
|
|
||||||
- ext-pdo
|
|
||||||
- ext-odbc
|
|
||||||
php-extension:
|
|
||||||
arg-type: custom
|
|
||||||
ext-pdo_pgsql:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-pdo
|
|
||||||
- ext-pgsql
|
|
||||||
- postgresql
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: with-path
|
|
||||||
arg-type@windows: '--with-pdo-pgsql=yes'
|
|
||||||
ext-pdo_sqlite:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-pdo
|
|
||||||
- ext-sqlite3
|
|
||||||
- sqlite
|
|
||||||
php-extension:
|
|
||||||
arg-type: with
|
|
||||||
ext-pgsql:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- postgresql
|
|
||||||
php-extension:
|
|
||||||
arg-type: custom
|
|
||||||
ext-phar:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- zlib
|
|
||||||
ext-posix:
|
|
||||||
type: php-extension
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
ext-readline:
|
|
||||||
type: php-extension
|
|
||||||
depends@unix:
|
|
||||||
- libedit
|
|
||||||
depends@windows:
|
|
||||||
- wineditline
|
|
||||||
php-extension:
|
|
||||||
arg-type: '--with-libedit --without-readline'
|
|
||||||
arg-type@windows: with
|
|
||||||
build-shared: false
|
|
||||||
build-static: true
|
|
||||||
ext-session:
|
|
||||||
type: php-extension
|
|
||||||
ext-shmop:
|
|
||||||
type: php-extension
|
|
||||||
php-extension:
|
|
||||||
build-with-php: true
|
|
||||||
ext-simplexml:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-xml
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: enable
|
|
||||||
arg-type@windows: with
|
|
||||||
build-with-php: true
|
|
||||||
ext-snmp:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- net-snmp
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: with
|
|
||||||
ext-soap:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-xml
|
|
||||||
- ext-session
|
|
||||||
php-extension:
|
|
||||||
arg-type: enable
|
|
||||||
build-with-php: true
|
|
||||||
ext-sockets:
|
|
||||||
type: php-extension
|
|
||||||
ext-sodium:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- libsodium
|
|
||||||
php-extension:
|
|
||||||
arg-type: with
|
|
||||||
ext-sqlite3:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- sqlite
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: with-path
|
|
||||||
arg-type@windows: with
|
|
||||||
build-with-php: true
|
|
||||||
ext-sysvmsg:
|
|
||||||
type: php-extension
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
ext-sysvsem:
|
|
||||||
type: php-extension
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
ext-sysvshm:
|
|
||||||
type: php-extension
|
|
||||||
ext-tidy:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- tidy
|
|
||||||
php-extension:
|
|
||||||
arg-type: with-path
|
|
||||||
ext-tokenizer:
|
|
||||||
type: php-extension
|
|
||||||
php-extension:
|
|
||||||
build-with-php: true
|
|
||||||
ext-xml:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-libxml
|
|
||||||
depends@windows:
|
|
||||||
- ext-iconv
|
|
||||||
- ext-libxml
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: enable
|
|
||||||
arg-type@windows: with
|
|
||||||
build-with-php: true
|
|
||||||
ext-xmlreader:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-xml
|
|
||||||
- ext-dom
|
|
||||||
php-extension:
|
|
||||||
arg-type: enable
|
|
||||||
build-with-php: true
|
|
||||||
ext-xmlwriter:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-xml
|
|
||||||
php-extension:
|
|
||||||
arg-type: enable
|
|
||||||
build-with-php: true
|
|
||||||
ext-xsl:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- libxslt
|
|
||||||
- ext-xml
|
|
||||||
- ext-dom
|
|
||||||
php-extension:
|
|
||||||
arg-type: with-path
|
|
||||||
build-with-php: true
|
|
||||||
ext-zlib:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- zlib
|
|
||||||
php-extension:
|
|
||||||
arg-type: custom
|
|
||||||
arg-type@windows: enable
|
|
||||||
build-with-php: true
|
|
||||||
build-shared: false
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
ext-amqp:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: amqp
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
depends:
|
|
||||||
- librabbitmq
|
|
||||||
depends@windows:
|
|
||||||
- librabbitmq
|
|
||||||
- ext-openssl
|
|
||||||
php-extension:
|
|
||||||
arg-type: '--with-amqp@shared_suffix@ --with-librabbitmq-dir=@build_root_path@'
|
|
||||||
arg-type@windows: '--with-amqp'
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
ext-apcu:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: APCu
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
ext-ast:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: ast
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: BSD-3-Clause
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
ext-brotli:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: ghtagtar
|
|
||||||
repo: kjdev/php-ext-brotli
|
|
||||||
extract: php-src/ext/brotli
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: MIT
|
|
||||||
depends:
|
|
||||||
- brotli
|
|
||||||
php-extension:
|
|
||||||
arg-type: '--enable-brotli@shared_suffix@ --with-libbrotli'
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
ext-clickhouse:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: ghtar
|
|
||||||
repo: iliaal/php_clickhouse
|
|
||||||
extract: php-src/ext/clickhouse
|
|
||||||
prefer-stable: true
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
suggests@unix:
|
|
||||||
- openssl
|
|
||||||
lang: cpp
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type@unix: custom
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
ext-decimal:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: ghtagtar
|
|
||||||
repo: php-decimal/ext-decimal
|
|
||||||
match: 'v2\.\d.*'
|
|
||||||
extract: php-src/ext/decimal
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: MIT
|
|
||||||
depends:
|
|
||||||
- libmpdec
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: '--enable-decimal --with-libmpdec-path=@build_root_path@'
|
|
||||||
arg-type@windows: '--with-decimal'
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
ext-deepclone:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: ghtagtar
|
|
||||||
repo: symfony/php-ext-deepclone
|
|
||||||
extract: php-src/ext/deepclone
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
ext-dio:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: dio
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
ext-ds:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: git
|
|
||||||
url: 'https://github.com/php-ds/ext-ds.git'
|
|
||||||
rev: master
|
|
||||||
extract: php-src/ext/ds
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: MIT
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
ext-ev:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: ev
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
depends:
|
|
||||||
- ext-sockets
|
|
||||||
php-extension:
|
|
||||||
arg-type@windows: with
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
ext-event:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: url
|
|
||||||
url: 'https://bitbucket.org/osmanov/pecl-event/get/3.1.4.tar.gz'
|
|
||||||
extract: php-src/ext/event
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
depends:
|
|
||||||
- libevent
|
|
||||||
- ext-openssl
|
|
||||||
suggests:
|
|
||||||
- ext-sockets
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: custom
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
ext-excimer:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: excimer
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
ext-fastchart:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: ghtar
|
|
||||||
repo: iliaal/fastchart
|
|
||||||
extract: php-src/ext/fastchart
|
|
||||||
prefer-stable: true
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
depends:
|
|
||||||
- freetype
|
|
||||||
suggests:
|
|
||||||
- libpng
|
|
||||||
- libjpeg
|
|
||||||
- libwebp
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
ext-fastjson:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: ghtar
|
|
||||||
repo: iliaal/fastjson
|
|
||||||
extract: php-src/ext/fastjson
|
|
||||||
prefer-stable: true
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
ext-gearman:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: gearman
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
depends:
|
|
||||||
- libgearman
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: '--with-gearman@shared_path_suffix@'
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
ext-glfw:
|
|
||||||
type: php-extension
|
|
||||||
artifact: glfw
|
|
||||||
depends:
|
|
||||||
- glfw
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: '--enable-glfw --with-glfw-dir=@build_root_path@'
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
ext-gmssl:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: ghtar
|
|
||||||
repo: gmssl/GmSSL-PHP
|
|
||||||
extract: php-src/ext/gmssl
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
depends:
|
|
||||||
- gmssl
|
|
||||||
php-extension:
|
|
||||||
arg-type: with-path
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
ext-grpc:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: grpc
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: Apache-2.0
|
|
||||||
depends:
|
|
||||||
- grpc
|
|
||||||
lang: cpp
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type@unix: enable-path
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
ext-igbinary:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: igbinary
|
|
||||||
metadata:
|
|
||||||
license-files: [COPYING]
|
|
||||||
license: BSD-3-Clause
|
|
||||||
suggests:
|
|
||||||
- ext-session
|
|
||||||
- ext-apcu
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
ext-imagick:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: imagick
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
depends:
|
|
||||||
- imagemagick
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
- Windows
|
|
||||||
arg-type: custom
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
ext-imap:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: imap
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
depends:
|
|
||||||
- imap
|
|
||||||
suggests:
|
|
||||||
- ext-openssl
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: custom
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
ext-inotify:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: inotify
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
ext-lz4:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: git
|
|
||||||
url: 'https://github.com/kjdev/php-ext-lz4.git'
|
|
||||||
rev: master
|
|
||||||
extract: php-src/ext/lz4
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: MIT
|
|
||||||
depends:
|
|
||||||
- liblz4
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: '--enable-lz4=@shared_suffix@ --with-lz4-includedir=@build_root_path@'
|
|
||||||
arg-type@windows: '--enable-lz4'
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
ext-maxminddb:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: maxminddb
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: Apache-2.0
|
|
||||||
depends:
|
|
||||||
- libmaxminddb
|
|
||||||
php-extension:
|
|
||||||
arg-type: with
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
ext-memcache:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: memcache
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.0
|
|
||||||
depends:
|
|
||||||
- ext-zlib
|
|
||||||
- ext-session
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: '--enable-memcache@shared_suffix@ --with-zlib-dir=@build_root_path@'
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
ext-memcached:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: memcached
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
depends:
|
|
||||||
- libmemcached
|
|
||||||
depends@unix:
|
|
||||||
- libmemcached
|
|
||||||
- fastlz
|
|
||||||
- ext-session
|
|
||||||
- ext-zlib
|
|
||||||
suggests:
|
|
||||||
- zstd
|
|
||||||
- ext-igbinary
|
|
||||||
- ext-msgpack
|
|
||||||
- ext-session
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: '--enable-memcached@shared_suffix@ --with-zlib-dir=@build_root_path@'
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
ext-mongodb:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: ghrel
|
|
||||||
repo: mongodb/mongo-php-driver
|
|
||||||
match: mongodb.+\.tgz
|
|
||||||
extract: php-src/ext/mongodb
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
depends@windows:
|
|
||||||
- ext-openssl
|
|
||||||
suggests@unix:
|
|
||||||
- icu
|
|
||||||
- openssl
|
|
||||||
- zstd
|
|
||||||
- zlib
|
|
||||||
frameworks:
|
|
||||||
- CoreFoundation
|
|
||||||
- Security
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: custom
|
|
||||||
arg-type@windows: '--enable-mongodb --with-mongodb-client-side-encryption'
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
ext-msgpack:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: msgpack
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: BSD-3-Clause
|
|
||||||
depends:
|
|
||||||
- ext-session
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: with
|
|
||||||
arg-type@windows: enable
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
ext-mysqlnd_ed25519:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pie
|
|
||||||
repo: mariadb/mysqlnd_ed25519
|
|
||||||
extract: php-src/ext/mysqlnd_ed25519
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: BSD-3-Clause
|
|
||||||
depends:
|
|
||||||
- ext-mysqlnd
|
|
||||||
- libsodium
|
|
||||||
suggests:
|
|
||||||
- openssl
|
|
||||||
php-extension:
|
|
||||||
arg-type: '--with-mysqlnd_ed25519=@shared_suffix@'
|
|
||||||
build-static: false
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
ext-mysqlnd_parsec:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pie
|
|
||||||
repo: mariadb/mysqlnd_parsec
|
|
||||||
extract: php-src/ext/mysqlnd_parsec
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: BSD-3-Clause
|
|
||||||
depends:
|
|
||||||
- ext-mysqlnd
|
|
||||||
- libsodium
|
|
||||||
- openssl
|
|
||||||
php-extension:
|
|
||||||
arg-type: '--enable-mysqlnd_parsec'
|
|
||||||
build-static: false
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
ext-opentelemetry:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: opentelemetry
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: Apache-2.0
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
ext-parallel:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: parallel
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
depends@windows:
|
|
||||||
- pthreads4w
|
|
||||||
php-extension:
|
|
||||||
arg-type@windows: with
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
ext-pcov:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: pcov
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
php-extension:
|
|
||||||
build-static: false
|
|
||||||
build-shared: true
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
ext-pdo_sqlsrv:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: pdo_sqlsrv
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: MIT
|
|
||||||
depends:
|
|
||||||
- ext-pdo
|
|
||||||
- ext-sqlsrv
|
|
||||||
php-extension:
|
|
||||||
arg-type: with
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
ext-protobuf:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: protobuf
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: BSD-3-Clause
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
ext-rar:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: git
|
|
||||||
url: 'https://github.com/static-php/php-rar.git'
|
|
||||||
rev: issue-php82
|
|
||||||
extract: php-src/ext/rar
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
lang: cpp
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
ext-rdkafka:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: ghtar
|
|
||||||
repo: php-rdkafka/php-rdkafka
|
|
||||||
extract: php-src/ext/rdkafka
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: MIT
|
|
||||||
depends:
|
|
||||||
- librdkafka
|
|
||||||
lang: cpp
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: custom
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
ext-redis:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: redis
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
suggests:
|
|
||||||
- ext-session
|
|
||||||
- ext-igbinary
|
|
||||||
- ext-msgpack
|
|
||||||
suggests@unix:
|
|
||||||
- ext-session
|
|
||||||
- ext-igbinary
|
|
||||||
- ext-msgpack
|
|
||||||
- zstd
|
|
||||||
- liblz4
|
|
||||||
php-extension:
|
|
||||||
arg-type: custom
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
ext-simdjson:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: simdjson
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: Apache-2.0
|
|
||||||
lang: cpp
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
ext-snappy:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: git
|
|
||||||
url: 'https://github.com/kjdev/php-ext-snappy'
|
|
||||||
rev: master
|
|
||||||
extract: php-src/ext/snappy
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
depends:
|
|
||||||
- snappy
|
|
||||||
suggests:
|
|
||||||
- ext-apcu
|
|
||||||
lang: cpp
|
|
||||||
php-extension:
|
|
||||||
arg-type@unix: '--enable-snappy --with-snappy-includedir=@build_root_path@'
|
|
||||||
arg-type@windows: '--enable-snappy'
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
ext-spx:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pie
|
|
||||||
repo: noisebynorthwest/php-spx
|
|
||||||
extract: php-src/ext/spx
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: GPL-3.0-or-later
|
|
||||||
depends:
|
|
||||||
- ext-zlib
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: '--enable-SPX@shared_suffix@'
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
ext-sqlsrv:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: sqlsrv
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: MIT
|
|
||||||
depends@linux:
|
|
||||||
- unixodbc
|
|
||||||
- ext-pcntl
|
|
||||||
depends@macos:
|
|
||||||
- unixodbc
|
|
||||||
lang: cpp
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
ext-ssh2:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: ssh2
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
depends:
|
|
||||||
- libssh2
|
|
||||||
- ext-openssl
|
|
||||||
- ext-zlib
|
|
||||||
php-extension:
|
|
||||||
arg-type: with-path
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
ext-swoole:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: ghtar
|
|
||||||
repo: swoole/swoole-src
|
|
||||||
extract: php-src/ext/swoole
|
|
||||||
prefer-stable: true
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: Apache-2.0
|
|
||||||
depends:
|
|
||||||
- libcares
|
|
||||||
- brotli
|
|
||||||
- nghttp2
|
|
||||||
- zlib
|
|
||||||
- ext-openssl
|
|
||||||
- ext-curl
|
|
||||||
suggests:
|
|
||||||
- zstd
|
|
||||||
- ext-sockets
|
|
||||||
- ext-swoole-hook-pgsql
|
|
||||||
- ext-swoole-hook-mysql
|
|
||||||
- ext-swoole-hook-sqlite
|
|
||||||
- ext-swoole-hook-odbc
|
|
||||||
suggests@linux:
|
|
||||||
- zstd
|
|
||||||
- liburing
|
|
||||||
- ext-sockets
|
|
||||||
- ext-swoole-hook-pgsql
|
|
||||||
- ext-swoole-hook-mysql
|
|
||||||
- ext-swoole-hook-sqlite
|
|
||||||
- ext-swoole-hook-odbc
|
|
||||||
lang: cpp
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: custom
|
|
||||||
ext-swoole-hook-mysql:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-mysqlnd
|
|
||||||
- ext-pdo
|
|
||||||
- ext-pdo_mysql
|
|
||||||
suggests:
|
|
||||||
- ext-mysqli
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: none
|
|
||||||
display-name: swoole
|
|
||||||
ext-swoole-hook-odbc:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-pdo
|
|
||||||
- unixodbc
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: none
|
|
||||||
display-name: swoole
|
|
||||||
ext-swoole-hook-pgsql:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-pgsql
|
|
||||||
- ext-pdo
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: none
|
|
||||||
display-name: swoole
|
|
||||||
ext-swoole-hook-sqlite:
|
|
||||||
type: php-extension
|
|
||||||
depends:
|
|
||||||
- ext-sqlite3
|
|
||||||
- ext-pdo
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: none
|
|
||||||
display-name: swoole
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
ext-swow:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
extract: php-src/ext/swow-src
|
|
||||||
type: ghtar
|
|
||||||
repo: swow/swow
|
|
||||||
prefer-stable: true
|
|
||||||
metadata:
|
|
||||||
license: Apache-2.0
|
|
||||||
license-files: [LICENSE]
|
|
||||||
suggests:
|
|
||||||
- openssl
|
|
||||||
- curl
|
|
||||||
- ext-openssl
|
|
||||||
- ext-curl
|
|
||||||
- postgresql
|
|
||||||
php-extension:
|
|
||||||
arg-type: custom
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
ext-trader:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: trader
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: BSD-2-Clause
|
|
||||||
php-extension:
|
|
||||||
arg-type: enable
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
ext-uuid:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: uuid
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: LGPL-2.1-only
|
|
||||||
depends:
|
|
||||||
- libuuid
|
|
||||||
php-extension:
|
|
||||||
os:
|
|
||||||
- Linux
|
|
||||||
- Darwin
|
|
||||||
arg-type: with-path
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
ext-uv:
|
|
||||||
type: php-extension
|
|
||||||
artifact:
|
|
||||||
source:
|
|
||||||
type: pecl
|
|
||||||
name: uv
|
|
||||||
prefer-stable: false
|
|
||||||
metadata:
|
|
||||||
license-files: [LICENSE]
|
|
||||||
license: PHP-3.01
|
|
||||||
depends:
|
|
||||||
- libuv
|
|
||||||
- ext-sockets
|
|
||||||
php-extension:
|
|
||||||
arg-type: with-path
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user