Skip to content

Upgrade PHP to 8.5 and validators to 0.3.*#919

Merged
Meldiron merged 4 commits into
mainfrom
upgrade-php-8.5-validators-0.3
Jul 13, 2026
Merged

Upgrade PHP to 8.5 and validators to 0.3.*#919
Meldiron merged 4 commits into
mainfrom
upgrade-php-8.5-validators-0.3

Conversation

@Meldiron

@Meldiron Meldiron commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What

  • Bump PHP requirement to >=8.5 (composer.json + composer.lock)
  • Upgrade utopia-php/validators to 0.3.* (0.3.0)
  • Update Dockerfile base image to php:8.5-cli-alpine
  • Use dynamic extension paths (php-config --extension-dir) instead of hardcoded API-version directories, so the build no longer breaks on PHP's new extension ABI number
  • Bump MongoDB PHP driver to 2.3.3 for PHP 8.5 compatibility
  • Add file package and build extensions from source where needed for the 8.5 image

Why

Move the library onto PHP 8.5 and the matching validators release line.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Compatibility

    • Updated the minimum supported PHP version to 8.5.
  • Bug Fixes

    • Improved Docker-based PHP extension installation and loading for more reliable builds across environments.
    • Updated debug-mode cleanup to correctly remove Xdebug when debugging is disabled.
  • Chores

    • Refreshed PHP build tooling and extension versions.

- Bump PHP requirement to >=8.5 in composer.json and composer.lock
- Upgrade utopia-php/validators to 0.3.*
- Update Dockerfile to php:8.5-cli-alpine with dynamic extension paths
- Bump MongoDB driver to 2.3.3 for PHP 8.5 compatibility

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PHP build targets updated runtime and extension versions, collects compiled extensions under /ext, and installs them through PHP’s computed extension directory. Composer now requires PHP 8.5 and validators 0.3.*.

Changes

PHP build and package requirements

Layer / File(s) Summary
Runtime versions and build prerequisites
Dockerfile, composer.json
The PHP build image, extension pins, Alpine build package list, PHP requirement, and validators dependency version are updated.
Extension artifact collection
Dockerfile
MongoDB, Redis, Swoole, PCOV, and Xdebug builds copy their compiled .so files into standardized /ext paths.
Runtime extension installation and cleanup
Dockerfile
The final image installs extensions via php-config --extension-dir, removes the hard-coded copy block, and uses the computed directory for Xdebug cleanup.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main changes: upgrading PHP to 8.5 and utopia-php/validators to 0.3.*.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch upgrade-php-8.5-validators-0.3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR upgrades the library to PHP 8.5 by bumping the base image to php:8.5.8-cli-alpine, updating utopia-php/validators to 0.3.*, bumping the MongoDB driver to 2.3.3, and replacing all hardcoded PHP extension ABI paths (no-debug-non-zts-20240924) with dynamic php-config --extension-dir calls for forward compatibility.

  • Dockerfile: Replaces hardcoded extension paths with $(php-config --extension-dir), switches MongoDB to a source-only build with make -j$(nproc), adds file and openssl-dev to the Alpine build deps, and stages each extension's .so through a shared /ext/ directory before copying into the final image.
  • composer.json / composer.lock: Minimum PHP bumped to >=8.5; utopia-php/validators locked to 0.3.0, which itself now requires PHP >=8.5.

Confidence Score: 5/5

The change is a straightforward PHP version upgrade with a well-scoped Dockerfile refactor; the dynamic extension path approach is the correct long-term fix.

The core upgrade is clean: the composer changes are minimal and consistent, and the Dockerfile switch to php-config --extension-dir is a clear improvement over hardcoded ABI strings. The only noted issue is that opcache was dropped from the docker-php-ext-install call without being re-enabled, leaving its enable_cli config as a no-op — this does not break any tests or adapters.

Dockerfile — specifically whether opcache needs to be explicitly re-enabled after being removed from the docker-php-ext-install line.

Important Files Changed

Filename Overview
Dockerfile Upgrades to PHP 8.5.8, bumps extension versions, replaces hardcoded ABI paths with dynamic php-config --extension-dir calls, and switches MongoDB to a source-only build; opcache was removed from docker-php-ext-install without being re-enabled via docker-php-ext-enable
composer.json Bumps minimum PHP requirement to >=8.5 and upgrades utopia-php/validators constraint from 0.2.* to 0.3.*; straightforward and consistent change
composer.lock Locks utopia-php/validators to 0.3.0 (PHP >=8.5 requirement), updates content-hash and platform constraint; no other package changes

Reviews (4): Last reviewed commit: "Fix mongodb/opcache/swoole builds for PH..." | Re-trigger Greptile

Comment thread Dockerfile Outdated
Comment thread Dockerfile Outdated
Meldiron and others added 2 commits July 13, 2026 14:25
- Bump Xdebug to 3.5.3 (3.4.2 does not support PHP 8.5, broke the build)
- Enable opcache/pgsql/pdo_mysql/pdo_pgsql after building them (Greptile P1)
- Pin base image to php:8.5.8-cli-alpine for reproducible builds (Greptile P2)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Use docker-php-ext-install for opcache/pgsql/pdo_mysql/pdo_pgsql instead of
  a hand-rolled loop that silently skipped opcache (loop exit status masked the
  failure) and never enabled the extensions
- Bump Swoole to v6.2.2 (6.1.x does not support PHP 8.5; 6.2.0+ required)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
Dockerfile (1)

70-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Bump swoole/ide-helper to the latest 6.x release. composer.json still pins swoole/ide-helper to 5.1.3, while the Dockerfile builds Swoole 6.x. Packagist already has 6.0.2, so the current stubs are behind the runtime and may miss newer APIs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Dockerfile` around lines 70 - 72, Update the swoole/ide-helper dependency in
composer.json from 5.1.3 to the latest 6.x release, 6.0.2, so the IDE stubs
match the Swoole 6.x runtime built by the Dockerfile.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Dockerfile`:
- Around line 70-72: Update the swoole/ide-helper dependency in composer.json
from 5.1.3 to the latest 6.x release, 6.0.2, so the IDE stubs match the Swoole
6.x runtime built by the Dockerfile.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9d72ae44-4509-4016-95be-c7072db90d3d

📥 Commits

Reviewing files that changed from the base of the PR and between a93cbd1 and 972b8b9.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Dockerfile
  • composer.json

- Build mongodb from source and locate the .so with find (pecl's make install
  target 'install-modules' fails: cp modules/* finds nothing on this image)
- Drop opcache from docker-php-ext-install; it is compiled statically into the
  php:8.5 base image already (produces no shared .so to install)
- Add openssl-dev so Swoole 6.2.2 configure finds libssl (it was previously
  pulled in transitively by libpq-dev, which is purged)

Full image build verified locally: mongodb, redis, swoole, pcov, pdo_mysql,
pdo_pgsql, pgsql, opcache, mbstring all load.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Meldiron Meldiron merged commit d5ebecc into main Jul 13, 2026
21 checks passed
@Meldiron Meldiron deleted the upgrade-php-8.5-validators-0.3 branch July 13, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants