chore: sync PHP client with Apify OpenAPI spec v2-2026-07-08T143931Z + compression/OS-token alignment#3
Merged
Conversation
- Bump API_SPEC_VERSION to v2-2026-07-08T143931Z and client version to 0.2.0 - Align User-Agent OS token with reference clients via Platform::osToken (WIN* -> win32, CYGWIN* -> cygwin, else lowercase PHP_OS) - Add request-body compression for bodies >= 1024 bytes: brotli (Content-Encoding: br) when the PECL brotli extension is present, gzip (Content-Encoding: gzip) fallback - Add zlib to CI setup-php extensions
… token Split Compression size-gate + codec selection into a testable compressWith() seam (no behavior change) so both the brotli path and the gzip fallback are covered deterministically regardless of whether the PECL brotli extension is loaded. Add a unit-brotli CI job so the real brotli round-trip runs in CI, and guard the gzip tests to skip on zlib-less builds. Add an AIX->aix case asserting the User-Agent OS token matches the reference JS os.platform() token. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xbC2QoA4QKyvhC1d7gYap
6829a55 to
e5f86f4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Syncs the PHP client with Apify OpenAPI spec
v2-2026-07-08T143931Zand aligns it with recent reference-client changes, then confirms two cross-client uniformity requirements. Version0.2.0.Changes
Spec sync
Version::API_SPEC_VERSIONtov2-2026-07-08T143931Z. No in-scope endpoint/parameter/schema delta; coverage unchanged.Request-body compression — both brotli and gzip (reference: apify-client-js#962)
Content-Encoding: br) via the PECLbrotliextension when loaded and falls back to gzip (gzencode,Content-Encoding: gzip) otherwise — both paths supported (PHP has no pure-language brotli encoder, so this is the idiomatic "both paths" design without a heavyweight hard dependency). Existing behavior preserved: only compress bodies ≥ 1024 bytes, compress once before the retry loop, skip whenContent-Encodingis already set.compressWithseam and added deterministic unit tests for both codecs (gzip fallback, brotli preference, brotli-fails→gzip, real brotli round-trip, no-codec, size-gate). Added a dedicatedunit-brotliCI job that installs thebrotliextension and fails fast if it doesn't load, so the realbrround-trip runs in CI while the main job covers the real gzip fallback.User-Agent OS token — identical across all clients (reference: apify-client-js#964)
Platform::osToken(PHP_OS)mapsWIN* → win32,CYGWIN* → cygwin, otherwise lowercase — exactly the reference JSos.platform()value for everyPHP_OS(linux,darwin,freebsd,openbsd,netbsd,sunos,aix,win32,cygwin). Tests assert every emitted value.Testing
php-cs-fixerclean; PHPStan level 6 in CI.unit-brotliCI job); integration 42/42 against the live API.Note
The live spec has since advanced beyond this PR's baseline (
v2-2026-07-08T143931Z); a re-sync to the newest version is a separate future change, not part of this compression/OS-token work.