summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2021-07-19 15:20:22 -0400
committerBrian Evans <grknight@gentoo.org>2021-07-19 15:20:22 -0400
commit9f092345e6bbecfde8c19e6d1490a6031a35f61f (patch)
tree2abb2398cd0df686e8608e15097ddc58b8995615 /MLEB/Translate/scripts/characterEditStats.php
parentOAuth: Update for fixes and security (diff)
downloadextensions-9f092345e6bbecfde8c19e6d1490a6031a35f61f.tar.gz
extensions-9f092345e6bbecfde8c19e6d1490a6031a35f61f.tar.bz2
extensions-9f092345e6bbecfde8c19e6d1490a6031a35f61f.zip
Update to MLEB 2021.06
Signed-off-by: Brian Evans <grknight@gentoo.org>
Diffstat (limited to 'MLEB/Translate/scripts/characterEditStats.php')
-rw-r--r--MLEB/Translate/scripts/characterEditStats.php19
1 files changed, 5 insertions, 14 deletions
diff --git a/MLEB/Translate/scripts/characterEditStats.php b/MLEB/Translate/scripts/characterEditStats.php
index 05a75331..d8a3d87b 100644
--- a/MLEB/Translate/scripts/characterEditStats.php
+++ b/MLEB/Translate/scripts/characterEditStats.php
@@ -10,7 +10,8 @@
*/
// Standard boilerplate to define $IP
-use MediaWiki\Extensions\Translate\SystemUsers\FuzzyBot;
+use MediaWiki\Extension\Translate\SystemUsers\FuzzyBot;
+use MediaWiki\MediaWikiServices;
if ( getenv( 'MW_INSTALL_PATH' ) !== false ) {
$IP = getenv( 'MW_INSTALL_PATH' );
@@ -115,19 +116,9 @@ class CharacterEditStats extends Maintenance {
$dbr = wfGetDB( DB_REPLICA );
$cutoff = $dbr->addQuotes( $dbr->timestamp( time() - $days * 24 * 3600 ) );
- // The field renames are to be compatible with recentchanges table query
- if ( is_callable( [ Revision::class, 'getQueryInfo' ] ) ) {
- $revQuery = Revision::getQueryInfo( [ 'page' ] );
- $revUserText = $revQuery['fields']['rev_user_text'] ?? 'rev_user_text';
- } else {
- $revQuery = [
- 'tables' => [ 'revision', 'page' ],
- 'joins' => [
- 'page' => [ 'JOIN', 'rev_page = page_id' ],
- ]
- ];
- $revUserText = 'rev_user_text';
- }
+ $revQuery = MediaWikiServices::getInstance()->getRevisionStore()->getQueryInfo( [ 'page' ] );
+ $revUserText = $revQuery['fields']['rev_user_text'] ?? 'rev_user_text';
+
$conds = [
"rev_timestamp > $cutoff",
'page_namespace' => $namespaces,