Skip to content

Require 64-bit PHP for the SQLite driver - #639

Open
JanJakes wants to merge 2 commits into
trunkfrom
require-64-bit-php
Open

JanJakes wants to merge 2 commits into
trunkfrom
require-64-bit-php

Conversation

@JanJakes

@JanJakes JanJakes commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

The driver now requires 64-bit PHP. On 32-bit PHP it reports the requirement before opening the SQLite database. WordPress setup explains the requirement and blocks drop-in installation. Sites with an existing drop-in get the same check before WordPress initializes database storage.

The READMEs and Composer package requirements now reflect this limit. A CI test runs the driver on 32-bit PHP and checks that the connection fails before it creates a database file.

Why

Seeded RAND(), some numeric sql_mode values, and BIT defaults wider than 32 bits already rely on 64-bit integers. Rejecting an unsupported runtime at startup prevents these operations from returning or storing incorrect values.

Fixes #638.

Summary by CodeRabbit

  • Compatibility
    • The SQLite driver and database integration now require 64-bit PHP. Attempts to use them on 32-bit PHP are blocked with a clear error.
  • Bug Fixes
    • The integration no longer installs or replaces the database drop-in when 64-bit PHP or the PDO SQLite extension is unavailable.
  • Tests
    • Added automated coverage confirming that 32-bit PHP connections are rejected without creating a database file.
  • Documentation
    • Updated project and package requirements to specify the 64-bit PHP requirement.

Reject 32-bit PHP before opening the SQLite database. Seeded RAND(), numeric SQL modes, and wide BIT defaults rely on 64-bit integers.

#638
Show the PHP requirement in setup and stop before installing the drop-in. Also check existing installations before initializing database storage.

#638
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The SQLite driver and integration now require 64-bit PHP. Runtime checks reject or stop setup on 32-bit PHP, and Composer metadata and documentation state the requirement. A PHPUnit workflow job runs a test in a 32-bit PHP container.

Changes: 64-bit PHP support requirement

Layer / File(s) Summary
Driver requirement and runtime check
composer.json, packages/mysql-on-sqlite/composer.json, packages/mysql-on-sqlite/src/sqlite/class-wp-mysql-on-sqlite.php, AGENTS.md, README.md, packages/mysql-on-sqlite/README.md, packages/mysql-on-sqlite/tests/32-bit-php.php, .github/workflows/phpunit-tests.yml
The driver and Composer metadata specify 64-bit PHP. The driver rejects PHP with an integer size below 8. A test checks the exception and verifies that no database file is created; the workflow runs it in a 32-bit PHP container.
Integration checks and setup messaging
packages/plugin-sqlite-database-integration/composer.json, packages/plugin-sqlite-database-integration/README.md, packages/plugin-sqlite-database-integration/readme.txt, packages/plugin-sqlite-database-integration/activate.php, packages/plugin-sqlite-database-integration/admin-notices.php, packages/plugin-sqlite-database-integration/admin-page.php, packages/plugin-sqlite-database-integration/wp-includes/sqlite/db.php
The integration skips database drop-in copying on 32-bit PHP, displays an admin notice, and throws a runtime exception when SQLite is selected. Its Composer metadata and documentation specify 64-bit PHP.

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

Change: Other · Severity of issue fixed: Low

Merge Risk: Minimal · up to 19133

This change makes the SQLite driver and plugin fail clearly on 32-bit PHP instead of misbehaving, and documents the 64-bit requirement. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Require 64-bit PHP for the SQLite driver" matches the main change in the PR. The changeset adds a 64-bit PHP check to the SQLite driver constructor, the WordPress plugin setup and admin not…
Linked Issues check Passed [#638] The issue asks to state in the README and in the plugin readme.txt that 64-bit PHP is required. The reviewed head does this. The root README.md and packages/mysql-on-sqlite/README.md state the …
Out of Scope Changes check Passed All changed files relate to the single objective of #638: the 64-bit PHP requirement. Documentation files (READMEs, readme.txt, AGENTS.md) implement the stated objective. The driver constructor check …
Full details: Title check

Explanation

The title "Require 64-bit PHP for the SQLite driver" matches the main change in the PR. The changeset adds a 64-bit PHP check to the SQLite driver constructor, the WordPress plugin setup and admin notices, and the READMEs and Composer requirements. It also adds a CI test for 32-bit PHP. The title is short, specific, and states the primary change.

Full details: Linked Issues check

Explanation

[#638] The issue asks to state in the README and in the plugin readme.txt that 64-bit PHP is required. The reviewed head does this. The root README.md and packages/mysql-on-sqlite/README.md state the 64-bit requirement. packages/plugin-sqlite-database-integration/README.md states PHP 7.2+ on 64-bit systems. packages/plugin-sqlite-database-integration/readme.txt states the 64-bit requirement in the database requirements notice and in the FAQ. The assessed requirement is documentation. The AI-generated summaries of these files are the only evidence used; the file text was not read directly. The PR also adds runtime checks (driver constructor, admin notices, drop-in guard, Composer php-64bit platform requirement, and a 32-bit CI test). These checks go beyond the literal documentation request. They do not contradict the issue. No coding requirement from #638 remains unmet.

Full details: Out of Scope Changes check

Explanation

All changed files relate to the single objective of #638: the 64-bit PHP requirement. Documentation files (READMEs, readme.txt, AGENTS.md) implement the stated objective. The driver constructor check in class-wp-mysql-on-sqlite.php, the drop-in guard in db.php and activate.php, the admin notices in admin-notices.php and admin-page.php, and the Composer php-64bit platform requirements (root and plugin packages) enforce the same requirement at runtime. The 32-bit CI job and tests/32-bit-php.php verify it. The issue requests only documentation, so the runtime enforcement is broader than the issue text. The PR description states that enforcement is the intended purpose, and it links the change to the issue. No change shows a concrete lack of connection to the objective, so none is marked out of scope. The enforcement behavior should still be reviewed as a deliberate scope expansion.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e20f25df-dfa8-4c6f-8644-81dd79fab2d9
Commits

Reviewing files that changed from the base of the PR and between 2300409 and 191333a.

Files selected for processing: 15

  • .github/workflows/phpunit-tests.yml
  • AGENTS.md
  • README.md
  • composer.json
  • packages/mysql-on-sqlite/README.md
  • packages/mysql-on-sqlite/composer.json
  • packages/mysql-on-sqlite/src/sqlite/class-wp-mysql-on-sqlite.php
  • packages/mysql-on-sqlite/tests/32-bit-php.php
  • packages/plugin-sqlite-database-integration/README.md
  • packages/plugin-sqlite-database-integration/activate.php
  • packages/plugin-sqlite-database-integration/admin-notices.php
  • packages/plugin-sqlite-database-integration/admin-page.php
  • packages/plugin-sqlite-database-integration/composer.json
  • packages/plugin-sqlite-database-integration/readme.txt
  • packages/plugin-sqlite-database-integration/wp-includes/sqlite/db.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

This branch has not been deployed

No deployments
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.

State that 32-bit PHP is not supported

1 participant