Use IDatabase interface instead of Database in DBAccessBase
authorThiemo Mättig <thiemo.maettig@wikimedia.de>
Tue, 9 Jan 2018 12:55:37 +0000 (13:55 +0100)
committerThiemo Mättig <thiemo.maettig@wikimedia.de>
Tue, 9 Jan 2018 12:58:48 +0000 (13:58 +0100)
There is one subclass I'm aware of that overwrites the releaseConnection
method. It's in the EducationProgram extension and already updated, see
Ibb067ca.

Change-Id: I68504f9cd32aa0d0c6c068dbaa1f2ee65649afa4

includes/dao/DBAccessBase.php

index 0f8d7f7..6e171d5 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 use Wikimedia\Rdbms\LoadBalancer;
 
 /**
@@ -56,7 +56,7 @@ abstract class DBAccessBase implements IDBAccessObject {
         * @param int $id Which connection to use
         * @param array $groups Query groups
         *
-        * @return Database
+        * @return IDatabase
         */
        protected function getConnection( $id, $groups = [] ) {
                $loadBalancer = wfGetLB( $this->wiki );
@@ -71,9 +71,9 @@ abstract class DBAccessBase implements IDBAccessObject {
         *
         * @since 1.21
         *
-        * @param Database $db The database connection to release.
+        * @param IDatabase $db The database connection to release.
         */
-       protected function releaseConnection( Database $db ) {
+       protected function releaseConnection( IDatabase $db ) {
                if ( $this->wiki !== false ) {
                        $loadBalancer = $this->getLoadBalancer();
                        $loadBalancer->reuseConnection( $db );