diff --git a/extension.json b/extension.json index 47471412..8c26fd2a 100644 --- a/extension.json +++ b/extension.json @@ -27,7 +27,7 @@ "spamblacklist": "spamblacklistlog" }, "LogActionsHandlers": { - "spamblacklist/*": "SpamBlacklistLogFormatter" + "spamblacklist/*": "MediaWiki\\Extension\\SpamBlacklist\\SpamBlacklistLogFormatter" }, "GrantPermissions": { "viewrestrictedlogs": { @@ -35,7 +35,7 @@ } }, "APIModules": { - "spamblacklist": "ApiSpamBlacklist" + "spamblacklist": "MediaWiki\\Extension\\SpamBlacklist\\ApiSpamBlacklist" }, "MessagesDirs": { "SpamBlackList": [ @@ -44,14 +44,11 @@ ] }, "AutoloadClasses": { - "ApiSpamBlacklist": "includes/ApiSpamBlacklist.php", "BaseBlacklist": "includes/BaseBlacklist.php", - "EmailBlacklist": "includes/EmailBlacklist.php", - "SpamBlacklistHooks": "includes/SpamBlacklistHooks.php", - "SpamBlacklist": "includes/SpamBlacklist.php", - "SpamBlacklistLogFormatter": "includes/SpamBlacklistLogFormatter.php", - "SpamRegexBatch": "includes/SpamRegexBatch.php", - "SpamBlacklistPreAuthenticationProvider": "includes/SpamBlacklistPreAuthenticationProvider.php" + "MediaWiki\\Extension\\SpamBlacklist\\BaseBlacklist": "includes/BaseBlacklist.php" + }, + "AutoloadNamespaces": { + "MediaWiki\\Extension\\SpamBlacklist\\": "includes/" }, "ResourceModules": { "ext.spamBlacklist.visualEditor": { @@ -83,7 +80,7 @@ }, "HookHandlers": { "SpamBlacklistHookHandler": { - "class": "SpamBlacklistHooks" + "class": "MediaWiki\\Extension\\SpamBlacklist\\Hooks" } }, "config": { @@ -104,7 +101,7 @@ "AuthManagerAutoConfig": { "preauth": { "SpamBlacklistPreAuthenticationProvider": { - "class": "SpamBlacklistPreAuthenticationProvider" + "class": "MediaWiki\\Extension\\SpamBlacklist\\SpamBlacklistPreAuthenticationProvider" } } }, diff --git a/includes/ApiSpamBlacklist.php b/includes/ApiSpamBlacklist.php index 06f9263d..f89fda5b 100644 --- a/includes/ApiSpamBlacklist.php +++ b/includes/ApiSpamBlacklist.php @@ -22,6 +22,10 @@ * http://www.gnu.org/copyleft/gpl.html */ +namespace MediaWiki\Extension\SpamBlacklist; + +use ApiBase; +use ApiResult; use Wikimedia\ParamValidator\ParamValidator; /** @@ -44,7 +48,7 @@ class ApiSpamBlacklist extends ApiBase { if ( $matches !== false ) { // this url is blacklisted. $res->addValue( 'spamblacklist', 'result', 'blacklisted' ); - $res->setIndexedTagName( $matches, 'match' ); + ApiResult::setIndexedTagName( $matches, 'match' ); $res->addValue( 'spamblacklist', 'matches', $matches ); } else { // not blacklisted diff --git a/includes/BaseBlacklist.php b/includes/BaseBlacklist.php index b0f07dc3..4fa986d7 100644 --- a/includes/BaseBlacklist.php +++ b/includes/BaseBlacklist.php @@ -1,7 +1,14 @@ 'SpamBlacklist', - 'email' => 'EmailBlacklist', + 'spam' => SpamBlacklist::class, + 'email' => EmailBlacklist::class, ]; /** @@ -446,3 +453,5 @@ abstract class BaseBlacklist { // subclass this } } + +class_alias( BaseBlacklist::class, 'BaseBlacklist' ); diff --git a/includes/EmailBlacklist.php b/includes/EmailBlacklist.php index 789a89b3..eedbd53f 100644 --- a/includes/EmailBlacklist.php +++ b/includes/EmailBlacklist.php @@ -1,5 +1,10 @@ isLoaded( 'CheckUser' ) ) { $rc = $logEntry->getRecentChange( $logid ); - Hooks::updateCheckUserData( $rc ); + CUHooks::updateCheckUserData( $rc ); } } else { // If the log is unrestricted, publish normally to RC, diff --git a/includes/SpamBlacklistLogFormatter.php b/includes/SpamBlacklistLogFormatter.php index d158277a..78cb5376 100644 --- a/includes/SpamBlacklistLogFormatter.php +++ b/includes/SpamBlacklistLogFormatter.php @@ -1,5 +1,10 @@ setAccessible( true ); $reflProp->setValue( $instance, false ); }