X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FDatabaseMysqli.php;h=0f444cd210ec235a67e2aa39ba909ade1e3fe7ec;hb=ba0dff9630772f80a402eef03ec674f7a6a271c4;hp=1c4ed56d40d22228da7439b26e33a96b4f8f9aa2;hpb=081a44ff0cfab9c251a112e1ece037b3efb0fe0e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/database/DatabaseMysqli.php b/includes/libs/rdbms/database/DatabaseMysqli.php index 1c4ed56d40..0f444cd210 100644 --- a/includes/libs/rdbms/database/DatabaseMysqli.php +++ b/includes/libs/rdbms/database/DatabaseMysqli.php @@ -78,9 +78,7 @@ class DatabaseMysqli extends DatabaseMysqlBase { } elseif ( substr_count( $realServer, ':' ) == 1 ) { // If we have a colon and something that's not a port number // inside the hostname, assume it's the socket location - $hostAndSocket = explode( ':', $realServer, 2 ); - $realServer = $hostAndSocket[0]; - $socket = $hostAndSocket[1]; + list( $realServer, $socket ) = explode( ':', $realServer, 2 ); } $mysqli = mysqli_init(); @@ -127,21 +125,6 @@ class DatabaseMysqli extends DatabaseMysqlBase { return false; } - protected function connectInitCharset() { - // already done in mysqlConnect() - return true; - } - - /** - * @param string $charset - * @return bool - */ - protected function mysqlSetCharset( $charset ) { - $conn = $this->getBindingHandle(); - - return $conn->set_charset( $charset ); - } - /** * @return bool */ @@ -180,25 +163,6 @@ class DatabaseMysqli extends DatabaseMysqlBase { return $conn->affected_rows; } - function doSelectDomain( DatabaseDomain $domain ) { - if ( $domain->getSchema() !== null ) { - throw new DBExpectedError( $this, __CLASS__ . ": domain schemas are not supported." ); - } - - $database = $domain->getDatabase(); - if ( $database !== $this->getDBname() ) { - $conn = $this->getBindingHandle(); - if ( !$conn->select_db( $database ) ) { - throw new DBExpectedError( $this, "Could not select database '$database'." ); - } - } - - // Update that domain fields on success (no exception thrown) - $this->currentDomain = $domain; - - return true; - } - /** * @param mysqli_result $res * @return bool @@ -224,7 +188,7 @@ class DatabaseMysqli extends DatabaseMysqlBase { /** * @param mysqli_result $res - * @return bool + * @return array|false */ protected function mysqlFetchArray( $res ) { $array = $res->fetch_array(); @@ -328,21 +292,6 @@ class DatabaseMysqli extends DatabaseMysqlBase { return $conn->real_escape_string( (string)$s ); } - /** - * Give an id for the connection - * - * mysql driver used resource id, but mysqli objects cannot be cast to string. - * @return string - */ - public function __toString() { - if ( $this->conn instanceof mysqli ) { - return (string)$this->conn->thread_id; - } else { - // mConn might be false or something. - return (string)$this->conn; - } - } - /** * @return mysqli */