$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." );
$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() {
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() );
}
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() );
}
}
}
+/**
+ * @since 1.22
+ * @deprecated since 1.29
+ */
class_alias( DBConnRef::class, 'DBConnRef' );