Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git] / includes / libs / rdbms / database / DatabaseMysqli.php
index d0bd1b3..1a5cdab 100644 (file)
@@ -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,25 +178,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