Skip to content

Allow WordPress workloads with a custom db.php wpdb implementation #2391

Description

@chubes4

Problem

WP Codebox can boot a recipe whose mounted db.php replaces $wpdb, but wordpress.run-php and other workload commands are terminated by WordPress Playground with:

SQLite integration not loaded Custom_WPDB_Class

The command wrapper currently treats the Playground SQLite implementation as mandatory even when the recipe intentionally installs a custom database drop-in. This prevents deterministic testing of valid custom wpdb runtimes, including pure-PHP and remote-database implementations.

Reproduction

  1. Mount a valid wp-content/db.php that assigns a custom wpdb subclass.
  2. Define the drop-in configuration before WordPress bootstrap.
  3. Run any wordpress.run-php workload after the preview reports ready.
  4. Observe that WordPress itself boots with the custom class, then Playground terminates the command because that class is not its SQLite wrapper.

Expected

Workload commands bootstrap and execute against the recipe-owned $wpdb implementation. SQLite-specific setup and validation should apply only when Playground SQLite owns the database boundary.

Acceptance criteria

  • A recipe can explicitly select a custom database/drop-in mode.
  • Playground skips SQLite installation and SQLite-class assertions for that mode.
  • wordpress.run-php, WP-CLI, HTTP, REST, and browser commands use the same custom wpdb runtime.
  • Existing default SQLite recipes remain unchanged.
  • Deterministic coverage proves both default SQLite and custom db.php paths.

AI Assistance

OpenAI gpt-5.6-sol was used through OpenCode to build and run the failing custom-database lifecycle recipe, inspect the resulting WP Codebox and WordPress Playground diagnostics, identify the owning runtime boundary, and draft this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions