'Wikimedia\\Rdbms\\FakeResultWrapper' => __DIR__ . '/includes/libs/rdbms/database/resultwrapper/FakeResultWrapper.php',
'Wikimedia\\Rdbms\\Field' => __DIR__ . '/includes/libs/rdbms/field/Field.php',
'Wikimedia\\Rdbms\\IBlob' => __DIR__ . '/includes/libs/rdbms/encasing/IBlob.php',
+ 'Wikimedia\\Rdbms\\IDatabase' => __DIR__ . '/includes/libs/rdbms/database/IDatabase.php',
'Wikimedia\\Rdbms\\ILBFactory' => __DIR__ . '/includes/libs/rdbms/lbfactory/ILBFactory.php',
'Wikimedia\\Rdbms\\ILoadBalancer' => __DIR__ . '/includes/libs/rdbms/loadbalancer/ILoadBalancer.php',
'Wikimedia\\Rdbms\\ILoadMonitor' => __DIR__ . '/includes/libs/rdbms/loadmonitor/ILoadMonitor.php',
+ 'Wikimedia\\Rdbms\\IMaintainableDatabase' => __DIR__ . '/includes/libs/rdbms/database/IMaintainableDatabase.php',
'Wikimedia\\Rdbms\\IResultWrapper' => __DIR__ . '/includes/libs/rdbms/database/resultwrapper/IResultWrapper.php',
'Wikimedia\\Rdbms\\LBFactory' => __DIR__ . '/includes/libs/rdbms/lbfactory/LBFactory.php',
'Wikimedia\\Rdbms\\LBFactoryMulti' => __DIR__ . '/includes/libs/rdbms/lbfactory/LBFactoryMulti.php',
* @file
*/
+use Wikimedia\Rdbms\IDatabase;
use MediaWiki\MediaWikiServices;
class Block {
* @file
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* The "CategoryFinder" class takes a list of articles, creates an internal
* representation of all their parent categories (as well as parents of
require_once __DIR__ . '/libs/rdbms/defines.php';
require_once __DIR__ . '/compat/normal/UtfNormalDefines.php';
+use Wikimedia\Rdbms\IDatabase;
+
/**
* @defgroup Constants MediaWiki constants
*/
* @file
*/
use Wikimedia\Timestamp\TimestampException;
+use Wikimedia\Rdbms\IDatabase;
/**
* Handles the backend logic of merging the histories of two
*
* @file
*/
+
+use Wikimedia\Rdbms\IDatabase;
use MediaWiki\Linker\LinkTarget;
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\ResultWrapper;
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* List for revision table items for a single page
/** @var ResultWrapper|bool */
protected $res;
- /** @var bool|object */
+ /** @var bool|Revision */
protected $current;
/**
* @file
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Static accessor class for site_stats and related things
*/
*
* @file
*/
+
+use Wikimedia\Rdbms\IDatabase;
use MediaWiki\Linker\LinkTarget;
use MediaWiki\Interwiki\InterwikiLookup;
use MediaWiki\MediaWikiServices;
<?php
+use Wikimedia\Rdbms\IDatabase;
use MediaWiki\Linker\LinkTarget;
use Wikimedia\Assert\Assert;
use Wikimedia\Rdbms\LoadBalancer;
<?php
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Extension mechanism for WatchedItemQueryService
<?php
+use Wikimedia\Rdbms\IDatabase;
use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
use MediaWiki\Linker\LinkTarget;
use MediaWiki\MediaWikiServices;
* @file
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* This abstract class implements many basic API functions, and is the base of
* all API classes.
*/
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* This class contains a list of pages that the client has requested.
* @file
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Query module to enumerate all available pages.
*
use Wikimedia\Rdbms\ResultWrapper;
use Wikimedia\Rdbms\FakeResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Class for fetching backlink lists, approximate backlink counts and
use MediaWiki\Linker\LinkTarget;
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Class representing a list of titles
* @file
* @ingroup Cache
*/
+use Wikimedia\Rdbms\IDatabase;
use MediaWiki\Linker\LinkTarget;
use MediaWiki\MediaWikiServices;
* @file
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* LCStore implementation which uses the standard DB functions to store data.
* This will work on any MediaWiki installation.
* @author Matthew Flaschen
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* An individual filter in a boolean group
*
* @author Matthew Flaschen
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Represents a filter group with multiple string options. They are passed to the server as
* a single form parameter separated by a delimiter. The parameter name is the
$className = 'ChangeTagsLogList';
break;
default:
- throw new Exception( "Class $className requested, but does not exist" );
+ throw new Exception( "Class $typeName requested, but does not exist" );
}
+
return new $className( $context, $title, $ids );
}
* @ingroup Change tagging
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Stores a list of taggable log entries.
* @since 1.25
* @ingroup Change tagging
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Stores a list of taggable revisions.
* @since 1.25
* @ingroup Database
*/
use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\IMaintainableDatabase;
class CloneDatabase {
/** @var string Table prefix for cloning */
<?php
+use Wikimedia\Rdbms\IDatabase;
+
/**
* The oci8 extension is fairly weak and doesn't support oci_num_rows, among
* other things. We use a wrapper class to handle that and other
<?php
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Deferrable Update for closure/callback updates via IDatabase::doAtomicSection()
* @since 1.27
<?php
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Deferrable Update for closure/callback updates that should use auto-commit mode
* @since 1.28
*
* @file
*/
+use Wikimedia\Rdbms\IDatabase;
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\LBFactory;
use Wikimedia\Rdbms\LoadBalancer;
*/
use MediaWiki\MediaWikiServices;
use Wikimedia\ScopedCallback;
+use Wikimedia\Rdbms\IDatabase;
/**
* Update object handling the cleanup of links tables after a page was deleted.
* @file
*/
+use Wikimedia\Rdbms\IDatabase;
use MediaWiki\MediaWikiServices;
use Wikimedia\ScopedCallback;
<?php
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Deferrable Update for closure/callback
*/
*/
use MediaWiki\MediaWikiServices;
use Wikimedia\Assert\Assert;
+use Wikimedia\Rdbms\IDatabase;
/**
* Class for handling updates to the site_stats table
* @file
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* @deprecated Since 1.28 Use DataUpdate directly, injecting the database
*/
<?php
use Psr\Log\LoggerInterface;
+use Wikimedia\Rdbms\IDatabase;
/**
* Class for fixing stale WANObjectCache keys using a purge event source
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* @ingroup SpecialPage Dump
*/
use Wikimedia\Rdbms\LoadBalancer;
+use Wikimedia\Rdbms\IDatabase;
/**
* DB accessable external objects.
*/
use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\IDatabase;
/**
* Version of FileJournal that logs to a DB table
<?php
+
+use Wikimedia\Rdbms\IDatabase;
+
/**
* MySQL version of DBLockManager that supports shared locks.
*
* @ingroup FileRepo
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* A foreign repository with an accessible MediaWiki database
*
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* A repository that stores files in the local filesystem and registers them
*/
use \MediaWiki\Logger\LoggerFactory;
+use Wikimedia\Rdbms\IDatabase;
/**
* Class to represent a local file in the wiki's own database
* @ingroup Deployment
*/
use Wikimedia\Rdbms\LBFactorySingle;
+use Wikimedia\Rdbms\IDatabase;
/**
* Base class for DBMS-specific installation helper classes.
* @file
* @ingroup Deployment
*/
+use Wikimedia\Rdbms\IDatabase;
use MediaWiki\MediaWikiServices;
require_once __DIR__ . '/../../maintenance/Maintenance.php';
* @file
* @author Aaron Schulz
*/
+use Wikimedia\Rdbms\IDatabase;
use MediaWiki\MediaWikiServices;
use Wikimedia\ScopedCallback;
*
* @file
*/
+use Wikimedia\Rdbms\IDatabase;
use MediaWiki\MediaWikiServices;
class PurgeJobUtils {
* @ingroup LockManager
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Version of LockManager based on using named/row DB locks.
*
use Database;
use DBConnRef;
-use IDatabase;
use InvalidArgumentException;
/**
use Wikimedia\Rdbms\DatabaseDomain;
use Wikimedia\Rdbms\ILoadBalancer;
use Wikimedia\Rdbms\DBMasterPos;
+use Wikimedia\Rdbms\IDatabase;
/**
* Helper class to handle automatically marking connections as reusable (via RAII pattern)
use Wikimedia\Rdbms\DBMasterPos;
use Wikimedia\Rdbms\Blob;
use Wikimedia\Timestamp\ConvertibleTimestamp;
+use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Rdbms\IMaintainableDatabase;
/**
* Relational database abstraction object
}
$class = 'Database' . ucfirst( $driver );
- if ( class_exists( $class ) && is_subclass_of( $class, 'IDatabase' ) ) {
+ if ( class_exists( $class ) && is_subclass_of( $class, IDatabase::class ) ) {
// Resolve some defaults for b/c
$p['host'] = isset( $p['host'] ) ? $p['host'] : false;
$p['user'] = isset( $p['user'] ) ? $p['user'] : false;
* @file
* @ingroup Database
*/
+namespace Wikimedia\Rdbms;
+
use Wikimedia\ScopedCallback;
-use Wikimedia\Rdbms\Blob;
-use Wikimedia\Rdbms\LikeMatch;
-use Wikimedia\Rdbms\DBMasterPos;
-use Wikimedia\Rdbms\Field;
-use Wikimedia\Rdbms\IResultWrapper;
+use DBError;
+use DBConnectionError;
+use DBUnexpectedError;
+use DBQueryError;
+use Exception;
+use RuntimeException;
+use UnexpectedValueException;
+use stdClass;
/**
* Basic database interface for live and lazy-loaded relation database handles
*/
public function setTableAliases( array $aliases );
}
+
+class_alias( 'Wikimedia\Rdbms\IDatabase', 'IDatabase' );
* @file
* @ingroup Database
*/
+namespace Wikimedia\Rdbms;
+
+use Exception;
+use RuntimeException;
+use DBUnexpectedError;
/**
* Advanced database interface for IDatabase handles that include maintenance methods
$oldName, $newName, $temporary = false, $fname = __METHOD__
);
}
+
+class_alias( 'Wikimedia\Rdbms\IMaintainableDatabase', 'IMaintainableDatabase' );
<?php
+
+use Wikimedia\Rdbms\IMaintainableDatabase;
+
/**
* Helper class to handle automatically marking connections as reusable (via RAII pattern)
* as well handling deferring the actual network connection until the handle is used
namespace Wikimedia\Rdbms;
-use IDatabase;
use stdClass;
use RuntimeException;
<?php
use Wikimedia\Rdbms\ILoadBalancer;
+use Wikimedia\Rdbms\IDatabase;
/**@{
* Database related constants
* @file
* @ingroup Database
*/
+use Wikimedia\Rdbms\IDatabase;
/**
* @ingroup Database
* @file
* @ingroup Database
*/
+use Wikimedia\Rdbms\IDatabase;
/**
* Database error base class
* @file
* @ingroup Database
*/
+use Wikimedia\Rdbms\IDatabase;
/**
* Base class for the more common types of database errors. These are known to occur
* @file
* @ingroup Database
*/
+use Wikimedia\Rdbms\IDatabase;
/**
* @ingroup Database
use WANObjectCache;
use Exception;
use RuntimeException;
-use IDatabase;
use DBTransactionError;
use DBReplicationWaitError;
'errorLogger' => $this->errorLogger,
'hostname' => $this->hostname,
'cliMode' => $this->cliMode,
- 'agent' => $this->agent
+ 'agent' => $this->agent,
+ 'chronologyProtector' => $this->getChronologyProtector()
];
}
namespace Wikimedia\Rdbms;
-use IDatabase;
use InvalidArgumentException;
/**
public function getMainLB( $domain = false ) {
$section = $this->getSectionForDomain( $domain );
if ( !isset( $this->mainLBs[$section] ) ) {
- $lb = $this->newMainLB( $domain );
- $this->getChronologyProtector()->initLB( $lb );
- $this->mainLBs[$section] = $lb;
+ $this->mainLBs[$section] = $this->newMainLB( $domain );
}
return $this->mainLBs[$section];
public function getExternalLB( $cluster ) {
if ( !isset( $this->extLBs[$cluster] ) ) {
$this->extLBs[$cluster] = $this->newExternalLB( $cluster );
- $this->getChronologyProtector()->initLB( $this->extLBs[$cluster] );
}
return $this->extLBs[$cluster];
public function getMainLB( $domain = false ) {
if ( !isset( $this->mainLB ) ) {
$this->mainLB = $this->newMainLB( $domain );
- $this->getChronologyProtector()->initLB( $this->mainLB );
}
return $this->mainLB;
public function getExternalLB( $cluster ) {
if ( !isset( $this->extLBs[$cluster] ) ) {
$this->extLBs[$cluster] = $this->newExternalLB( $cluster );
- $this->getChronologyProtector()->initLB( $this->extLBs[$cluster] );
}
return $this->extLBs[$cluster];
namespace Wikimedia\Rdbms;
-use IDatabase;
use InvalidArgumentException;
use BadMethodCallException;
*/
namespace Wikimedia\Rdbms;
-use IDatabase;
use Database;
use DBConnRef;
use MaintainableDBConnRef;
* - srvCache : BagOStuff object for server cache [optional]
* - memCache : BagOStuff object for cluster memory cache [optional]
* - wanCache : WANObjectCache object [optional]
+ * - chronologyProtector: ChronologyProtector object [optional]
* - hostname : The name of the current server [optional]
* - cliMode: Whether the execution context is a CLI script. [optional]
* - profiler : Class name or instance with profileIn()/profileOut() methods. [optional]
* If a DB_REPLICA connection has been opened already, then wait immediately.
* Otherwise sets a variable telling it to wait if such a connection is opened.
*
- * @param DBMasterPos $pos
+ * @param DBMasterPos|bool $pos Master position or false
*/
public function waitFor( $pos );
*
* This can be used a faster proxy for waitForAll()
*
- * @param DBMasterPos $pos
+ * @param DBMasterPos|bool $pos Master position or false
* @param int $timeout Max seconds to wait; default is mWaitTimeout
* @return bool Success (able to connect and no timeouts reached)
*/
/**
* Set the master wait position and wait for ALL replica DBs to catch up to it
*
- * @param DBMasterPos $pos
+ * @param DBMasterPos|bool $pos Master position or false
* @param int $timeout Max seconds to wait; default is mWaitTimeout
* @return bool Success (able to connect and no timeouts reached)
*/
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Wikimedia\ScopedCallback;
-use IDatabase;
use Database;
use DBConnRef;
use MaintainableDBConnRef;
/** @var ILoadMonitor */
private $loadMonitor;
+ /** @var ChronologyProtector|null */
+ private $chronProt;
/** @var BagOStuff */
private $srvCache;
/** @var BagOStuff */
/** @var boolean */
private $disabled = false;
+ /** @var boolean */
+ private $chronProtInitialized = false;
/** @var integer Warn when this many connection are held */
const CONN_HELD_WARN_THRESHOLD = 10;
: ( gethostname() ?: 'unknown' );
$this->cliMode = isset( $params['cliMode'] ) ? $params['cliMode'] : PHP_SAPI === 'cli';
$this->agent = isset( $params['agent'] ) ? $params['agent'] : '';
+
+ if ( isset( $params['chronologyProtector'] ) ) {
+ $this->chronProt = $params['chronologyProtector'];
+ }
}
/**
return $i;
}
- /**
- * @param DBMasterPos|false $pos
- */
public function waitFor( $pos ) {
+ $oldPos = $this->mWaitForPos;
$this->mWaitForPos = $pos;
- $i = $this->mReadIndex;
+ // If a generic reader connection was already established, then wait now
+ $i = $this->mReadIndex;
if ( $i > 0 ) {
if ( !$this->doWait( $i ) ) {
$this->laggedReplicaMode = true;
}
}
+
+ // Restore the older position if it was higher
+ $this->setWaitForPositionIfHigher( $oldPos );
}
public function waitForOne( $pos, $timeout = null ) {
+ $oldPos = $this->mWaitForPos;
$this->mWaitForPos = $pos;
$i = $this->mReadIndex;
$ok = true; // no applicable loads
}
+ // Restore the older position if it was higher
+ $this->setWaitForPositionIfHigher( $oldPos );
+
return $ok;
}
public function waitForAll( $pos, $timeout = null ) {
+ $oldPos = $this->mWaitForPos;
$this->mWaitForPos = $pos;
$serverCount = count( $this->mServers );
}
}
+ // Restore the older position if it was higher
+ $this->setWaitForPositionIfHigher( $oldPos );
+
return $ok;
}
+ /**
+ * @param DBMasterPos|bool $pos
+ */
+ private function setWaitForPositionIfHigher( $pos ) {
+ if ( !$pos ) {
+ return;
+ }
+
+ if ( !$this->mWaitForPos || $pos->hasReached( $this->mWaitForPos ) ) {
+ $this->mWaitForPos = $pos;
+ }
+ }
+
/**
* @param int $i
* @return IDatabase|bool
$domain = false; // local connection requested
}
+ if ( !$this->chronProtInitialized && $this->chronProt ) {
+ $this->connLogger->debug( __METHOD__ . ': calling initLB() before first connection.' );
+ // Load CP positions before connecting so that doWait() triggers later if needed
+ $this->chronProtInitialized = true;
+ $this->chronProt->initLB( $this );
+ }
+
if ( $domain !== false ) {
$conn = $this->openForeignConnection( $i, $domain );
} elseif ( isset( $this->mConns['local'][$i][0] ) ) {
namespace Wikimedia\Rdbms;
-use IDatabase;
use InvalidArgumentException;
/**
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Wikimedia\ScopedCallback;
-use IDatabase;
use BagOStuff;
/**
namespace Wikimedia\Rdbms;
-use IDatabase;
use BagOStuff;
/**
* @since 1.19
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Interface for log entries. Every log entry has these methods.
*
*/
use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\IDatabase;
class LogEventsList extends ContextSource {
const NO_ACTION_LINK = 1;
* @ingroup Cache
*/
+use Wikimedia\Rdbms\IDatabase;
use \MediaWiki\MediaWikiServices;
use \Wikimedia\WaitConditionLoop;
use \Wikimedia\Rdbms\TransactionProfiler;
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Used to show archived pages and eventually restore them.
use \MediaWiki\Logger\LoggerFactory;
use \MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\FakeResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Class representing a MediaWiki article and history.
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* IndexPager is an efficient pager which uses a (roughly unique) index in the
* @author Roan Kattouw
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Abstraction for ResourceLoader modules which pull from wiki pages
*
* @ingroup RevisionDelete
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* List for archive table items, i.e. revisions deleted via action=delete
*/
* @ingroup RevisionDelete
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* List for filearchive table items
*/
* @ingroup RevisionDelete
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Item class for an oldimage table row
*/
* @ingroup RevisionDelete
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* List for oldimage table items
*/
* @ingroup RevisionDelete
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* List for logging table items
*/
*/
use Wikimedia\Rdbms\FakeResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* List for revision table items
* @ingroup RevisionDelete
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Backend functions for suppressing and unsuppressing all references to a given user,
* used when blocking with HideUser enabled. This was spun out of SpecialBlockip.php
* @ingroup Search
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Base search engine base class for database-backed searches
* @ingroup Search
<?php
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Factory class for SearchEngine.
* Allows to create engine of the specific type.
*/
use MediaWiki\Logger\LoggerFactory;
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Special page which uses a ChangesList to show query results.
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Variant of QueryPage which uses a gallery to output results, thus
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Variant of QueryPage which formats the result as a simple link to the page
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* This is a class for doing query pages; since they're almost all the same,
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Class definition for a wanted query page like
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* A special page listing redirects to non existent page. Those should be
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* A special page listing redirects to redirecting page.
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Special:LinkSearch to search the external-links table.
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Special:ListDuplicatedFiles Lists all files where the current version is
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Special:Listredirects - Lists all the redirects on the wiki.
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* @ingroup SpecialPage
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* A special page that list pages that have highest category count
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* A special page that listed pages that have highest interwiki count
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* A special page to show pages ordered by the number of pages linking to them.
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* A querypage to show categories ordered in descending order by the pages in them
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Special page lists templates with a large number of
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* SpecialShortpages extends QueryPage. It is used to return the shortest
*/
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* A special page that displays a list of pages that are not on anyones watchlist.
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* A special page that lists last changes made to the wiki,
* @todo Use some variant of Pager or something; the pagination here is lousy.
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Implements Special:Whatlinkshere
*
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\ResultWrapper;
use Wikimedia\Rdbms\FakeResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
class ContribsPager extends ReverseChronologicalPager {
* @file
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Represents a "user group membership" -- a specific instance of a user belonging
* to a group. For example, the fact that user Mary belongs to the sysop group is a
* @file
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Cut-down copy of User interface for local-interwiki-database
* user rights manipulation.
<?php
+
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Allows iterating a large number of rows in batches transparently.
* By default when iterated over returns the full query result as an
* @file
* @ingroup Maintenance
*/
+use Wikimedia\Rdbms\IDatabase;
use \MediaWiki\MediaWikiServices;
class BatchRowWriter {
$maintClass = false;
+use Wikimedia\Rdbms\IDatabase;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\LBFactory;
require_once __DIR__ . '/../includes/export/DumpFilter.php';
use Wikimedia\Rdbms\LoadBalancer;
+use Wikimedia\Rdbms\IDatabase;
/**
* @ingroup Dump Maintenance
*/
use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\IDatabase;
require_once __DIR__ . '/Maintenance.php';
* @author Timo Tijhof
*/
-use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\IDatabase;
require_once __DIR__ . '/Maintenance.php';
* @ingroup Maintenance
*/
+use Wikimedia\Rdbms\IDatabase;
+
require_once __DIR__ . '/Maintenance.php';
/**
require_once __DIR__ . '/Maintenance.php';
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Maintenance script to run a database query in batches and wait for replica DBs.
*
require_once __DIR__ . '/Maintenance.php';
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
/**
* Maintenance script that sends SQL queries from the specified file to the database.
* @ingroup Testing
*/
+use Wikimedia\Rdbms\IMaintainableDatabase;
+
class DbTestRecorder extends TestRecorder {
public $version;
+ /** @var Database */
private $db;
- public function __construct( IDatabase $db ) {
+ public function __construct( IMaintainableDatabase $db ) {
$this->db = $db;
}
* @file
* @ingroup Testing
*/
+use Wikimedia\Rdbms\IDatabase;
use MediaWiki\MediaWikiServices;
use Wikimedia\ScopedCallback;
<?php
+use Wikimedia\Rdbms\IDatabase;
+
/**
* @group Database
* @group Database
<?php
use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\IDatabase;
class ResourceLoaderWikiModuleTest extends ResourceLoaderTestCase {