[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Change DatabaseBase => IDatabase in /db where possible
jenkins-bot has submitted this change and it was merged. Change subject: Change DatabaseBase => IDatabase in /db where possible .. Change DatabaseBase => IDatabase in /db where possible Change-Id: Ia0a049cd4294c5a39aa9ed228d4eb5b15736ea1f --- M includes/db/CloneDatabase.php M includes/db/Database.php M includes/db/DatabaseMssql.php M includes/db/DatabaseMysqlBase.php M includes/db/DatabaseOracle.php M includes/db/DatabasePostgres.php M includes/db/DatabaseSqlite.php M includes/db/DatabaseUtility.php M includes/db/loadbalancer/LBFactorySingle.php M includes/db/loadbalancer/LoadBalancer.php M includes/libs/rdbms/database/IDatabase.php M includes/libs/rdbms/database/RBConnRef.php 12 files changed, 65 insertions(+), 68 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 97d59d8..caca7e2 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -43,13 +43,13 @@ /** * Constructor * -* @param DatabaseBase $db A database subclass +* @param IDatabase $db A database subclass * @param array $tablesToClone An array of tables to clone, unprefixed * @param string $newTablePrefix Prefix to assign to the tables * @param string $oldTablePrefix Prefix on current tables, if not $wgDBprefix * @param bool $dropCurrentTables */ - public function __construct( DatabaseBase $db, array $tablesToClone, + public function __construct( IDatabase $db, array $tablesToClone, $newTablePrefix, $oldTablePrefix = '', $dropCurrentTables = true ) { $this->db = $db; @@ -131,7 +131,7 @@ global $wgDBprefix; wfGetLBFactory()->forEachLB( function( LoadBalancer $lb ) use ( $prefix ) { $lb->setDomainPrefix( $prefix ); - $lb->forEachOpenConnection( function ( DatabaseBase $db ) use ( $prefix ) { + $lb->forEachOpenConnection( function ( IDatabase $db ) use ( $prefix ) { $db->tablePrefix( $prefix ); } ); } ); diff --git a/includes/db/Database.php b/includes/db/Database.php index 109dbfe..e68a8f2 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -231,7 +231,7 @@ * connection object, by specifying no parameters to __construct(). This * feature is deprecated and should be removed. * -* DatabaseBase subclasses should not be constructed directly in external +* IDatabase classes should not be constructed directly in external * code. DatabaseBase::factory() should be used instead. * * @param array $params Parameters passed from DatabaseBase::factory() @@ -301,7 +301,7 @@ /** * Given a DB type, construct the name of the appropriate child class of -* DatabaseBase. This is designed to replace all of the manual stuff like: +* IDatabase. This is designed to replace all of the manual stuff like: *$class = 'Database' . ucfirst( strtolower( $dbType ) ); * as well as validate against the canonical list of DB types we have * @@ -318,8 +318,8 @@ * @param string $dbType A possible DB type * @param array $p An array of options to pass to the constructor. *Valid options are: host, user, password, dbname, flags, tablePrefix, schema, driver -* @throws MWException If the database driver or extension cannot be found -* @return DatabaseBase|null DatabaseBase subclass or null +* @return IDatabase|null If the database driver or extension cannot be found +* @throws MWException */ final public static function factory( $dbType, $p = [] ) { global $wgCommandLineMode; @@ -368,7 +368,7 @@ ]; $class = 'Database' . ucfirst( $driver ); - if ( class_exists( $class ) && is_subclass_of( $class, 'DatabaseBase' ) ) { + if ( class_exists( $class ) && is_subclass_of( $class, 'IDatabase' ) ) { // Resolve some defaults for b/c $p['host'] = isset( $p['host'] ) ? $p['host'] : false; $p['user'] = isset( $p['user'] ) ? $p['user'] : false; @@ -398,7 +398,7 @@ } public function setLogger( LoggerInterface $logger ) { - $this->quertLogger = $logger; + $this->queryLogger = $logger; } public function getServerInfo() { @@ -494,12 +494,6 @@ } } - /** -* Set a lazy-connecting DB handle to the master DB (for replication status purposes) -* -* @param IDatabase $conn -* @since
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Change DatabaseBase => IDatabase in /db where possible
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/310722 Change subject: Change DatabaseBase => IDatabase in /db where possible .. Change DatabaseBase => IDatabase in /db where possible Change-Id: Ia0a049cd4294c5a39aa9ed228d4eb5b15736ea1f --- M includes/db/CloneDatabase.php M includes/db/Database.php M includes/db/DatabaseMssql.php M includes/db/DatabaseMysqlBase.php M includes/db/DatabaseOracle.php M includes/db/DatabasePostgres.php M includes/db/DatabaseSqlite.php M includes/db/DatabaseUtility.php M includes/db/loadbalancer/LBFactorySingle.php M includes/db/loadbalancer/LoadBalancer.php M includes/libs/rdbms/database/IDatabase.php M includes/libs/rdbms/database/RBConnRef.php 12 files changed, 65 insertions(+), 68 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/22/310722/1 diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 97d59d8..caca7e2 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -43,13 +43,13 @@ /** * Constructor * -* @param DatabaseBase $db A database subclass +* @param IDatabase $db A database subclass * @param array $tablesToClone An array of tables to clone, unprefixed * @param string $newTablePrefix Prefix to assign to the tables * @param string $oldTablePrefix Prefix on current tables, if not $wgDBprefix * @param bool $dropCurrentTables */ - public function __construct( DatabaseBase $db, array $tablesToClone, + public function __construct( IDatabase $db, array $tablesToClone, $newTablePrefix, $oldTablePrefix = '', $dropCurrentTables = true ) { $this->db = $db; @@ -131,7 +131,7 @@ global $wgDBprefix; wfGetLBFactory()->forEachLB( function( LoadBalancer $lb ) use ( $prefix ) { $lb->setDomainPrefix( $prefix ); - $lb->forEachOpenConnection( function ( DatabaseBase $db ) use ( $prefix ) { + $lb->forEachOpenConnection( function ( IDatabase $db ) use ( $prefix ) { $db->tablePrefix( $prefix ); } ); } ); diff --git a/includes/db/Database.php b/includes/db/Database.php index 109dbfe..e68a8f2 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -231,7 +231,7 @@ * connection object, by specifying no parameters to __construct(). This * feature is deprecated and should be removed. * -* DatabaseBase subclasses should not be constructed directly in external +* IDatabase classes should not be constructed directly in external * code. DatabaseBase::factory() should be used instead. * * @param array $params Parameters passed from DatabaseBase::factory() @@ -301,7 +301,7 @@ /** * Given a DB type, construct the name of the appropriate child class of -* DatabaseBase. This is designed to replace all of the manual stuff like: +* IDatabase. This is designed to replace all of the manual stuff like: *$class = 'Database' . ucfirst( strtolower( $dbType ) ); * as well as validate against the canonical list of DB types we have * @@ -318,8 +318,8 @@ * @param string $dbType A possible DB type * @param array $p An array of options to pass to the constructor. *Valid options are: host, user, password, dbname, flags, tablePrefix, schema, driver -* @throws MWException If the database driver or extension cannot be found -* @return DatabaseBase|null DatabaseBase subclass or null +* @return IDatabase|null If the database driver or extension cannot be found +* @throws MWException */ final public static function factory( $dbType, $p = [] ) { global $wgCommandLineMode; @@ -368,7 +368,7 @@ ]; $class = 'Database' . ucfirst( $driver ); - if ( class_exists( $class ) && is_subclass_of( $class, 'DatabaseBase' ) ) { + if ( class_exists( $class ) && is_subclass_of( $class, 'IDatabase' ) ) { // Resolve some defaults for b/c $p['host'] = isset( $p['host'] ) ? $p['host'] : false; $p['user'] = isset( $p['user'] ) ? $p['user'] : false; @@ -398,7 +398,7 @@ } public function setLogger( LoggerInterface $logger ) { - $this->quertLogger = $logger; + $this->queryLogger = $logger; } public function getServerInfo() { @@ -494,12 +494,6 @@ } } - /** -* Set a lazy-connecting DB handle to the master DB (for replication status purposes) -* -*