Merge "rdbms: allow construction of Database objects without connecting"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 14 Mar 2018 09:57:18 +0000 (09:57 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 14 Mar 2018 09:57:18 +0000 (09:57 +0000)
1  2 
includes/libs/rdbms/database/Database.php

@@@ -68,18 -74,16 +74,18 @@@ abstract class Database implements IDat
        protected $lastWriteTime = false;
        /** @var string|bool */
        protected $phpError = false;
-       /** @var string */
+       /** @var string Server that this instance is currently connected to */
        protected $server;
-       /** @var string */
+       /** @var string User that this instance is currently connected under the name of */
        protected $user;
-       /** @var string */
+       /** @var string Password used to establish the current connection */
        protected $password;
-       /** @var string */
+       /** @var string Database that this instance is currently connected to */
        protected $dbName;
 -      /** @var array[] $aliases Map of (table => (dbname, schema, prefix) map) */
 +      /** @var array[] Map of (table => (dbname, schema, prefix) map) */
        protected $tableAliases = [];
 +      /** @var string[] Map of (index alias => index) */
 +      protected $indexAliases = [];
        /** @var bool Whether this PHP instance is for a CLI script */
        protected $cliMode;
        /** @var string Agent name for query profiling */
                $this->tableAliases = $aliases;
        }
  
-       /**
-        * @return bool Whether a DB user is required to access the DB
-        * @since 1.28
-        */
-       protected function requiresDatabaseUser() {
-               return true;
-       }
 +      public function setIndexAliases( array $aliases ) {
 +              $this->indexAliases = $aliases;
 +      }
 +
        /**
         * Get the underlying binding connection handle
         *