Thanks for helping improve Winter Thread! This guide covers local setup, the test tiers, and the conventions the project follows.
- PHP >= 8.4 with
ext-pcntlandext-posix(andext-shmopif you touch the shared-memory transport). - Composer.
- A POSIX OS (Linux or macOS) — the engine relies on signals,
setsid, and/proc/ps. Windows is not supported.
git clone https://github.com/flytachi/winter-thread
cd winter-thread
composer installThe suite has two tiers (see docs/15 — Testing).
Default tier — runs on any machine; tests needing an absent extension self-skip:
composer test # base (unit) + working (end-to-end)
composer test-base # unit-level class correctness only
composer test-working # real end-to-end scenarios only
composer test-detail # testdox (human-readable) outputContainer tier — heavy, environment-specific checks (leak / timing / Swoole / load), run inside Docker across PHP versions:
tests/run-container.sh # default versions: 8.4 8.5
tests/run-container.sh 8.4 # a single versionPSR-12, enforced by phpcs:
composer cs-check # report violations (src/)
composer cs-fix # auto-fix what it canAll src/ files must declare strict_types=1. CI runs cs-check + the default
suite on a PHP 8.4 / 8.5 matrix, and the container suite in Docker.
- Branch off
main. - Add tests for any behavior change — a bug fix gets a regression test; a
feature gets coverage in the appropriate tier (
tests/Basefor isolated class correctness,tests/Workingfor end-to-end,tests/Containerfor environment-specific). - Keep docs in sync. The
docs/*files are the source of truth for behavior; if you change a signature or a default, update the matching doc (especially docs/14 — API Reference) in the same PR. - Run
composer cs-checkandcomposer testlocally; both must be green. - Keep changes focused; explain the why in the PR description.
src/— the library.Threadis a thin facade; the real work lives in theLauncher/ProcessHandle/Runner/PayloadTransportprimitives. Read docs/11 — Architecture before making structural changes — note that the parent-sideLauncherand the child-sideRunnerare deliberately independent.wRunner— the child bootstrap script (packaged asbin).tests/—Base/Working/Containertiers, plusFixturesanddocker.docs/— the documentation set.
- Bugs: open a GitHub issue with a minimal reproduction, your PHP version, and OS.
- Security vulnerabilities: do not open a public issue — follow SECURITY.md.
By contributing you agree that your contributions are licensed under the project's MIT license.