From 833731c572a701894755ea029525fdcab8eaf6ef Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sat, 23 Feb 2019 21:41:33 +0100 Subject: [PATCH] Remove non-functional maintenance script testDiscussionParser.php It is calling an undeclared function, I have not found it in older version of that class. Change-Id: Ia9a432e1b90c76e8f1295c0afe4d12817bc232ae --- extension.json | 1 - maintenance/testDiscussionParser.php | 83 ---------------------------- 2 files changed, 84 deletions(-) delete mode 100644 maintenance/testDiscussionParser.php diff --git a/extension.json b/extension.json index cdbdaed72..e7c6df3e1 100644 --- a/extension.json +++ b/extension.json @@ -1027,7 +1027,6 @@ "SpecialNotificationsFormatter": "includes/formatters/SpecialNotificationsFormatter.php", "SpecialNotificationsMarkRead": "includes/special/SpecialNotificationsMarkRead.php", "SuppressionMaintenanceTest": "tests/phpunit/maintenance/SupressionMaintenanceTest.php", - "TestDiscussionParser": "maintenance/testDiscussionParser.php", "UpdateEchoSchemaForSuppression": "maintenance/updateEchoSchemaForSuppression.php", "EchoUpdatePerUserBlacklist": "maintenance/updatePerUserBlacklist.php" } diff --git a/maintenance/testDiscussionParser.php b/maintenance/testDiscussionParser.php deleted file mode 100644 index d24eeaf59..000000000 --- a/maintenance/testDiscussionParser.php +++ /dev/null @@ -1,83 +0,0 @@ -mDescription = "Takes enwiki revision IDs and attempts to identify interested users"; - - $this->addArg( 'revisions', 'Revision IDs, separated by commas', true /*required*/ ); - - $this->requireExtension( 'Echo' ); - } - - public function execute() { - $apiURL = 'http://en.wikipedia.org/w/api.php'; - - $revisions = explode( ',', $this->getArg( 0 ) ); - - // Retrieve original revisions and their predecessors - $requestData = [ - 'format' => 'php', - 'action' => 'query', - 'prop' => 'revisions', - 'revids' => implode( '|', $revisions ), - ]; - - $originalData = Http::post( - $apiURL, - [ - 'postData' => $requestData, - ] - ); - - $data = unserialize( $originalData ); - - $pages = $data['query']['pages']; - - foreach ( $pages as $page ) { - if ( count( $page['revisions'] ) !== 1 ) { - continue; - } - - $revid = $page['revisions'][0]['revid']; - - $newRequest = [ - 'format' => 'php', - 'action' => 'query', - 'prop' => 'revisions', - 'titles' => $page['title'], - 'rvstartid' => $revid, - 'rvlimit' => 2, - 'rvprop' => 'ids|content|user', - ]; - - $newData = Http::post( - $apiURL, - [ - 'postData' => $newRequest, - ] - ); - - $newData = unserialize( $newData ); - - $pageData = reset( $newData['query']['pages'] ); - $oldText = isset( $pageData['revisions'][1] ) - ? trim( $pageData['revisions'][1]['*'] ) . "\n" - : ''; - $newText = trim( $pageData['revisions'][0]['*'] ) . "\n"; - $user = $pageData['revisions'][0]['user']; - - print "http://en.wikipedia.org/w/index.php?diff=prev&oldid=$revid\n"; - EchoDiscussionParser::getInterestedUsers( $oldText, $newText, $user ); // FIXME: getInterestedUsers() is undefined - } - } -} - -$maintClass = TestDiscussionParser::class; -require_once RUN_MAINTENANCE_IF_MAIN;