Phase out `Database::prepareStatement()`

Open
#6,002 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@Cyperghost is already working on this.

Since Oct 18, 2024.

Assessment

This issue has not been assessed yet.

Description

Feature

Version 5.4 added Database::prepare() as a convenient alternative that performs the replacement based on WCF_N and has proven to prevent a lot of runtime errors for legacy setups with WCF_N !== 1.

The next step is to deprecate prepareStatement() and make it an alias of prepare() in 7.0. For some situations, most important exporters, we need to preserve the previous behavior by introducing prepareUnmanaged() which behaves exactly as prepareStatement() but represents an explicit opt-in.

  • WoltLab Suite 6.2
    • prepareUnmanaged() is introduced and is identical to the prepareStatement() in version 6.1.
    • prepareStatement() is marked as deprecated and forwards all calls to prepareUnmanaged().
    • prepare() is updated to use prepareUnmanaged() instead of prepareStatement().
    • All uses of prepareStatement() in the exporters are migrated to prepareUnmanaged() or prepare().
    • All remaining uses of prepareStatement() in the software are rewritten to use prepare() instead. This includes rewriting the queries to no longer use WCF_N directly.
  • WoltLab Suite 7.0
    • prepareStatement() is being removed.
Dominant language
PHP
Stars
248
Forks
147
Avg merge
17m
Merged PRs (30d)
21

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from WoltLab/WCF

All issues in WoltLab/WCF

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.