Interface for wpdb compatibility
|Reported by:||santec||Owned by:|
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.
My patch adds:
Very small edits to:
At the moment, WordPress does not include any interface; this means that there is not a directory for interfaces.
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.