jenkins-bot has submitted this change and it was merged.

Change subject: Move QuestyCaptcha to its own place
......................................................................


Move QuestyCaptcha to its own place

Bug: T88047
Change-Id: I8c8f97d49dc39445dbba9c12909b81898838a253
---
D QuestyCaptcha.i18n.php
M QuestyCaptcha.php
R QuestyCaptcha/QuestyCaptcha.class.php
A QuestyCaptcha/QuestyCaptcha.php
M tests/QuestyCaptchaTest.php
5 files changed, 49 insertions(+), 83 deletions(-)

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



diff --git a/QuestyCaptcha.i18n.php b/QuestyCaptcha.i18n.php
deleted file mode 100644
index 4088d04..0000000
--- a/QuestyCaptcha.i18n.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * This is a backwards-compatibility shim, generated by:
- * 
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
- *
- * Beginning with MediaWiki 1.23, translation strings are stored in json files,
- * and the EXTENSION.i18n.php file only exists to provide compatibility with
- * older releases of MediaWiki. For more information about this migration, see:
- * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
- *
- * This shim maintains compatibility back to MediaWiki 1.17.
- */
-$messages = array();
-if ( !function_exists( 'wfJsonI18nShim0619ec35d45138ac' ) ) {
-       function wfJsonI18nShim0619ec35d45138ac( $cache, $code, &$cachedData ) {
-               $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
-               foreach ( $codeSequence as $csCode ) {
-                       $fileName = dirname( __FILE__ ) . 
"/i18n/questy/$csCode.json";
-                       if ( is_readable( $fileName ) ) {
-                               $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
-                               foreach ( array_keys( $data ) as $key ) {
-                                       if ( $key === '' || $key[0] === '@' ) {
-                                               unset( $data[$key] );
-                                       }
-                               }
-                               $cachedData['messages'] = array_merge( $data, 
$cachedData['messages'] );
-                       }
-
-                       $cachedData['deps'][] = new FileDependency( $fileName );
-               }
-               return true;
-       }
-
-       $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShim0619ec35d45138ac';
-}
diff --git a/QuestyCaptcha.php b/QuestyCaptcha.php
index 1951ac6..e51266b 100644
--- a/QuestyCaptcha.php
+++ b/QuestyCaptcha.php
@@ -1,48 +1,2 @@
 <?php
-/**
- * A question-based captcha plugin.
- *
- * Copyright (C) 2009 Benjamin Lees <[email protected]>
- * http://www.mediawiki.org/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Extensions
- */
-
-if ( !defined( 'MEDIAWIKI' ) ) {
-       exit;
-}
-
-require_once __DIR__ . '/ConfirmEdit.php';
-$wgCaptchaClass = 'QuestyCaptcha';
-
-global $wgCaptchaQuestions;
-$wgCaptchaQuestions = array();
-
-/* Add your questions in LocalSettings.php using this format
-$wgCaptchaQuestions = array(
-       'A question?' => 'An answer!',
-       'What is the capital of France?' => 'Paris', //Answers are normalized 
to lowercase: Paris and paris are the same
-       'What is this wiki's name?' => $wgSitename,
-       '2 + 2 ?' => array( '4', 'four' ), //Questions may have many answers
-);
-*/
-
-$wgMessagesDirs['QuestyCaptcha'] = __DIR__ . '/QuestyCaptcha/i18n';
-$wgExtensionMessagesFiles['QuestyCaptcha'] = __DIR__ . 
'/QuestyCaptcha.i18n.php';
-$wgAutoloadClasses['QuestyCaptcha'] = __DIR__ . '/QuestyCaptcha.class.php';
+require_once __DIR__ . "/QuestyCaptcha/QuestyCaptcha.php";
diff --git a/QuestyCaptcha.class.php b/QuestyCaptcha/QuestyCaptcha.class.php
similarity index 100%
rename from QuestyCaptcha.class.php
rename to QuestyCaptcha/QuestyCaptcha.class.php
diff --git a/QuestyCaptcha/QuestyCaptcha.php b/QuestyCaptcha/QuestyCaptcha.php
new file mode 100644
index 0000000..c9cd28d
--- /dev/null
+++ b/QuestyCaptcha/QuestyCaptcha.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * A question-based captcha plugin.
+ *
+ * Copyright (C) 2009 Benjamin Lees <[email protected]>
+ * http://www.mediawiki.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Extensions
+ */
+
+if ( !defined( 'MEDIAWIKI' ) ) {
+       exit;
+}
+
+require_once dirname( __DIR__ ) . '/ConfirmEdit.php';
+$wgCaptchaClass = 'QuestyCaptcha';
+
+global $wgCaptchaQuestions;
+$wgCaptchaQuestions = array();
+
+/* Add your questions in LocalSettings.php using this format
+$wgCaptchaQuestions = array(
+       'A question?' => 'An answer!',
+       'What is the capital of France?' => 'Paris', //Answers are normalized 
to lowercase: Paris and paris are the same
+       'What is this wiki's name?' => $wgSitename,
+       '2 + 2 ?' => array( '4', 'four' ), //Questions may have many answers
+);
+*/
+
+$wgMessagesDirs['QuestyCaptcha'] = __DIR__ . '/i18n';
+$wgAutoloadClasses['QuestyCaptcha'] = __DIR__ . '/QuestyCaptcha.class.php';
diff --git a/tests/QuestyCaptchaTest.php b/tests/QuestyCaptchaTest.php
index 1f758ce..4475541 100644
--- a/tests/QuestyCaptchaTest.php
+++ b/tests/QuestyCaptchaTest.php
@@ -14,7 +14,7 @@
                $this->setMwGlobals( 'wgCaptchaQuestions', $config );
                $this->mergeMwGlobalArrayValue(
                        'wgAutoloadClasses',
-                       array( 'QuestyCaptcha' => __DIR__ . 
'/../QuestyCaptcha.class.php' )
+                       array( 'QuestyCaptcha' => __DIR__ . 
'/../QuestyCaptcha/QuestyCaptcha.class.php' )
                );
 
                $qc = new QuestyCaptcha();

-- 
To view, visit https://gerrit.wikimedia.org/r/212571
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8c8f97d49dc39445dbba9c12909b81898838a253
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/ConfirmEdit
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to