Merge "Do not require titles on Special:ComparePages"
[lhc/web/wiklou.git] / includes / libs / rdbms / database / DBConnRef.php
index c94f62f..b414a2a 100644 (file)
@@ -33,7 +33,7 @@ class DBConnRef implements IDatabase {
                $this->lb = $lb;
                if ( $conn instanceof Database ) {
                        $this->conn = $conn; // live handle
-               } elseif ( count( $conn ) >= 4 && $conn[self::FLD_DOMAIN] !== false ) {
+               } elseif ( is_array( $conn ) && count( $conn ) >= 4 && $conn[self::FLD_DOMAIN] !== false ) {
                        $this->params = $conn;
                } else {
                        throw new InvalidArgumentException( "Missing lazy connection arguments." );
@@ -46,7 +46,7 @@ class DBConnRef implements IDatabase {
                        $this->conn = $this->lb->getConnection( $db, $groups, $wiki, $flags );
                }
 
-               return call_user_func_array( [ $this->conn, $name ], $arguments );
+               return $this->conn->$name( ...$arguments );
        }
 
        public function getServerInfo() {
@@ -113,6 +113,10 @@ class DBConnRef implements IDatabase {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
+       public function preCommitCallbacksPending() {
+               return $this->__call( __FUNCTION__, func_get_args() );
+       }
+
        public function writesOrCallbacksPending() {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
@@ -483,6 +487,10 @@ class DBConnRef implements IDatabase {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
+       public function onTransactionCommitOrIdle( callable $callback, $fname = __METHOD__ ) {
+               return $this->__call( __FUNCTION__, func_get_args() );
+       }
+
        public function onTransactionIdle( callable $callback, $fname = __METHOD__ ) {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
@@ -631,4 +639,8 @@ class DBConnRef implements IDatabase {
        }
 }
 
+/**
+ * @since 1.22
+ * @deprecated since 1.29
+ */
 class_alias( DBConnRef::class, 'DBConnRef' );