From: Aaron Schulz Date: Fri, 29 Mar 2019 21:56:18 +0000 (-0700) Subject: Replace several uses of wfWikiId() with WikiMap methods X-Git-Tag: 1.34.0-rc.0~2227^2~1 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=a8447a337b24103e81831bf444b7edbc47f22aa5;p=lhc%2Fweb%2Fwiklou.git Replace several uses of wfWikiId() with WikiMap methods Also, reword some related comments. Change-Id: I8aefa42f96b90e9ea871cf7ec1afcc7ed82a19b2 --- diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 295d5d0488..6faac9655c 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -218,7 +218,7 @@ class ApiMain extends ApiBase { 'cookies' => $sessionCookies, 'ip' => $request->getIP(), 'userAgent' => $this->getUserAgent(), - 'wiki' => wfWikiID(), + 'wiki' => WikiMap::getCurrentWikiDbDomain()->getId(), ] ); } @@ -1633,7 +1633,7 @@ class ApiMain extends ApiBase { 'ts' => time(), 'ip' => $request->getIP(), 'userAgent' => $this->getUserAgent(), - 'wiki' => wfWikiID(), + 'wiki' => WikiMap::getCurrentWikiDbDomain()->getId(), 'timeSpentBackend' => (int)round( $time * 1000 ), 'hadError' => $e !== null, 'errorCodes' => [], @@ -1653,7 +1653,7 @@ class ApiMain extends ApiBase { 'method' => $request->getMethod(), 'client_ip' => $request->getIP() ], - 'database' => wfWikiID(), + 'database' => WikiMap::getCurrentWikiDbDomain()->getId(), 'backend_time_ms' => (int)round( $time * 1000 ), ]; diff --git a/includes/db/MWLBFactory.php b/includes/db/MWLBFactory.php index fc5b18abca..416993c2bc 100644 --- a/includes/db/MWLBFactory.php +++ b/includes/db/MWLBFactory.php @@ -243,8 +243,8 @@ abstract class MWLBFactory { "\$wgDBservers has dbname='$srvDB' but \$wgDBname='$ldDB'. " . "Set \$wgDBname to the database used by this wiki project. " . "There is rarely a need to set 'dbname' in \$wgDBservers. " . - "Functions like wfWikiId(), remote wiki database access, the use " . - "of Database::getDomainId(), and other features are not reliable when " . + "Cross-wiki database access, use of WikiMap::getCurrentWikiDbDomain(), " . + "use of Database::getDomainId(), and other features are not reliable when " . "\$wgDBservers does not match the local wiki database/prefix." ); MWExceptionRenderer::output( $e, MWExceptionRenderer::AS_PRETTY ); @@ -260,8 +260,8 @@ abstract class MWLBFactory { "\$wgDBservers has tablePrefix='$srvTP' but \$wgDBprefix='$ldTP'. " . "Set \$wgDBprefix to the table prefix used by this wiki project. " . "There is rarely a need to set 'tablePrefix' in \$wgDBservers. " . - "Functions like wfWikiId(), remote wiki database access, the use " . - "of Database::getDomainId(), and other features are not reliable when " . + "Cross-wiki database access, use of WikiMap::getCurrentWikiDbDomain(), " . + "use of Database::getDomainId(), and other features are not reliable when " . "\$wgDBservers does not match the local wiki database/prefix." ); MWExceptionRenderer::output( $e, MWExceptionRenderer::AS_PRETTY );