'DBConnRef' => 'includes/db/LoadBalancer.php',
'DBError' => 'includes/db/DatabaseError.php',
'DBObject' => 'includes/db/DatabaseUtility.php',
+ 'IDatabase' => 'includes/db/Database.php',
'IORMRow' => 'includes/db/IORMRow.php',
'IORMTable' => 'includes/db/IORMTable.php',
'DBMasterPos' => 'includes/db/DatabaseUtility.php',
function getServerInfo();
}
+/**
+ * Interface for classes that implement or wrap DatabaseBase
+ * @ingroup Database
+ */
+interface IDatabase {}
+
/**
* Database abstraction object
* @ingroup Database
*/
-abstract class DatabaseBase implements DatabaseType {
+abstract class DatabaseBase implements IDatabase, DatabaseType {
/** Number of times to re-try an operation in case of deadlock */
const DEADLOCK_TRIES = 4;
/** Minimum time to wait before retry, in microseconds */
* @ingroup Database
* @since 1.22
*/
-class DBConnRef {
+class DBConnRef implements IDatabase {
/** @var LoadBalancer */
protected $lb;
/** @var DatabaseBase */
/**
* Inserts the entry into the logging table.
- * @param DatabaseBase $dbw
+ * @param IDatabase $dbw
* @return int If of the log entry
*/
- public function insert( DatabaseBase $dbw = null ) {
+ public function insert( IDatabase $dbw = null ) {
global $wgContLang;
$dbw = $dbw ?: wfGetDB( DB_MASTER );