[MediaWiki-commits] [Gerrit] mediawiki...StopForumSpam[master]: Add extension.json, deprecate PHP entry point

2016-12-20 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327432 )

Change subject: Add extension.json, deprecate PHP entry point
..


Add extension.json, deprecate PHP entry point

Bug: T98668

Change-Id: Ia0cd1358abdcc522184f917ec300906590c31926
---
M StopForumSpam.php
A extension.json
2 files changed, 93 insertions(+), 104 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/StopForumSpam.php b/StopForumSpam.php
index 38de890..6cae80b 100644
--- a/StopForumSpam.php
+++ b/StopForumSpam.php
@@ -1,107 +1,14 @@
 https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+   );
+   return true;
+} else {
+   die( 'This version of the StopFormSpam extension requires MediaWiki 
1.25+' );
 }
-
-/**
- * StopForumSpam.com is a website dedicated to
- * stopping spam. This extension helps
- * by utilizing and contributing to their
- * data.
- *
- * @see http://stopforumspam.com/faq
- * @author Kunal Mehta 
- * @license GPL v2 or higher
- */
-
-/**
- * Your API key for stopforumspam.com
- * @see http://stopforumspam.com/signup
- */
-$wgSFSAPIKey = '';
-
-/**
- * Location on the server where the IP blacklist can be found
- * File should be unzipped and in the "Record summary" format
- * @see http://www.stopforumspam.com/downloads/
- */
-$wgSFSIPListLocation = false;
-
-/**
- * Whether to validate the IP addresses in the blacklist file
- * Adds a bit of processing time, but safer.
- */
-$wgSFSValidateIPList = true;
-
-/**
- * Whether to update the IP blacklist as a DeferredUpdate at the end of a 
pageload
- * (warning: can be very slow depending on your processor speed and cache 
settings)
- * If disabled, you will need to run the updateBlacklist.php maintenance 
script,
- * setting up a cron job to do this is recommended.
- */
-$wgSFSEnableDeferredUpdates = true;
-
-/**
- * How many times an IP needs to be reported before it is added to the 
blacklist
- * This corresponds to the 2nd field in the record summary CSV
- */
-$wgSFSIPThreshold = 5;
-
-/*
- * How long (in seconds) the IP blacklist should be cached for
- * If you are using the 7 day blacklist, try 5 days (432000)
- * If you are using the 30 day blacklist, try 14 days (1209600)
- * The default is 5 days
- */
-$wgSFSBlacklistCacheDuration = 432000;
-
-/**
- * Whether to enable the confidence variable for Extension:AbuseFilter
- * The variable will make external API requests
- */
-$wgSFSEnableConfidenceVariable = true;
-
-$wgExtensionCredits['antispam'][] = array(
-   'path' => __FILE__,
-   'name' => 'StopForumSpam',
-   'author' => array( 'Kunal Mehta', 'Ryan Schmidt' ),
-   'url' => 'https://www.mediawiki.org/wiki/Extension:StopForumSpam',
-   'descriptionmsg' => 'stopforumspam-desc',
-   'version' => '0.2.0',
-   'license-name' => 'GPL-2.0+',
-);
-
-$wgAutoloadClasses['SFSHooks'] = __DIR__ . '/StopForumSpam.hooks.php';
-$wgAutoloadClasses['StopForumSpam'] = __DIR__ . '/StopForumSpam.body.php';
-$wgAutoloadClasses['BlacklistUpdate'] = __DIR__ . '/BlacklistUpdate.php';
-
-$wgHooks['SpecialPageBeforeFormDisplay'][] = 
'SFSHooks::onSpecialPageBeforeFormDisplay';
-$wgHooks['SpecialBlockModifyFormFields'][] = 
'SFSHooks::onSpecialBlockModifyFormFields';
-$wgHooks['BlockIpComplete'][] = 'SFSHooks::onBlockIpComplete';
-$wgHooks['AbuseFilter-computeVariable'][] = 
'SFSHooks::abuseFilterComputeVariable';
-$wgHooks['AbuseFilter-generateUserVars'][] = 
'SFSHooks::abuseFilterGenerateUserVars';
-$wgHooks['AbuseFilter-builder'][] = 'SFSHooks::abuseFilterBuilder';
-$wgHooks['getUserPermissionsErrorsExpensive'][] = 
'SFSHooks::onGetUserPermissionsErrorsExpensive';
-$wgHooks['OtherBlockLogLink'][] = 'SFSHooks::onOtherBlockLogLink';
-$wgHooks['UnitTestsList'][] = 'SFSHooks::onUnitTestsList';
-
-$wgMessagesDirs['StopForumSpam'] = __DIR__ . '/i18n';
-
-$wgResourceModules['ext.SFS.formhack'] = array(
-   'scripts' => array(
-   'ext.SFS.formhack.js',
-   ),
-   'dependencies' => array(
-   'mediawiki.jqueryMsg',
-   'mediawiki.special.block', // not sure if this is actually 
required
-   ),
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'StopForumSpam',
-);
-
-$wgGroupPermissions['sysop']['stopforumspam'] = true;
-$wgGroupPermissions['sysop']['sfsblock-bypass'] = true;
-$wgAvailableRights[] = 'sfsblock-bypass';
-$wgAvailableRights[] = 'stopforumspam';
-
diff --git a/extension.json b/extension.json
new file mode 100644
index 000..e96f97e
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,82 @@
+{
+   "name": "StopForumSpam",
+   "version": "0.2.0",
+   "author": [
+   "Kunal Mehta",
+   "Ryan Schmidt"
+   ],
+   "url": "https://www.mediawiki.org/wiki/Extension:StopForumSpam;,
+   "descriptionmsg": "stopforumspam-desc",
+   "license-name": 

[MediaWiki-commits] [Gerrit] mediawiki...StopForumSpam[master]: Add extension.json, deprecate PHP entry point

2016-12-14 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327432 )

Change subject: Add extension.json, deprecate PHP entry point
..

Add extension.json, deprecate PHP entry point

Change-Id: Ia0cd1358abdcc522184f917ec300906590c31926
---
M StopForumSpam.php
A extension.json
2 files changed, 93 insertions(+), 104 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/StopForumSpam 
refs/changes/32/327432/1

diff --git a/StopForumSpam.php b/StopForumSpam.php
index 38de890..6cae80b 100644
--- a/StopForumSpam.php
+++ b/StopForumSpam.php
@@ -1,107 +1,14 @@
 https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+   );
+   return true;
+} else {
+   die( 'This version of the StopFormSpam extension requires MediaWiki 
1.25+' );
 }
-
-/**
- * StopForumSpam.com is a website dedicated to
- * stopping spam. This extension helps
- * by utilizing and contributing to their
- * data.
- *
- * @see http://stopforumspam.com/faq
- * @author Kunal Mehta 
- * @license GPL v2 or higher
- */
-
-/**
- * Your API key for stopforumspam.com
- * @see http://stopforumspam.com/signup
- */
-$wgSFSAPIKey = '';
-
-/**
- * Location on the server where the IP blacklist can be found
- * File should be unzipped and in the "Record summary" format
- * @see http://www.stopforumspam.com/downloads/
- */
-$wgSFSIPListLocation = false;
-
-/**
- * Whether to validate the IP addresses in the blacklist file
- * Adds a bit of processing time, but safer.
- */
-$wgSFSValidateIPList = true;
-
-/**
- * Whether to update the IP blacklist as a DeferredUpdate at the end of a 
pageload
- * (warning: can be very slow depending on your processor speed and cache 
settings)
- * If disabled, you will need to run the updateBlacklist.php maintenance 
script,
- * setting up a cron job to do this is recommended.
- */
-$wgSFSEnableDeferredUpdates = true;
-
-/**
- * How many times an IP needs to be reported before it is added to the 
blacklist
- * This corresponds to the 2nd field in the record summary CSV
- */
-$wgSFSIPThreshold = 5;
-
-/*
- * How long (in seconds) the IP blacklist should be cached for
- * If you are using the 7 day blacklist, try 5 days (432000)
- * If you are using the 30 day blacklist, try 14 days (1209600)
- * The default is 5 days
- */
-$wgSFSBlacklistCacheDuration = 432000;
-
-/**
- * Whether to enable the confidence variable for Extension:AbuseFilter
- * The variable will make external API requests
- */
-$wgSFSEnableConfidenceVariable = true;
-
-$wgExtensionCredits['antispam'][] = array(
-   'path' => __FILE__,
-   'name' => 'StopForumSpam',
-   'author' => array( 'Kunal Mehta', 'Ryan Schmidt' ),
-   'url' => 'https://www.mediawiki.org/wiki/Extension:StopForumSpam',
-   'descriptionmsg' => 'stopforumspam-desc',
-   'version' => '0.2.0',
-   'license-name' => 'GPL-2.0+',
-);
-
-$wgAutoloadClasses['SFSHooks'] = __DIR__ . '/StopForumSpam.hooks.php';
-$wgAutoloadClasses['StopForumSpam'] = __DIR__ . '/StopForumSpam.body.php';
-$wgAutoloadClasses['BlacklistUpdate'] = __DIR__ . '/BlacklistUpdate.php';
-
-$wgHooks['SpecialPageBeforeFormDisplay'][] = 
'SFSHooks::onSpecialPageBeforeFormDisplay';
-$wgHooks['SpecialBlockModifyFormFields'][] = 
'SFSHooks::onSpecialBlockModifyFormFields';
-$wgHooks['BlockIpComplete'][] = 'SFSHooks::onBlockIpComplete';
-$wgHooks['AbuseFilter-computeVariable'][] = 
'SFSHooks::abuseFilterComputeVariable';
-$wgHooks['AbuseFilter-generateUserVars'][] = 
'SFSHooks::abuseFilterGenerateUserVars';
-$wgHooks['AbuseFilter-builder'][] = 'SFSHooks::abuseFilterBuilder';
-$wgHooks['getUserPermissionsErrorsExpensive'][] = 
'SFSHooks::onGetUserPermissionsErrorsExpensive';
-$wgHooks['OtherBlockLogLink'][] = 'SFSHooks::onOtherBlockLogLink';
-$wgHooks['UnitTestsList'][] = 'SFSHooks::onUnitTestsList';
-
-$wgMessagesDirs['StopForumSpam'] = __DIR__ . '/i18n';
-
-$wgResourceModules['ext.SFS.formhack'] = array(
-   'scripts' => array(
-   'ext.SFS.formhack.js',
-   ),
-   'dependencies' => array(
-   'mediawiki.jqueryMsg',
-   'mediawiki.special.block', // not sure if this is actually 
required
-   ),
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'StopForumSpam',
-);
-
-$wgGroupPermissions['sysop']['stopforumspam'] = true;
-$wgGroupPermissions['sysop']['sfsblock-bypass'] = true;
-$wgAvailableRights[] = 'sfsblock-bypass';
-$wgAvailableRights[] = 'stopforumspam';
-
diff --git a/extension.json b/extension.json
new file mode 100644
index 000..e96f97e
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,82 @@
+{
+   "name": "StopForumSpam",
+   "version": "0.2.0",
+   "author": [
+   "Kunal Mehta",
+   "Ryan Schmidt"
+   ],
+   "url": "https://www.mediawiki.org/wiki/Extension:StopForumSpam;,
+   "descriptionmsg": "stopforumspam-desc",
+