X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FDatabaseMysqli.php;h=1a5cdab78dad7b09bf49fcef1de843123ee51e86;hb=09ee5d2505f99cc146f871307be7ac00b7368d76;hp=a3907caa0622cf93cd0880fdbd797c8222cdb13a;hpb=ca3ff245607d147c3d6e3408966ceaeb7e260bbf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/database/DatabaseMysqli.php b/includes/libs/rdbms/database/DatabaseMysqli.php index a3907caa06..1a5cdab78d 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(); @@ -139,11 +137,7 @@ class DatabaseMysqli extends DatabaseMysqlBase { protected function mysqlSetCharset( $charset ) { $conn = $this->getBindingHandle(); - if ( method_exists( $conn, 'set_charset' ) ) { - return $conn->set_charset( $charset ); - } else { - return $this->query( 'SET NAMES ' . $charset, __METHOD__ ); - } + return $conn->set_charset( $charset ); } /** @@ -184,24 +178,6 @@ class DatabaseMysqli extends DatabaseMysqlBase { return $conn->affected_rows; } - function doSelectDomain( DatabaseDomain $domain ) { - $conn = $this->getBindingHandle(); - - if ( $domain->getSchema() !== null ) { - throw new DBExpectedError( $this, __CLASS__ . ": domain schemas are not supported." ); - } - - $database = $domain->getDatabase(); - 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