aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQuery.php
diff options
context:
space:
mode:
authorAmir Sarabadani <ladsgroup@gmail.com>2023-06-01 12:40:34 +0200
committerLadsgroup <Ladsgroup@gmail.com>2023-06-01 11:11:58 +0000
commit1ff0188dbfd641e0fb8ba6a51be2f7b12ebb2ce2 (patch)
treee619866e8f05bf4ba05c4e87ed54f0960b342ef4 /includes/api/ApiQuery.php
parent8293b82dc69f9ebddb06001e3aed8b8c4dfc2506 (diff)
downloadmediawikicore-1ff0188dbfd641e0fb8ba6a51be2f7b12ebb2ce2.tar.gz
mediawikicore-1ff0188dbfd641e0fb8ba6a51be2f7b12ebb2ce2.zip
api: Drop ApiQuery::getNamedDB() and ApiQueryBase::selectNamedDB()
Both deprecated in 1.39 and hard-deprecated. Unused in production and allow us to clean up dependency of ApiQuery to LB. Depends-On: Ia94618b7f58fcca72e903fd2e2e9f0aaa501ac24 Change-Id: Ie0322e5346b94932a2eddc0b7aad5a384768b888
Diffstat (limited to 'includes/api/ApiQuery.php')
-rw-r--r--includes/api/ApiQuery.php32
1 files changed, 0 insertions, 32 deletions
diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php
index de98f4d83887..36cf086d35f8 100644
--- a/includes/api/ApiQuery.php
+++ b/includes/api/ApiQuery.php
@@ -25,8 +25,6 @@ use MediaWiki\MainConfigNames;
use MediaWiki\Title\Title;
use Wikimedia\ObjectFactory\ObjectFactory;
use Wikimedia\ParamValidator\ParamValidator;
-use Wikimedia\Rdbms\IDatabase;
-use Wikimedia\Rdbms\ILoadBalancer;
/**
* This is the main query class. It behaves similar to ApiMain: based on the
@@ -539,12 +537,8 @@ class ApiQuery extends ApiBase {
private $mPageSet;
private $mParams;
- private $mNamedDB = [];
private $mModuleMgr;
- /** @var ILoadBalancer */
- private $loadBalancer;
-
/** @var WikiExporterFactory */
private $wikiExporterFactory;
@@ -552,14 +546,12 @@ class ApiQuery extends ApiBase {
* @param ApiMain $main
* @param string $action
* @param ObjectFactory $objectFactory
- * @param ILoadBalancer $loadBalancer
* @param WikiExporterFactory $wikiExporterFactory
*/
public function __construct(
ApiMain $main,
$action,
ObjectFactory $objectFactory,
- ILoadBalancer $loadBalancer,
WikiExporterFactory $wikiExporterFactory
) {
parent::__construct( $main, $action );
@@ -582,7 +574,6 @@ class ApiQuery extends ApiBase {
// Create PageSet that will process titles/pageids/revids/generator
$this->mPageSet = new ApiPageSet( $this );
- $this->loadBalancer = $loadBalancer;
$this->wikiExporterFactory = $wikiExporterFactory;
}
@@ -595,29 +586,6 @@ class ApiQuery extends ApiBase {
}
/**
- * Get a cached database connection with a given name.
- *
- * If no such connection has been requested before, it will be created.
- * Subsequent calls with the same $name will return the same connection
- * as the first, regardless of the values of $db and $groups.
- *
- * @deprecated since 1.39 Use or override ApiBase::getDB() and optionally
- * pass a query group to wfGetDB() or ILoadBalancer::getConnectionRef().
- * @param string $name Name to assign to the database connection
- * @param int $db One of the DB_* constants
- * @param string|string[] $groups Query groups
- * @return IDatabase
- */
- public function getNamedDB( $name, $db, $groups ) {
- wfDeprecated( __METHOD__, '1.39' );
- if ( !array_key_exists( $name, $this->mNamedDB ) ) {
- $this->mNamedDB[$name] = $this->loadBalancer->getConnectionRef( $db, $groups );
- }
-
- return $this->mNamedDB[$name];
- }
-
- /**
* Gets the set of pages the user has requested (or generated)
* @return ApiPageSet
*/