[wp-trac] [WordPress Trac] #21055: Interface for wpdb compatibility
WordPress Trac
wp-trac at lists.automattic.com
Sat Jun 23 17:30:13 UTC 2012
#21055: Interface for wpdb compatibility
-----------------------------+-----------------------------
Reporter: santec | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Database | Version:
Severity: normal | Keywords:
-----------------------------+-----------------------------
==Summary==
From the wp-includes/wp-db.php file:
{{{
It is possible to replace this class with your own
by setting the $wpdb global variable in wp-content/db.php
file to your class. The wpdb class will still be included,
so you can extend it or simply use your own.
}}}
When one implements a db class that does not extend wpdb, it would be
safer that the new class implements an interface. This interface may be
called wpdb_compat and would assure that the class has all necessary
methods/properties. Of course, wpdb_compat should be supported by wpdb
too.
== Design Strategies ==
My patch adds:
* wp-includes/interfaces/wpdb-compat.php
Very small edits to:
* wp-includes/wp-db.php
* wp-includes/load.php
* wp-admin/install.php
At the moment, WordPress does not include any interface; this means that
there is not a directory for interfaces.[[BR]]
In my first draft, I put it in wp-includes/interfaces so that - if more
interfaces will be added in the future - they will have a logical place.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21055>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list