[MediaWiki-commits] [Gerrit] mediawiki...UploadWizard[master]: Fix multiple PHP class declarations in one file

2018-01-24 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406136 )

Change subject: Fix multiple PHP class declarations in one file
..

Fix multiple PHP class declarations in one file

All files containing more than one PHP class were split into
multiple files.

extension.json was updated to match new class locations.

phpcs `OneObjectStructurePerFile.MultipleFound` rule was
re-enabled.

Bug: T177809
Change-Id: If3c9024ec5456a3fae17989b99d16f53b8c8165a
---
M .phpcs.xml
M extension.json
M includes/specials/SpecialUploadWizard.php
A includes/specials/UploadWizardSimpleForm.php
4 files changed, 25 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/36/406136/1

diff --git a/.phpcs.xml b/.phpcs.xml
index 5595999..1b1f247 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -1,7 +1,6 @@
 
 

-   



diff --git a/extension.json b/extension.json
index 1dfeb69..8ac3610 100644
--- a/extension.json
+++ b/extension.json
@@ -98,7 +98,7 @@
"SpecialCampaigns": "includes/specials/SpecialCampaigns.php",
"ApiQueryAllCampaigns": "includes/ApiQueryAllCampaigns.php",
"ApiFlickrBlacklist": "includes/ApiFlickrBlacklist.php",
-   "UploadWizardSimpleForm": 
"includes/specials/SpecialUploadWizard.php"
+   "UploadWizardSimpleForm": 
"includes/specials/UploadWizardSimpleForm.php"
},
"ResourceModules": {
"ext.uploadWizard.formDataTransport": {
diff --git a/includes/specials/SpecialUploadWizard.php 
b/includes/specials/SpecialUploadWizard.php
index cc34855..7108d38 100644
--- a/includes/specials/SpecialUploadWizard.php
+++ b/includes/specials/SpecialUploadWizard.php
@@ -367,17 +367,3 @@
return 'media';
}
 }
-
-/**
- * This is a hack on UploadForm, to make one that works from UploadWizard when 
JS is not available.
- */
-class UploadWizardSimpleForm extends UploadForm {
-
-   /**
-* Normally, UploadForm adds its own Javascript.
-* We wish to prevent this, because we want to control the case where 
we have Javascript.
-* So, we make the addUploadJS a no-op.
-*/
-   protected function addUploadJS() {
-   }
-}
diff --git a/includes/specials/UploadWizardSimpleForm.php 
b/includes/specials/UploadWizardSimpleForm.php
new file mode 100644
index 000..692c995
--- /dev/null
+++ b/includes/specials/UploadWizardSimpleForm.php
@@ -0,0 +1,24 @@
+https://gerrit.wikimedia.org/r/406136
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3c9024ec5456a3fae17989b99d16f53b8c8165a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...WikiLexicalData[master]: Add PHP_CodeSniffer for codestyle checks

2018-01-24 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406044 )

Change subject: Add PHP_CodeSniffer for codestyle checks
..

Add PHP_CodeSniffer for codestyle checks

All failing rules are excluded now, but will be reenabled in
next patches.

Bug: T185492
Change-Id: Ib985f56931f4694d82a3ec7e0dc82e8c3d153748
---
A .phpcs.xml
M composer.json
2 files changed, 126 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLexicalData 
refs/changes/44/406044/1

diff --git a/.phpcs.xml b/.phpcs.xml
new file mode 100644
index 000..e54d791
--- /dev/null
+++ b/.phpcs.xml
@@ -0,0 +1,123 @@
+
+
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   .
+   
+   
+
diff --git a/composer.json b/composer.json
index 7d306d5..7f42a6e 100644
--- a/composer.json
+++ b/composer.json
@@ -2,14 +2,17 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/mediawiki-codesniffer": "15.0.0",
"mediawiki/minus-x": "0.2.1"
},
"scripts": {
"test": [
"parallel-lint . --exclude vendor --exclude 
node_modules",
+   "phpcs -p -s",
"minus-x check ."
],
"fix": [
+   "phpcbf",
"minus-x fix ."
]
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib985f56931f4694d82a3ec7e0dc82e8c3d153748
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiLexicalData
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Fix multiple PHP class declarations in one file in tests

2018-01-22 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405718 )

Change subject: Fix multiple PHP class declarations in one file in tests
..

Fix multiple PHP class declarations in one file in tests

All files containing more than one PHP class were split into
multiple files.

extension.json was updated to match new class locations.

phpcs `OneObjectStructurePerFile.MultipleFound` rule was
re-enabled.

Bug: T177809
Change-Id: I6fc2ec9cc35e6bac5a7c44d94b0f1b1b40e6dba5
---
M .phpcs.xml
M extension.json
M tests/phpunit/mapper/AbstractMapperTest.php
A tests/phpunit/mapper/EchoAbstractMapperStub.php
A tests/phpunit/mapper/EchoExecuteFirstArgumentStub.php
M tests/phpunit/mapper/NotificationMapperTest.php
6 files changed, 31 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/18/405718/1

diff --git a/.phpcs.xml b/.phpcs.xml
index 0df77d8..b7fd44c 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -3,7 +3,6 @@
.


-   



diff --git a/extension.json b/extension.json
index 088b764..76c3493 100644
--- a/extension.json
+++ b/extension.json
@@ -919,7 +919,7 @@
"ContainmentSetTest": "tests/phpunit/ContainmentSetTest.php",
"EchoAbstractEntity": "includes/model/AbstractEntity.php",
"EchoAbstractMapper": "includes/mapper/AbstractMapper.php",
-   "EchoAbstractMapperStub": 
"tests/phpunit/mapper/AbstractMapperTest.php",
+   "EchoAbstractMapperStub": 
"tests/phpunit/mapper/EchoAbstractMapperStub.php",
"EchoAbstractMapperTest": 
"tests/phpunit/mapper/AbstractMapperTest.php",
"EchoArrayList": "includes/EchoArrayList.php",
"EchoAttributeManager": "includes/AttributeManager.php",
@@ -948,7 +948,7 @@
"EchoEventMapper": "includes/mapper/EventMapper.php",
"EchoEventMapperTest": 
"tests/phpunit/mapper/EventMapperTest.php",
"EchoEventPresentationModel": 
"includes/formatters/EventPresentationModel.php",
-   "EchoExecuteFirstArgumentStub": 
"tests/phpunit/mapper/NotificationMapperTest.php",
+   "EchoExecuteFirstArgumentStub": 
"tests/phpunit/mapper/EchoExecuteFirstArgumentStub.php",
"EchoFilteredSequentialIterator": 
"includes/iterator/FilteredSequentialIterator.php",
"EchoFlyoutFormatter": 
"includes/formatters/EchoFlyoutFormatter.php",
"EchoForeignNotifications": "includes/ForeignNotifications.php",
diff --git a/tests/phpunit/mapper/AbstractMapperTest.php 
b/tests/phpunit/mapper/AbstractMapperTest.php
index 5c3a582..1d97789 100644
--- a/tests/phpunit/mapper/AbstractMapperTest.php
+++ b/tests/phpunit/mapper/AbstractMapperTest.php
@@ -65,13 +65,3 @@
}
 
 }
-
-/**
- * Create a stub class for testing the abstract class
- */
-class EchoAbstractMapperStub extends EchoAbstractMapper {
-
-   public function testMethod() {
-   }
-
-}
diff --git a/tests/phpunit/mapper/EchoAbstractMapperStub.php 
b/tests/phpunit/mapper/EchoAbstractMapperStub.php
new file mode 100644
index 000..359e97f
--- /dev/null
+++ b/tests/phpunit/mapper/EchoAbstractMapperStub.php
@@ -0,0 +1,11 @@
+arguments ) {
+   throw new PHPUnit_Framework_Exception( 'Method call 
must have an argument' );
+   }
+
+   return call_user_func( reset( $invocation->arguments ) );
+   }
+
+   public function toString() {
+   return 'return result of call_user_func on first invocation 
argument';
+   }
+}
diff --git a/tests/phpunit/mapper/NotificationMapperTest.php 
b/tests/phpunit/mapper/NotificationMapperTest.php
index 024d817..68cca03 100644
--- a/tests/phpunit/mapper/NotificationMapperTest.php
+++ b/tests/phpunit/mapper/NotificationMapperTest.php
@@ -250,20 +250,3 @@
}
 
 }
-
-class EchoExecuteFirstArgumentStub implements 
PHPUnit_Framework_MockObject_Stub {
-   public function invoke( PHPUnit_Framework_MockObject_Invocation 
$invocation ) {
-   if ( !$invocation instanceof 
PHPUnit_Framework_MockObject_Invocation_Static ) {
-   throw new PHPUnit_Framework_Exception( 'wrong 
invocation type' );
-   }
-   if ( !$invocation->arguments ) {
-   throw new PHPUnit_Framework_Exception( 'Method call 
must have an argument' );
-   }
-
-   return call_user_func( reset( $invocation->arguments ) );
-   }
-
-   public function toString() {
-   return 'return result of call_user_func on first invocation 
argument';
-   }
-}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: 

[MediaWiki-commits] [Gerrit] mediawiki...WikiLexicalData[master]: Fix multiple PHP class declarations in one file

2018-01-21 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405665 )

Change subject: Fix multiple PHP class declarations in one file
..

Fix multiple PHP class declarations in one file

All files containing more than one PHP class were split into
multiple files.

Autoloader references were updated to match new class locations.

Bug: T177809
Change-Id: I25f6230396010d53f772408e083608d18dbe5a9c
---
M includes/setup/OWSpecials.php
A includes/specials/ExternalResources.php
M includes/specials/SpecialOWAddFromExternalAPI.php
R includes/specials/WordnikExtension.php
A includes/specials/WordnikWiktionaryExtension.php
A includes/specials/WordnikWordnetExtension.php
6 files changed, 199 insertions(+), 188 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLexicalData 
refs/changes/65/405665/1

diff --git a/includes/setup/OWSpecials.php b/includes/setup/OWSpecials.php
index 27818f9..cb01023 100644
--- a/includes/setup/OWSpecials.php
+++ b/includes/setup/OWSpecials.php
@@ -106,6 +106,7 @@
 $wgAutoloadClasses['SpecialImportTSV'] = $wgWldSpecialsScriptPath . 
'SpecialImportTSV.php';
 
 $wgAutoloadClasses['SpecialOWAddFromExternalAPI'] = $wgWldSpecialsScriptPath . 
'SpecialOWAddFromExternalAPI.php';
+$wgAutoloadClasses['ExternalResources'] = $wgWldSpecialsScriptPath . 
'ExternalResources.php';
 
 // $wgAutoloadClasses['SpecialTransaction'] = $dir . 
'OmegaWiki/SpecialTransaction.php';
 
@@ -136,9 +137,9 @@
 $wgWldExtenalResourceLanguages = array();
 
 if ( file_exists( $wgWldScriptPath . '/external/wordnik/wordnik/Swagger.php' ) 
) {
-   $wgAutoloadClasses['WordnikExtension' ] = $wgWldSpecialsScriptPath . 
'ExternalWordnik.php';
-   $wgAutoloadClasses['WordnikWiktionaryExtension' ] = 
$wgWldSpecialsScriptPath . 'ExternalWordnik.php';
-   $wgAutoloadClasses['WordnikWordnetExtension' ] = 
$wgWldSpecialsScriptPath . 'ExternalWordnik.php';
+   $wgAutoloadClasses['WordnikExtension' ] = $wgWldSpecialsScriptPath . 
'WordnikExtension.php';
+   $wgAutoloadClasses['WordnikWiktionaryExtension' ] = 
$wgWldSpecialsScriptPath . 'WordnikWiktionaryExtension.php';
+   $wgAutoloadClasses['WordnikWordnetExtension' ] = 
$wgWldSpecialsScriptPath . 'WordnikWordnetExtension.php';
$wgWldProcessExternalAPIClasses['WordnikExtension'] = 'Wordnik';
$wgWldProcessExternalAPIClasses['WordnikWiktionaryExtension'] = 
'Wordnik Wiktionary';
$wgWldProcessExternalAPIClasses['WordnikWordnetExtension'] = 'Wordnik 
Wordnet';
diff --git a/includes/specials/ExternalResources.php 
b/includes/specials/ExternalResources.php
new file mode 100644
index 000..5659fff
--- /dev/null
+++ b/includes/specials/ExternalResources.php
@@ -0,0 +1,175 @@
+wgOut = $wgOut;
+   $this->spTitle = $spTitle;
+   $this->source = $source;
+   $this->sourceLabel = $source;
+   $this->sourceLanguageId = $sourceLanguageId;
+   $this->search = $search;
+   $this->collectionId = $collectionId;
+   }
+
+   public function execute() {
+   $this->outputTitle();
+   $this->getOptionPanel();
+   $this->checkConnectionStatus();
+
+   // inline css ( for future refactoring )
+   // removes from data when finished testing
+   $this->wgOut->addHTML( $this->temporaryCodeSpace() );
+
+   if ( $this->source ) {
+   switch ( $this->connection ) {
+   case true:
+   $this->checkExternalDefinition();
+   $this->checkOmegaWikiDefinition();
+   if ( $this->externalExists and 
$this->owlExists ) {
+   $this->setExternalDefinition();
+   $this->setOmegaWikiDefinition();
+   $this->createChoice();
+   }
+   break;
+   case false:
+   $this->wgOut->addHtml( 'Sorry, there is 
a problem with the connection. Can not find ' . $this->search );
+   break;
+   }
+   }
+   }
+
+   private function temporaryCodeSpace() {
+   return '' .
+   '#ext-data {visibility: hidden; display: none }' .
+   '#owl-data {visibility: hidden; display: none }' .
+   '';
+   }
+
+   private function createChoice() {
+   $owlLineProcessed = false;
+   $ctr = 0;
+   $this->wgOut->addHTML(
+   ''.
+   ''
+   );
+   $this->wgOut->addHTML(
+   ''

[MediaWiki-commits] [Gerrit] mediawiki...Wikispeech[master]: Fix multiple PHP class declarations in one file

2018-01-21 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405663 )

Change subject: Fix multiple PHP class declarations in one file
..

Fix multiple PHP class declarations in one file

All files containing more than one PHP class were split into
multiple files.

extension.json was updated to match new class locations.

Bug: T177809
Change-Id: I61a20cbf83925ad07f7f665ad83032bf0f6f36c2
---
M extension.json
R includes/CleanedText.php
A includes/SegmentBreak.php
3 files changed, 19 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikispeech 
refs/changes/63/405663/1

diff --git a/extension.json b/extension.json
index 6f7cebb..4d50ef2 100644
--- a/extension.json
+++ b/extension.json
@@ -18,8 +18,8 @@
"AutoloadClasses": {
"SpecialWikispeech": "specials/SpecialWikispeech.php",
"WikispeechHooks": "Hooks.php",
-   "CleanedText": "includes/CleanedContent.php",
-   "SegmentBreak": "includes/CleanedContent.php",
+   "CleanedText": "includes/CleanedText.php",
+   "SegmentBreak": "includes/SegmentBreak.php",
"Cleaner": "includes/Cleaner.php",
"HtmlGenerator": "includes/HtmlGenerator.php",
"Segmenter": "includes/Segmenter.php",
diff --git a/includes/CleanedContent.php b/includes/CleanedText.php
similarity index 89%
rename from includes/CleanedContent.php
rename to includes/CleanedText.php
index c03e872..a0f3c66 100644
--- a/includes/CleanedContent.php
+++ b/includes/CleanedText.php
@@ -60,13 +60,3 @@
return $element;
}
 }
-
-/**
- * Denotes a break between to segments. Added by `Cleaner` and
- * consumed by `Segmenter`.
- *
- * @since 0.0.1
- */
-
-class SegmentBreak {
-}
diff --git a/includes/SegmentBreak.php b/includes/SegmentBreak.php
new file mode 100644
index 000..497ebe2
--- /dev/null
+++ b/includes/SegmentBreak.php
@@ -0,0 +1,17 @@
+https://gerrit.wikimedia.org/r/405663
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61a20cbf83925ad07f7f665ad83032bf0f6f36c2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikispeech
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Fix multiple PHP class declarations in one file

2018-01-21 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405608 )

Change subject: Fix multiple PHP class declarations in one file
..

Fix multiple PHP class declarations in one file

All files containing more than one PHP class were splitted into
multiple files.
extension.json was updated to match new class locations.

Bug: T177809
Change-Id: I4e7d8f02164c3048c41c4c9fbe4be18a99e7abaa
---
M extension.json
D includes/ContainmentSet.php
A includes/EchoArrayList.php
A includes/EchoCachedList.php
A includes/EchoContainmentList.php
A includes/EchoContainmentSet.php
A includes/EchoDiffGroup.php
R includes/EchoDiffParser.php
A includes/EchoOnWikiList.php
9 files changed, 397 insertions(+), 371 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/08/405608/1

diff --git a/extension.json b/extension.json
index 3928781..088b764 100644
--- a/extension.json
+++ b/extension.json
@@ -921,18 +921,18 @@
"EchoAbstractMapper": "includes/mapper/AbstractMapper.php",
"EchoAbstractMapperStub": 
"tests/phpunit/mapper/AbstractMapperTest.php",
"EchoAbstractMapperTest": 
"tests/phpunit/mapper/AbstractMapperTest.php",
-   "EchoArrayList": "includes/ContainmentSet.php",
+   "EchoArrayList": "includes/EchoArrayList.php",
"EchoAttributeManager": "includes/AttributeManager.php",
"EchoAttributeManagerTest": 
"tests/phpunit/AttributeManagerTest.php",
-   "EchoCachedList": "includes/ContainmentSet.php",
+   "EchoCachedList": "includes/EchoCachedList.php",
"EchoCallbackIterator": 
"includes/iterator/CallbackIterator.php",
"EchoCatchableFatalErrorException": 
"includes/exception/CatchableFatalErrorException.php",
-   "EchoContainmentList": "includes/ContainmentSet.php",
-   "EchoContainmentSet": "includes/ContainmentSet.php",
+   "EchoContainmentList": "includes/EchoContainmentList.php",
+   "EchoContainmentSet": "includes/EchoContainmentSet.php",
"EchoDataOutputFormatter": "includes/DataOutputFormatter.php",
"EchoDeferredMarkAsDeletedUpdate": 
"includes/DeferredMarkAsDeletedUpdate.php",
-   "EchoDiffGroup": "includes/DiffParser.php",
-   "EchoDiffParser": "includes/DiffParser.php",
+   "EchoDiffGroup": "includes/EchoDiffGroup.php",
+   "EchoDiffParser": "includes/EchoDiffParser.php",
"EchoDiffParserTest": "tests/phpunit/DiffParserTest.php",
"EchoDiscussionParser": "includes/DiscussionParser.php",
"EchoDiscussionParserTest": 
"tests/phpunit/DiscussionParserTest.php",
@@ -975,7 +975,7 @@
"EchoNotificationTest": 
"tests/phpunit/model/NotificationTest.php",
"EchoNotifier": "includes/Notifier.php",
"EchoOOUI\\LabelIconWidget": 
"includes/ooui/LabelIconWidget.php",
-   "EchoOnWikiList": "includes/ContainmentSet.php",
+   "EchoOnWikiList": "includes/EchoOnWikiList.php",
"EchoPageLinkedPresentationModel": 
"includes/formatters/PageLinkedPresentationModel.php",
"EchoPlainTextDigestEmailFormatter": 
"includes/formatters/EchoPlainTextDigestEmailFormatter.php",
"EchoPlainTextEmailFormatter": 
"includes/formatters/EchoPlainTextEmailFormatter.php",
diff --git a/includes/ContainmentSet.php b/includes/ContainmentSet.php
deleted file mode 100644
index 5b779d0..000
--- a/includes/ContainmentSet.php
+++ /dev/null
@@ -1,271 +0,0 @@
-addArray( $wgSomeGlobalParameter );
- *   $set->addOnWiki( NS_USER, 'Foo/bar-baz', $cache, 
'some_user_specific_cache_key' );
- *
- * Usage:
- *   if ( $set->contains( 'SomeUser' ) ) {
- *   ...
- *   }
- */
-class EchoContainmentSet {
-   /**
-* @var EchoContainmentList[]
-*/
-   protected $lists = [];
-
-   /**
-* @var User
-*/
-   protected $recipient;
-
-   public function __construct( User $recipient ) {
-   $this->recipient = $recipient;
-   }
-
-   /**
-* Add an EchoContainmentList to the set of lists checked by 
self::contains()
-*
-* @param EchoContainmentList $list
-*/
-   public function add( EchoContainmentList $list ) {
-   $this->lists[] = $list;
-   }
-
-   /**
-* Add a php array to the set of lists checked by self::contains()
-*
-* @param array $list
-*/
-   public function addArray( array $list ) {
-   $this->add( new EchoArrayList( $list ) );
-   }
-
-   /**
-* Add a list from a user preference to the set of lists checked by 
self::contains().
-*
-* @param string $preferenceName
-*/
-   public function 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix multiple PHP class declarations in one file in includes/...

2018-01-20 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/40 )

Change subject: Fix multiple PHP class declarations in one file in 
includes/htmlform
..

Fix multiple PHP class declarations in one file in includes/htmlform

All files containing more than one PHP class were splitted into
multiple files. Autoloader references were updated to match new
class locations.

Bug: T177809
Change-Id: I5c39293b4d96fba821a9c9a1ece9d9907303c6cf
---
M autoload.php
A includes/htmlform/HTMLFormActionFieldLayout.php
M includes/htmlform/HTMLFormElement.php
A includes/htmlform/HTMLFormFieldLayout.php
4 files changed, 34 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/55/40/1

diff --git a/autoload.php b/autoload.php
index 9e557e1..0736657 100644
--- a/autoload.php
+++ b/autoload.php
@@ -562,11 +562,11 @@
'HTMLFileCache' => __DIR__ . '/includes/cache/HTMLFileCache.php',
'HTMLFloatField' => __DIR__ . 
'/includes/htmlform/fields/HTMLFloatField.php',
'HTMLForm' => __DIR__ . '/includes/htmlform/HTMLForm.php',
-   'HTMLFormActionFieldLayout' => __DIR__ . 
'/includes/htmlform/HTMLFormElement.php',
+   'HTMLFormActionFieldLayout' => __DIR__ . 
'/includes/htmlform/HTMLFormActionFieldLayout.php',
'HTMLFormElement' => __DIR__ . '/includes/htmlform/HTMLFormElement.php',
'HTMLFormField' => __DIR__ . '/includes/htmlform/HTMLFormField.php',
'HTMLFormFieldCloner' => __DIR__ . 
'/includes/htmlform/fields/HTMLFormFieldCloner.php',
-   'HTMLFormFieldLayout' => __DIR__ . 
'/includes/htmlform/HTMLFormElement.php',
+   'HTMLFormFieldLayout' => __DIR__ . 
'/includes/htmlform/HTMLFormFieldLayout.php',
'HTMLFormFieldRequiredOptionsException' => __DIR__ . 
'/includes/htmlform/HTMLFormFieldRequiredOptionsException.php',
'HTMLFormFieldWithButton' => __DIR__ . 
'/includes/htmlform/fields/HTMLFormFieldWithButton.php',
'HTMLHiddenField' => __DIR__ . 
'/includes/htmlform/fields/HTMLHiddenField.php',
diff --git a/includes/htmlform/HTMLFormActionFieldLayout.php 
b/includes/htmlform/HTMLFormActionFieldLayout.php
new file mode 100644
index 000..2c08224
--- /dev/null
+++ b/includes/htmlform/HTMLFormActionFieldLayout.php
@@ -0,0 +1,16 @@
+initializeHTMLFormElement( $config );
+   }
+
+   protected function getJavaScriptClassName() {
+   return 'mw.htmlform.ActionFieldLayout';
+   }
+}
diff --git a/includes/htmlform/HTMLFormElement.php 
b/includes/htmlform/HTMLFormElement.php
index 66d6143..5f32fdb 100644
--- a/includes/htmlform/HTMLFormElement.php
+++ b/includes/htmlform/HTMLFormElement.php
@@ -33,33 +33,3 @@
} );
}
 }
-
-class HTMLFormFieldLayout extends OOUI\FieldLayout {
-   use HTMLFormElement;
-
-   public function __construct( $fieldWidget, array $config = [] ) {
-   parent::__construct( $fieldWidget, $config );
-
-   // Traits
-   $this->initializeHTMLFormElement( $config );
-   }
-
-   protected function getJavaScriptClassName() {
-   return 'mw.htmlform.FieldLayout';
-   }
-}
-
-class HTMLFormActionFieldLayout extends OOUI\ActionFieldLayout {
-   use HTMLFormElement;
-
-   public function __construct( $fieldWidget, $buttonWidget = false, array 
$config = [] ) {
-   parent::__construct( $fieldWidget, $buttonWidget, $config );
-
-   // Traits
-   $this->initializeHTMLFormElement( $config );
-   }
-
-   protected function getJavaScriptClassName() {
-   return 'mw.htmlform.ActionFieldLayout';
-   }
-}
diff --git a/includes/htmlform/HTMLFormFieldLayout.php 
b/includes/htmlform/HTMLFormFieldLayout.php
new file mode 100644
index 000..ce93db2
--- /dev/null
+++ b/includes/htmlform/HTMLFormFieldLayout.php
@@ -0,0 +1,16 @@
+initializeHTMLFormElement( $config );
+   }
+
+   protected function getJavaScriptClassName() {
+   return 'mw.htmlform.FieldLayout';
+   }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c39293b4d96fba821a9c9a1ece9d9907303c6cf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix multiple PHP class declarations in one file in includes/...

2018-01-20 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405554 )

Change subject: Fix multiple PHP class declarations in one file in includes/diff
..

Fix multiple PHP class declarations in one file in includes/diff

All files containing more than one PHP class were splitted into
multiple files. Autoloader references were updated to match new
class locations.

Bug: T177809
Change-Id: I7ed010d09c7a58f4ac7c48a424cdacede9d46352
---
M autoload.php
D includes/diff/DairikiDiff.php
A includes/diff/Diff.php
M includes/diff/DiffEngine.php
A includes/diff/DiffOp.php
A includes/diff/DiffOpAdd.php
A includes/diff/DiffOpChange.php
A includes/diff/DiffOpCopy.php
A includes/diff/DiffOpDelete.php
A includes/diff/HWLDFWordAccumulator.php
A includes/diff/RangeDifference.php
11 files changed, 559 insertions(+), 379 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/54/405554/1

diff --git a/autoload.php b/autoload.php
index 9e557e1..e20dcea 100644
--- a/autoload.php
+++ b/autoload.php
@@ -379,15 +379,15 @@
'DerivativeRequest' => __DIR__ . '/includes/DerivativeRequest.php',
'DerivativeResourceLoaderContext' => __DIR__ . 
'/includes/resourceloader/DerivativeResourceLoaderContext.php',
'DescribeFileOp' => __DIR__ . 
'/includes/libs/filebackend/fileop/DescribeFileOp.php',
-   'Diff' => __DIR__ . '/includes/diff/DairikiDiff.php',
+   'Diff' => __DIR__ . '/includes/diff/Diff.php',
'DiffEngine' => __DIR__ . '/includes/diff/DiffEngine.php',
'DiffFormatter' => __DIR__ . '/includes/diff/DiffFormatter.php',
'DiffHistoryBlob' => __DIR__ . '/includes/HistoryBlob.php',
-   'DiffOp' => __DIR__ . '/includes/diff/DairikiDiff.php',
-   'DiffOpAdd' => __DIR__ . '/includes/diff/DairikiDiff.php',
-   'DiffOpChange' => __DIR__ . '/includes/diff/DairikiDiff.php',
-   'DiffOpCopy' => __DIR__ . '/includes/diff/DairikiDiff.php',
-   'DiffOpDelete' => __DIR__ . '/includes/diff/DairikiDiff.php',
+   'DiffOp' => __DIR__ . '/includes/diff/DiffOp.php',
+   'DiffOpAdd' => __DIR__ . '/includes/diff/DiffOpAdd.php',
+   'DiffOpChange' => __DIR__ . '/includes/diff/DiffOpChange.php',
+   'DiffOpCopy' => __DIR__ . '/includes/diff/DiffOpCopy.php',
+   'DiffOpDelete' => __DIR__ . '/includes/diff/DiffOpDelete.php',
'DifferenceEngine' => __DIR__ . '/includes/diff/DifferenceEngine.php',
'Digit2Html' => __DIR__ . '/maintenance/language/digit2html.php',
'DjVuHandler' => __DIR__ . '/includes/media/DjVu.php',
@@ -592,7 +592,7 @@
'HTMLUserTextField' => __DIR__ . 
'/includes/htmlform/fields/HTMLUserTextField.php',
'HTMLUsersMultiselectField' => __DIR__ . 
'/includes/htmlform/fields/HTMLUsersMultiselectField.php',
'HTTPFileStreamer' => __DIR__ . 
'/includes/libs/filebackend/HTTPFileStreamer.php',
-   'HWLDFWordAccumulator' => __DIR__ . '/includes/diff/DairikiDiff.php',
+   'HWLDFWordAccumulator' => __DIR__ . 
'/includes/diff/HWLDFWordAccumulator.php',
'HashBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/HashBagOStuff.php',
'HashConfig' => __DIR__ . '/includes/config/HashConfig.php',
'HashRing' => __DIR__ . '/includes/libs/HashRing.php',
@@ -1209,7 +1209,7 @@
'RSSFeed' => __DIR__ . '/includes/Feed.php',
'RandomPage' => __DIR__ . '/includes/specials/SpecialRandompage.php',
'RangeChronologicalPager' => __DIR__ . 
'/includes/pager/RangeChronologicalPager.php',
-   'RangeDifference' => __DIR__ . '/includes/diff/DiffEngine.php',
+   'RangeDifference' => __DIR__ . '/includes/diff/RangeDifference.php',
'RawAction' => __DIR__ . '/includes/actions/RawAction.php',
'RawMessage' => __DIR__ . '/includes/RawMessage.php',
'ReadOnlyError' => __DIR__ . '/includes/exception/ReadOnlyError.php',
diff --git a/includes/diff/DairikiDiff.php b/includes/diff/DairikiDiff.php
deleted file mode 100644
index d76af31..000
--- a/includes/diff/DairikiDiff.php
+++ /dev/null
@@ -1,334 +0,0 @@
-
- * You may copy this code freely under the conditions of the GPL.
- *
- * 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
- * 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix multiple PHP class declarations in one file in includes/...

2018-01-20 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405552 )

Change subject: Fix multiple PHP class declarations in one file in includes/auth
..

Fix multiple PHP class declarations in one file in includes/auth

All files containing more than one PHP class were splitted into
multiple files. Autoloader references were updated to match new
class locations.

Bug: T177809
Change-Id: I4420bd7b18156d75a42b1a26e222592acf6b50dc
---
M autoload.php
M includes/auth/AuthManagerAuthPlugin.php
A includes/auth/AuthManagerAuthPluginUser.php
3 files changed, 50 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/52/405552/1

diff --git a/autoload.php b/autoload.php
index 9e557e1..b6b655a 100644
--- a/autoload.php
+++ b/autoload.php
@@ -844,7 +844,7 @@
'MediaWiki\\Auth\\AbstractSecondaryAuthenticationProvider' => __DIR__ . 
'/includes/auth/AbstractSecondaryAuthenticationProvider.php',
'MediaWiki\\Auth\\AuthManager' => __DIR__ . 
'/includes/auth/AuthManager.php',
'MediaWiki\\Auth\\AuthManagerAuthPlugin' => __DIR__ . 
'/includes/auth/AuthManagerAuthPlugin.php',
-   'MediaWiki\\Auth\\AuthManagerAuthPluginUser' => __DIR__ . 
'/includes/auth/AuthManagerAuthPlugin.php',
+   'MediaWiki\\Auth\\AuthManagerAuthPluginUser' => __DIR__ . 
'/includes/auth/AuthManagerAuthPluginUser.php',
'MediaWiki\\Auth\\AuthPluginPrimaryAuthenticationProvider' => __DIR__ . 
'/includes/auth/AuthPluginPrimaryAuthenticationProvider.php',
'MediaWiki\\Auth\\AuthenticationProvider' => __DIR__ . 
'/includes/auth/AuthenticationProvider.php',
'MediaWiki\\Auth\\AuthenticationRequest' => __DIR__ . 
'/includes/auth/AuthenticationRequest.php',
diff --git a/includes/auth/AuthManagerAuthPlugin.php 
b/includes/auth/AuthManagerAuthPlugin.php
index 9a1e445..2b0ce44 100644
--- a/includes/auth/AuthManagerAuthPlugin.php
+++ b/includes/auth/AuthManagerAuthPlugin.php
@@ -198,33 +198,3 @@
return [];
}
 }
-
-/**
- * @since 1.27
- * @deprecated since 1.27
- */
-class AuthManagerAuthPluginUser extends \AuthPluginUser {
-   /** @var User */
-   private $user;
-
-   function __construct( $user ) {
-   $this->user = $user;
-   }
-
-   public function getId() {
-   return $this->user->getId();
-   }
-
-   public function isLocked() {
-   return $this->user->isLocked();
-   }
-
-   public function isHidden() {
-   return $this->user->isHidden();
-   }
-
-   public function resetAuthToken() {
-   
\MediaWiki\Session\SessionManager::singleton()->invalidateSessionsForUser( 
$this->user );
-   return true;
-   }
-}
diff --git a/includes/auth/AuthManagerAuthPluginUser.php 
b/includes/auth/AuthManagerAuthPluginUser.php
new file mode 100644
index 000..98a0494
--- /dev/null
+++ b/includes/auth/AuthManagerAuthPluginUser.php
@@ -0,0 +1,49 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+/**
+ * @since 1.27
+ * @deprecated since 1.27
+ */
+class AuthManagerAuthPluginUser extends \AuthPluginUser {
+   /** @var User */
+   private $user;
+
+   function __construct( $user ) {
+   $this->user = $user;
+   }
+
+   public function getId() {
+   return $this->user->getId();
+   }
+
+   public function isLocked() {
+   return $this->user->isLocked();
+   }
+
+   public function isHidden() {
+   return $this->user->isHidden();
+   }
+
+   public function resetAuthToken() {
+   
\MediaWiki\Session\SessionManager::singleton()->invalidateSessionsForUser( 
$this->user );
+   return true;
+   }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4420bd7b18156d75a42b1a26e222592acf6b50dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix multiple PHP class declarations in one file in includes/...

2018-01-20 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405551 )

Change subject: Fix multiple PHP class declarations in one file in 
includes/specialse
..

Fix multiple PHP class declarations in one file in includes/specialse

All files containing more than one PHP class were splitted into
multiple files. Autoloader references were updated to match new
class locations.

Bug: T177809
Change-Id: I8ef71fc02404e9006c6d0c68d21b002a347d6f37
---
M autoload.php
A includes/specials/SpecialAllMyUploads.php
A includes/specials/SpecialListAdmins.php
A includes/specials/SpecialListBots.php
M includes/specials/SpecialListusers.php
M includes/specials/SpecialMyRedirectPages.php
A includes/specials/SpecialMycontributions.php
A includes/specials/SpecialMytalk.php
A includes/specials/SpecialMyuploads.php
M includes/specials/SpecialUploadStash.php
A includes/specials/SpecialUploadStashTooLargeException.php
11 files changed, 337 insertions(+), 164 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/405551/1

diff --git a/autoload.php b/autoload.php
index 9e557e1..b493cb0 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1373,7 +1373,7 @@
'SlideshowImageGallery' => __DIR__ . 
'/includes/gallery/SlideshowImageGallery.php',
'SpecialActiveUsers' => __DIR__ . 
'/includes/specials/SpecialActiveusers.php',
'SpecialAllMessages' => __DIR__ . 
'/includes/specials/SpecialAllMessages.php',
-   'SpecialAllMyUploads' => __DIR__ . 
'/includes/specials/SpecialMyRedirectPages.php',
+   'SpecialAllMyUploads' => __DIR__ . 
'/includes/specials/SpecialAllMyUploads.php',
'SpecialAllPages' => __DIR__ . '/includes/specials/SpecialAllPages.php',
'SpecialApiHelp' => __DIR__ . '/includes/specials/SpecialApiHelp.php',
'SpecialApiSandbox' => __DIR__ . 
'/includes/specials/SpecialApiSandbox.php',
@@ -1403,20 +1403,20 @@
'SpecialImport' => __DIR__ . '/includes/specials/SpecialImport.php',
'SpecialJavaScriptTest' => __DIR__ . 
'/includes/specials/SpecialJavaScriptTest.php',
'SpecialLinkAccounts' => __DIR__ . 
'/includes/specials/SpecialLinkAccounts.php',
-   'SpecialListAdmins' => __DIR__ . 
'/includes/specials/SpecialListusers.php',
-   'SpecialListBots' => __DIR__ . 
'/includes/specials/SpecialListusers.php',
+   'SpecialListAdmins' => __DIR__ . 
'/includes/specials/SpecialListAdmins.php',
+   'SpecialListBots' => __DIR__ . '/includes/specials/SpecialListBots.php',
'SpecialListFiles' => __DIR__ . 
'/includes/specials/SpecialListfiles.php',
'SpecialListGrants' => __DIR__ . 
'/includes/specials/SpecialListgrants.php',
'SpecialListGroupRights' => __DIR__ . 
'/includes/specials/SpecialListgrouprights.php',
-   'SpecialListUsers' => __DIR__ . 
'/includes/specials/SpecialListusers.php',
+   'SpecialListUsers' => __DIR__ . 
'/includes/specials/SpecialListUsers.php',
'SpecialLockdb' => __DIR__ . '/includes/specials/SpecialLockdb.php',
'SpecialLog' => __DIR__ . '/includes/specials/SpecialLog.php',
'SpecialMergeHistory' => __DIR__ . 
'/includes/specials/SpecialMergeHistory.php',
'SpecialMyLanguage' => __DIR__ . 
'/includes/specials/SpecialMyLanguage.php',
-   'SpecialMycontributions' => __DIR__ . 
'/includes/specials/SpecialMyRedirectPages.php',
+   'SpecialMycontributions' => __DIR__ . 
'/includes/specials/SpecialMycontributions.php',
'SpecialMypage' => __DIR__ . 
'/includes/specials/SpecialMyRedirectPages.php',
-   'SpecialMytalk' => __DIR__ . 
'/includes/specials/SpecialMyRedirectPages.php',
-   'SpecialMyuploads' => __DIR__ . 
'/includes/specials/SpecialMyRedirectPages.php',
+   'SpecialMytalk' => __DIR__ . '/includes/specials/SpecialMytalk.php',
+   'SpecialMyuploads' => __DIR__ . 
'/includes/specials/SpecialMyuploads.php',
'SpecialNewFiles' => __DIR__ . 
'/includes/specials/SpecialNewimages.php',
'SpecialNewpages' => __DIR__ . '/includes/specials/SpecialNewpages.php',
'SpecialPage' => __DIR__ . '/includes/specialpage/SpecialPage.php',
@@ -1453,7 +1453,7 @@
'SpecialUnlockdb' => __DIR__ . '/includes/specials/SpecialUnlockdb.php',
'SpecialUpload' => __DIR__ . '/includes/specials/SpecialUpload.php',
'SpecialUploadStash' => __DIR__ . 
'/includes/specials/SpecialUploadStash.php',
-   'SpecialUploadStashTooLargeException' => __DIR__ . 
'/includes/specials/SpecialUploadStash.php',
+   'SpecialUploadStashTooLargeException' => __DIR__ . 
'/includes/specials/SpecialUploadStashTooLargeException.php',
'SpecialUserLogin' => __DIR__ . 
'/includes/specials/SpecialUserLogin.php',
'SpecialUserLogout' => __DIR__ . 
'/includes/specials/SpecialUserLogout.php',
'SpecialVersion' => __DIR__ . '/includes/specials/SpecialVersion.php',
diff --git 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix multiple PHP class declarations in one file in includes/...

2018-01-20 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405548 )

Change subject: Fix multiple PHP class declarations in one file in 
includes/utils
..

Fix multiple PHP class declarations in one file in includes/utils

All files containing more than one PHP class were splitted into
multiple files. Autoloader references were updated to match new
class locations.

Bug: T177809
Change-Id: Ie76e113eb4605510cfc2f89e304c611b7d739a09
---
M autoload.php
M includes/utils/AutoloadGenerator.php
A includes/utils/ClassCollector.php
3 files changed, 182 insertions(+), 181 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/48/405548/1

diff --git a/autoload.php b/autoload.php
index 9e557e1..35f717c 100644
--- a/autoload.php
+++ b/autoload.php
@@ -256,7 +256,7 @@
'CheckLess' => __DIR__ . '/maintenance/checkLess.php',
'CheckStorage' => __DIR__ . '/maintenance/storage/checkStorage.php',
'CheckUsernames' => __DIR__ . '/maintenance/checkUsernames.php',
-   'ClassCollector' => __DIR__ . '/includes/utils/AutoloadGenerator.php',
+   'ClassCollector' => __DIR__ . '/includes/utils/ClassCollector.php',
'CleanupAncientTables' => __DIR__ . 
'/maintenance/cleanupAncientTables.php',
'CleanupBlocks' => __DIR__ . '/maintenance/cleanupBlocks.php',
'CleanupEmptyCategories' => __DIR__ . 
'/maintenance/cleanupEmptyCategories.php',
diff --git a/includes/utils/AutoloadGenerator.php 
b/includes/utils/AutoloadGenerator.php
index a6783b0..0cda7c5 100644
--- a/includes/utils/AutoloadGenerator.php
+++ b/includes/utils/AutoloadGenerator.php
@@ -326,183 +326,3 @@
}
}
 }
-
-/**
- * Reads PHP code and returns the FQCN of every class defined within it.
- */
-class ClassCollector {
-
-   /**
-* @var string Current namespace
-*/
-   protected $namespace = '';
-
-   /**
-* @var array List of FQCN detected in this pass
-*/
-   protected $classes;
-
-   /**
-* @var array Token from token_get_all() that started an expect sequence
-*/
-   protected $startToken;
-
-   /**
-* @var array List of tokens that are members of the current expect 
sequence
-*/
-   protected $tokens;
-
-   /**
-* @var array Class alias with target/name fields
-*/
-   protected $alias;
-
-   /**
-* @param string $code PHP code (including namespace = '';
-   $this->classes = [];
-   $this->startToken = null;
-   $this->alias = null;
-   $this->tokens = [];
-
-   foreach ( token_get_all( $code ) as $token ) {
-   if ( $this->startToken === null ) {
-   $this->tryBeginExpect( $token );
-   } else {
-   $this->tryEndExpect( $token );
-   }
-   }
-
-   return $this->classes;
-   }
-
-   /**
-* Determine if $token begins the next expect sequence.
-*
-* @param array $token
-*/
-   protected function tryBeginExpect( $token ) {
-   if ( is_string( $token ) ) {
-   return;
-   }
-   // Note: When changing class name discovery logic,
-   // AutoLoaderTest.php may also need to be updated.
-   switch ( $token[0] ) {
-   case T_NAMESPACE:
-   case T_CLASS:
-   case T_INTERFACE:
-   case T_TRAIT:
-   case T_DOUBLE_COLON:
-   $this->startToken = $token;
-   break;
-   case T_STRING:
-   if ( $token[1] === 'class_alias' ) {
-   $this->startToken = $token;
-   $this->alias = [];
-   }
-   }
-   }
-
-   /**
-* Accepts the next token in an expect sequence
-*
-* @param array $token
-*/
-   protected function tryEndExpect( $token ) {
-   switch ( $this->startToken[0] ) {
-   case T_DOUBLE_COLON:
-   // Skip over T_CLASS after T_DOUBLE_COLON 
because this is something like
-   // "self::static" which accesses the class 
name. It doens't define a new class.
-   $this->startToken = null;
-   break;
-   case T_NAMESPACE:
-   if ( $token === ';' || $token === '{' ) {
-   $this->namespace = 
$this->implodeTokens() . '\\';
-   } else {
-

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix multiple PHP class declarations in one file in includes/...

2018-01-20 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405547 )

Change subject: Fix multiple PHP class declarations in one file in 
includes/logging
..

Fix multiple PHP class declarations in one file in includes/logging

All files containing more than one PHP class were splitted into
multiple files. Autoloader references were updated to match new
class locations.

Bug: T177809
Change-Id: Ia53c82d7888469b8e587db5cbf0049ec262abaa8
---
M autoload.php
A includes/logging/DatabaseLogEntry.php
A includes/logging/LegacyLogFormatter.php
M includes/logging/LogEntry.php
A includes/logging/LogEntryBase.php
M includes/logging/LogFormatter.php
A includes/logging/ManualLogEntry.php
A includes/logging/RCDatabaseLogEntry.php
8 files changed, 955 insertions(+), 811 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/405547/1

diff --git a/autoload.php b/autoload.php
index 9e557e1..0e51c9e 100644
--- a/autoload.php
+++ b/autoload.php
@@ -343,7 +343,7 @@
'DatabaseBase' => __DIR__ . 
'/includes/libs/rdbms/database/Database.php',
'DatabaseInstaller' => __DIR__ . 
'/includes/installer/DatabaseInstaller.php',
'DatabaseLag' => __DIR__ . '/maintenance/lag.php',
-   'DatabaseLogEntry' => __DIR__ . '/includes/logging/LogEntry.php',
+   'DatabaseLogEntry' => __DIR__ . 
'/includes/logging/DatabaseLogEntry.php',
'DatabaseMssql' => __DIR__ . 
'/includes/libs/rdbms/database/DatabaseMssql.php',
'DatabaseMysqlBase' => __DIR__ . 
'/includes/libs/rdbms/database/DatabaseMysqlBase.php',
'DatabaseMysqli' => __DIR__ . 
'/includes/libs/rdbms/database/DatabaseMysqli.php',
@@ -743,7 +743,7 @@
'LanguageZh_hans' => __DIR__ . '/languages/classes/LanguageZh_hans.php',
'Languages' => __DIR__ . '/maintenance/language/languages.inc',
'LayeredParameterizedPassword' => __DIR__ . 
'/includes/password/LayeredParameterizedPassword.php',
-   'LegacyLogFormatter' => __DIR__ . '/includes/logging/LogFormatter.php',
+   'LegacyLogFormatter' => __DIR__ . 
'/includes/logging/LegacyLogFormatter.php',
'License' => __DIR__ . '/includes/specials/helpers/License.php',
'Licenses' => __DIR__ . '/includes/specials/formfields/Licenses.php',
'LinkBatch' => __DIR__ . '/includes/cache/LinkBatch.php',
@@ -774,7 +774,7 @@
'LockManager' => __DIR__ . '/includes/libs/lockmanager/LockManager.php',
'LockManagerGroup' => __DIR__ . 
'/includes/filebackend/lockmanager/LockManagerGroup.php',
'LogEntry' => __DIR__ . '/includes/logging/LogEntry.php',
-   'LogEntryBase' => __DIR__ . '/includes/logging/LogEntry.php',
+   'LogEntryBase' => __DIR__ . '/includes/logging/LogEntryBase.php',
'LogEventsList' => __DIR__ . '/includes/logging/LogEventsList.php',
'LogFormatter' => __DIR__ . '/includes/logging/LogFormatter.php',
'LogPage' => __DIR__ . '/includes/logging/LogPage.php',
@@ -820,7 +820,7 @@
'MakeTestEdits' => __DIR__ . '/maintenance/makeTestEdits.php',
'MalformedTitleException' => __DIR__ . 
'/includes/title/MalformedTitleException.php',
'ManageJobs' => __DIR__ . '/maintenance/manageJobs.php',
-   'ManualLogEntry' => __DIR__ . '/includes/logging/LogEntry.php',
+   'ManualLogEntry' => __DIR__ . '/includes/logging/ManualLogEntry.php',
'MapCacheLRU' => __DIR__ . '/includes/libs/MapCacheLRU.php',
'MappedIterator' => __DIR__ . '/includes/libs/MappedIterator.php',
'MarkpatrolledAction' => __DIR__ . 
'/includes/actions/MarkpatrolledAction.php',
@@ -1201,7 +1201,7 @@
'QuorumLockManager' => __DIR__ . 
'/includes/libs/lockmanager/QuorumLockManager.php',
'RCCacheEntry' => __DIR__ . '/includes/changes/RCCacheEntry.php',
'RCCacheEntryFactory' => __DIR__ . 
'/includes/changes/RCCacheEntryFactory.php',
-   'RCDatabaseLogEntry' => __DIR__ . '/includes/logging/LogEntry.php',
+   'RCDatabaseLogEntry' => __DIR__ . 
'/includes/logging/RCDatabaseLogEntry.php',
'RCFeed' => __DIR__ . '/includes/rcfeed/RCFeed.php',
'RCFeedEngine' => __DIR__ . '/includes/rcfeed/RCFeedEngine.php',
'RCFeedFormatter' => __DIR__ . '/includes/rcfeed/RCFeedFormatter.php',
diff --git a/includes/logging/DatabaseLogEntry.php 
b/includes/logging/DatabaseLogEntry.php
new file mode 100644
index 000..b783f45
--- /dev/null
+++ b/includes/logging/DatabaseLogEntry.php
@@ -0,0 +1,206 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @author Niklas Laxström
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
+ * @since 1.19
+ */
+
+/**
+ * This class wraps around database result row.
+ *
+ * @since 1.19
+ */
+class DatabaseLogEntry extends LogEntryBase {
+
+   /**
+* Returns array of information that is needed for querying
+* log entries. Array contains the following keys:

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix multiple PHP class declarations in one file in includes/...

2018-01-20 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405536 )

Change subject: Fix multiple PHP class declarations in one file in 
includes/cache
..

Fix multiple PHP class declarations in one file in includes/cache

All files containing more than one PHP class were splitted into
multiple files. Autoloader references were updated to match new
class location.

Bug: T177809
Change-Id: Id89ef7f71156139c9e920f319a75b7ffb0bdc4e3
---
M autoload.php
M includes/cache/CacheDependency.php
A includes/cache/ConstantDependency.php
A includes/cache/DependencyWrapper.php
A includes/cache/FileDependency.php
A includes/cache/GlobalDependency.php
A includes/cache/MainConfigDependency.php
7 files changed, 374 insertions(+), 259 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/36/405536/1

diff --git a/autoload.php b/autoload.php
index 9e557e1..b3556e1 100644
--- a/autoload.php
+++ b/autoload.php
@@ -294,7 +294,7 @@
'ConfigException' => __DIR__ . '/includes/config/ConfigException.php',
'ConfigFactory' => __DIR__ . '/includes/config/ConfigFactory.php',
'ConfiguredReadOnlyMode' => __DIR__ . 
'/includes/ConfiguredReadOnlyMode.php',
-   'ConstantDependency' => __DIR__ . '/includes/cache/CacheDependency.php',
+   'ConstantDependency' => __DIR__ . 
'/includes/cache/ConstantDependency.php',
'Content' => __DIR__ . '/includes/content/Content.php',
'ContentHandler' => __DIR__ . '/includes/content/ContentHandler.php',
'ContentModelLogFormatter' => __DIR__ . 
'/includes/logging/ContentModelLogFormatter.php',
@@ -372,7 +372,7 @@
'DeleteSelfExternals' => __DIR__ . 
'/maintenance/deleteSelfExternals.php',
'DeletedContribsPager' => __DIR__ . 
'/includes/specials/pagers/DeletedContribsPager.php',
'DeletedContributionsPage' => __DIR__ . 
'/includes/specials/SpecialDeletedContributions.php',
-   'DependencyWrapper' => __DIR__ . '/includes/cache/CacheDependency.php',
+   'DependencyWrapper' => __DIR__ . 
'/includes/cache/DependencyWrapper.php',
'DeprecatedGlobal' => __DIR__ . '/includes/DeprecatedGlobal.php',
'DeprecatedInterfaceFinder' => __DIR__ . 
'/maintenance/findDeprecated.php',
'DerivativeContext' => __DIR__ . 
'/includes/context/DerivativeContext.php',
@@ -498,7 +498,7 @@
'FileContentHandler' => __DIR__ . 
'/includes/content/FileContentHandler.php',
'FileContentsHasher' => __DIR__ . 
'/includes/utils/FileContentsHasher.php',
'FileDeleteForm' => __DIR__ . '/includes/FileDeleteForm.php',
-   'FileDependency' => __DIR__ . '/includes/cache/CacheDependency.php',
+   'FileDependency' => __DIR__ . '/includes/cache/FileDependency.php',
'FileDuplicateSearchPage' => __DIR__ . 
'/includes/specials/SpecialFileDuplicateSearch.php',
'FileJournal' => __DIR__ . 
'/includes/libs/filebackend/filejournal/FileJournal.php',
'FileOp' => __DIR__ . '/includes/libs/filebackend/fileop/FileOp.php',
@@ -546,7 +546,7 @@
'GetSlaveServer' => __DIR__ . '/maintenance/getReplicaServer.php',
'GetTextMaint' => __DIR__ . '/maintenance/getText.php',
'GitInfo' => __DIR__ . '/includes/GitInfo.php',
-   'GlobalDependency' => __DIR__ . '/includes/cache/CacheDependency.php',
+   'GlobalDependency' => __DIR__ . '/includes/cache/GlobalDependency.php',
'GlobalVarConfig' => __DIR__ . '/includes/config/GlobalVarConfig.php',
'HHVMMakeRepo' => __DIR__ . '/maintenance/hhvm/makeRepo.php',
'HTMLApiField' => __DIR__ . 
'/includes/htmlform/fields/HTMLApiField.php',
@@ -813,7 +813,7 @@
'MagicWord' => __DIR__ . '/includes/MagicWord.php',
'MagicWordArray' => __DIR__ . '/includes/MagicWordArray.php',
'MailAddress' => __DIR__ . '/includes/mail/MailAddress.php',
-   'MainConfigDependency' => __DIR__ . 
'/includes/cache/CacheDependency.php',
+   'MainConfigDependency' => __DIR__ . 
'/includes/cache/MainConfigDependency.php',
'MaintainableDBConnRef' => __DIR__ . 
'/includes/libs/rdbms/database/MaintainableDBConnRef.php',
'Maintenance' => __DIR__ . '/maintenance/Maintenance.php',
'MaintenanceFormatInstallDoc' => __DIR__ . 
'/maintenance/formatInstallDoc.php',
diff --git a/includes/cache/CacheDependency.php 
b/includes/cache/CacheDependency.php
index 32dc8c0..479aa97 100644
--- a/includes/cache/CacheDependency.php
+++ b/includes/cache/CacheDependency.php
@@ -23,114 +23,6 @@
 use MediaWiki\MediaWikiServices;
 
 /**
- * This class stores an arbitrary value along with its dependencies.
- * Users should typically only use DependencyWrapper::getValueFromCache(),
- * rather than instantiating one of these objects directly.
- * @ingroup Cache
- */
-class DependencyWrapper {
-   private $value;
-   /** @var CacheDependency[] */
-   private $deps;
-
-   /**
-* @param mixed 

[MediaWiki-commits] [Gerrit] mediawiki...Translate[master]: Fix PageMigration not showing field for first translation unit

2018-01-20 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405534 )

Change subject: Fix PageMigration not showing field for first translation unit
..

Fix PageMigration not showing field for first translation unit

Bug: T139456
Change-Id: I9d09354327cd4c5108f145a8728e906bac0a05fb
---
M resources/js/ext.translate.special.pagemigration.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/34/405534/1

diff --git a/resources/js/ext.translate.special.pagemigration.js 
b/resources/js/ext.translate.special.pagemigration.js
index 6e5282e..9b84b68 100644
--- a/resources/js/ext.translate.special.pagemigration.js
+++ b/resources/js/ext.translate.special.pagemigration.js
@@ -142,7 +142,7 @@
var result, i, sUnit, key;
sourceUnits = [];
result = data.query.messagecollection;
-   for ( i = 1; i < result.length; i++ ) {
+   for ( i = 0; i < result.length; i++ ) {
sUnit = {};
key = result[ i ].key;
sUnit.identifier = key.slice( key.lastIndexOf( 
'/' ) + 1 );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d09354327cd4c5108f145a8728e906bac0a05fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: mediawiki: Better error page layout on mobile devices

2018-01-18 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405058 )

Change subject: mediawiki: Better error page layout on mobile devices
..

mediawiki: Better error page layout on mobile devices

Display logo at full screen width and move text under it on devices
with small screens. This makes error text easier to read.

Bug: T182247
Change-Id: I9b9fb871e677491b65f854e55c0860600dceb716
---
M modules/mediawiki/templates/errorpage.html.erb
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/58/405058/1

diff --git a/modules/mediawiki/templates/errorpage.html.erb 
b/modules/mediawiki/templates/errorpage.html.erb
index ea37a35..c8af0a2 100644
--- a/modules/mediawiki/templates/errorpage.html.erb
+++ b/modules/mediawiki/templates/errorpage.html.erb
@@ -26,6 +26,12 @@
 a:hover { text-decoration: underline; }
 code { font-family: sans-serif; }
 .text-muted { color: #777; }
+@media screen and (max-device-width: 720px) and (orientation: portrait) {
+body { font: 22px/1.6 sans-serif; }
+.content { max-width: 100%; }
+a img { float: none; display: block; width: 80%; margin: auto; }
+.content-text { width: 100%; }
+}
 
 
 <% if @errorpage['logo_link'] && @errorpage['logo_link'] != :undef -%>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b9fb871e677491b65f854e55c0860600dceb716
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...SendGrid[master]: Add PHP_CodeSniffer for codestyle checks to SendGrid extension

2018-01-17 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404880 )

Change subject: Add PHP_CodeSniffer for codestyle checks to SendGrid extension
..

Add PHP_CodeSniffer for codestyle checks to SendGrid extension

Bug: T185159
Change-Id: I137a88c48739936e752c2b909a35e5b166d50bd4
---
M composer.json
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SendGrid 
refs/changes/80/404880/1

diff --git a/composer.json b/composer.json
index ca92d26..149ad7f 100644
--- a/composer.json
+++ b/composer.json
@@ -7,17 +7,19 @@
},
"require-dev": {
"phpunit/phpunit": "4.*",
-   "squizlabs/php_codesniffer": "2.*",
"jakub-onderka/php-parallel-lint": "0.9.2",
"jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/mediawiki-codesniffer": "15.0.0",
"mediawiki/minus-x": "0.2.1"
},
"scripts": {
"test": [
"parallel-lint . --exclude vendor --exclude 
node_modules",
+   "phpcs -p -s",
"minus-x check ."
],
"fix": [
+   "phpcbf",
"minus-x fix ."
]
},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I137a88c48739936e752c2b909a35e5b166d50bd4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SendGrid
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] integration/config[master]: Use extension-unittests-composer for SendGrid extension testing

2018-01-17 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404748 )

Change subject: Use extension-unittests-composer for SendGrid extension testing
..

Use extension-unittests-composer for SendGrid extension testing

`extension-unittests-composer` is now used instead of
`extension-unittests-generic` to test against the extensions own
composer dependency.

Bug: T185115
Change-Id: I150d4037fcf49b12a17d488c0c24bf8ba6c43529
---
M zuul/layout.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/48/404748/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 19a3779..8148342 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -,7 +,7 @@
 
   - name: mediawiki/extensions/SendGrid
 template:
-  - name: extension-unittests-generic
+  - name: extension-unittests-composer
   - name: mwgate-npm
 
   - name: mediawiki/extensions/SimpleSAMLphp

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I150d4037fcf49b12a17d488c0c24bf8ba6c43529
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] integration/config[master]: Add WikiAdmin dependency for BlueSpiceInterWikiLinks extension

2018-01-15 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404401 )

Change subject: Add WikiAdmin dependency for BlueSpiceInterWikiLinks extension
..

Add WikiAdmin dependency for BlueSpiceInterWikiLinks extension

Needed for minus-x tests in If650a30daeabf09d13a734cd143337625efa1e20

Bug: T175794
Change-Id: I80a8f9c46b5c0e763a8545ad4438ab5e7979748c
---
M zuul/parameter_functions.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/01/404401/1

diff --git a/zuul/parameter_functions.py b/zuul/parameter_functions.py
index 2247bf6..054f962 100644
--- a/zuul/parameter_functions.py
+++ b/zuul/parameter_functions.py
@@ -174,7 +174,7 @@
 'BlueSpiceInsertLink': ['BlueSpiceFoundation'],
 'BlueSpiceInsertMagic': ['BlueSpiceFoundation'],
 'BlueSpiceInsertTemplate': ['BlueSpiceFoundation'],
-'BlueSpiceInterWikiLinks': ['BlueSpiceFoundation'],
+'BlueSpiceInterWikiLinks': ['BlueSpiceFoundation', 'WikiAdmin'],
 'BlueSpiceMenues': ['BlueSpiceFoundation'],
 'BlueSpiceMultiUpload': ['BlueSpiceFoundation'],
 'BlueSpiceNamespaceCSS': ['BlueSpiceFoundation'],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80a8f9c46b5c0e763a8545ad4438ab5e7979748c
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...SendGrid[master]: Add PHPUnit tests

2018-01-15 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404400 )

Change subject: Add PHPUnit tests
..

Add PHPUnit tests

This adds tests for SendGridHooks.
Please note that SendGridHooks code was changed to make
sendgrid object mockable.
Additionally, UnitTestsList hook was added.

Bug: T183572
Change-Id: Iabbcb66467b180bab7250d27b869037d5bc57f5f
---
M SendGridHooks.php
M extension.json
A tests/phpunit/SendGridHooksTest.php
3 files changed, 133 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SendGrid 
refs/changes/00/404400/1

diff --git a/SendGridHooks.php b/SendGridHooks.php
index 1b3947a..d2a1f09 100644
--- a/SendGridHooks.php
+++ b/SendGridHooks.php
@@ -43,17 +43,22 @@
array $to,
MailAddress $from,
$subject,
-   $body
+   $body,
+   $sendgrid=null
) {
-   $conf = RequestContext::getMain()->getConfig();
+   if ( $sendgrid == null ) {
+   $conf = RequestContext::getMain()->getConfig();
 
-   // Value gotten from "wgSendGridAPIKey" variable from 
LocalSettings.php
-   $sendgridAPIKey = $conf->get( 'SendGridAPIKey' );
+   // Value gotten from "wgSendGridAPIKey" variable from 
LocalSettings.php
+   $sendgridAPIKey = $conf->get( 'SendGridAPIKey' );
 
-   if ( $sendgridAPIKey == "" ) {
-   throw new MWException(
-   'Please update your LocalSettings.php with the 
correct SendGrid API key.'
-   );
+   if ( $sendgridAPIKey == "" ) {
+   throw new MWException(
+   'Please update your LocalSettings.php 
with the correct SendGrid API key.'
+   );
+   }
+
+   $sendgrid = new \SendGrid( $sendgridAPIKey );
}
 
// Get $to and $from email addresses from the array and 
MailAddress object respectively
@@ -61,7 +66,6 @@
$to = new SendGrid\Email( null, $to[0]->address );
$body = new SendGrid\Content( "text/plain", $body );
$mail = new SendGrid\Mail( $from, $subject, $to, $body );
-   $sendgrid = new \SendGrid( $sendgridAPIKey );
 
try {
$sendgrid->client->mail()->send()->post( $mail );
@@ -72,4 +76,30 @@
return false;
}
 
+   /**
+* Handler for UnitTestsList hook.
+* @see http://www.mediawiki.org/wiki/Manual:Hooks/UnitTestsList
+* @param array &$files Array of unit test files
+* @return bool true in all cases
+*/
+   public static function onUnitTestsList( &$files ) {
+   // @codeCoverageIgnoreStart
+   $directoryIterator = new RecursiveDirectoryIterator( __DIR__ . 
'/tests/' );
+
+   /**
+* @var SplFileInfo $fileInfo
+*/
+   $ourFiles = [];
+   foreach ( new RecursiveIteratorIterator( $directoryIterator ) 
as $fileInfo ) {
+   if ( substr( $fileInfo->getFilename(), -8 ) === 
'Test.php' ) {
+   $ourFiles[] = $fileInfo->getPathname();
+   }
+   }
+
+   $files = array_merge( $files, $ourFiles );
+
+   return true;
+   // @codeCoverageIgnoreEnd
+   }
+
 }
diff --git a/extension.json b/extension.json
index 1cde31d..4d3f7ac 100644
--- a/extension.json
+++ b/extension.json
@@ -18,7 +18,8 @@
"Hooks": {
"AlternateUserMailer": [
"SendGridHooks::onAlternateUserMailer"
-   ]
+   ],
+   "UnitTestsList": "SendGridHooks::onUnitTestsList"
},
"load_composer_autoloader": true,
"config": {
diff --git a/tests/phpunit/SendGridHooksTest.php 
b/tests/phpunit/SendGridHooksTest.php
new file mode 100644
index 000..be2f0b5
--- /dev/null
+++ b/tests/phpunit/SendGridHooksTest.php
@@ -0,0 +1,92 @@
+setExpectedException(
+MWException::class,
+'Please update your LocalSettings.php with the correct SendGrid 
API key.'
+);
+
+RequestContext::getMain()->setConfig( new MultiConfig( [
+new HashConfig( [
+'SendGridAPIKey' => '',
+] ),
+] ) );
+
+SendGridHooks::onAlternateUserMailer(
+[ 'SomeHeader' => 'SomeValue' ],
+[ new MailAddress( 'recei...@example.com' ) ],
+new MailAddress( 'sen...@example.com' ),
+'Some subject',
+'Email body'
+);
+}
+
+/**
+ * Test sending mail in onAlternateUserMailer hook.

[MediaWiki-commits] [Gerrit] integration/config[master]: Add BlueSpiceFoundation for BlueSpice extensions

2018-01-09 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403325 )

Change subject: Add BlueSpiceFoundation for BlueSpice extensions
..

Add BlueSpiceFoundation for BlueSpice extensions

Needed for minus-x tests added in T175794

Bug: T175794
Change-Id: I86a45d74f7ec346d4ab83a3ebbeab33bf909ced4
---
M zuul/parameter_functions.py
1 file changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/25/403325/1

diff --git a/zuul/parameter_functions.py b/zuul/parameter_functions.py
index bca730f..409ffb1 100644
--- a/zuul/parameter_functions.py
+++ b/zuul/parameter_functions.py
@@ -150,18 +150,39 @@
 'Arrays': ['Loops', 'ParserFunctions', 'Variables'],
 'ArticlePlaceholder': ['Wikibase', 'Scribunto'],
 'BlogPage': ['Comments', 'SocialProfile', 'VoteNY'],
+'BlueSpiceArticleInfo': ['BlueSpiceFoundation'],
+'BlueSpiceAuthors': ['BlueSpiceFoundation'],
+'BlueSpiceAvatars': ['BlueSpiceFoundation'],
+'BlueSpiceBlog': ['BlueSpiceFoundation'],
 'BlueSpiceCategoryManager': ['BlueSpiceFoundation'],
+'BlueSpiceChecklist': ['BlueSpiceFoundation'],
+'BlueSpiceConfigManager': ['BlueSpiceFoundation'],
+'BlueSpiceContextMenu': ['BlueSpiceFoundation'],
+'BlueSpiceCountThings': ['BlueSpiceFoundation'],
+'BlueSpiceDashboards': ['BlueSpiceFoundation'],
 'BlueSpiceEditNotifyConnector': ['BlueSpiceFoundation'],
+'BlueSpiceEmoticons': ['BlueSpiceFoundation'],
 'BlueSpiceExtendedFilelist': ['BlueSpiceFoundation'],
 'BlueSpiceExtendedSearch': ['BlueSpiceFoundation'],
+'BlueSpiceExtendedStatistics': ['BlueSpiceFoundation'],
 'BlueSpiceExtensions': ['BlueSpiceFoundation'],
+'BlueSpiceGroupManager': ['BlueSpiceFoundation'],
 'BlueSpiceInsertTemplate': ['BlueSpiceFoundation'],
+'BlueSpiceInterWikiLinks': ['BlueSpiceFoundation'],
+'BlueSpiceNamespaceManager': ['BlueSpiceFoundation'],
 'BlueSpiceMultiUpload': ['BlueSpiceFoundation'],
 'BlueSpicePageAssignments': ['BlueSpiceFoundation'],
+'BlueSpicePagesVisited': ['BlueSpiceFoundation'],
+'BlueSpicePageTemplates': ['BlueSpiceFoundation'],
+'BlueSpicePermissionManager': ['BlueSpiceFoundation'],
 'BlueSpicePageVersion': ['BlueSpiceFoundation'],
+'BlueSpiceReaders': ['BlueSpiceFoundation'],
 'BlueSpiceSignHere': ['BlueSpiceFoundation'],
+'BlueSpiceSmartlist': ['BlueSpiceFoundation'],
 'BlueSpiceSMWConnector': ['BlueSpiceFoundation'],
 'BlueSpiceSubPageTree': ['BlueSpiceFoundation'],
+'BlueSpiceUserManager': ['BlueSpiceFoundation'],
+'BlueSpiceUserPreferences': ['BlueSpiceFoundation'],
 'Capiunto': ['Scribunto'],
 'Challenge': ['SocialProfile'],
 'Cite': ['VisualEditor'],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86a45d74f7ec346d4ab83a3ebbeab33bf909ced4
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Translate[master]: Fix PageMigration save button bug

2018-01-09 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403322 )

Change subject: Fix PageMigration save button bug
..

Fix PageMigration save button bug

This fixes bug of ajaxdispatcher working incorrectly
with request promise.

Bug: T179182
Change-Id: I7c1ad68a8aca48ceec04de9ce5f97f20922a4378
---
M Resources.php
M resources/js/ext.translate.special.pagemigration.js
M resources/js/jquery.ajaxdispatcher.js
3 files changed, 13 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/22/403322/1

diff --git a/Resources.php b/Resources.php
index 36180a3..675b6b5 100644
--- a/Resources.php
+++ b/Resources.php
@@ -369,6 +369,7 @@
'pm-on-save-message-text',
'pm-savepages-button-label',
'pm-cancel-button-label',
+   'tpt-unknown-page',
],
 ] + $resourcePaths;
 
diff --git a/resources/js/ext.translate.special.pagemigration.js 
b/resources/js/ext.translate.special.pagemigration.js
index c821223..6e5282e 100644
--- a/resources/js/ext.translate.special.pagemigration.js
+++ b/resources/js/ext.translate.special.pagemigration.js
@@ -362,6 +362,9 @@
$( '#action-import' ).removeClass( 'hide' );
$( 'input' ).prop( 'disabled', false );
$( '.mw-tpm-sp-instructions' ).text( mw.msg( 
'pm-on-save-message-text' ) ).show( 'fast' );
+   } ).fail( function ( errmsg ) {
+   $( 'input' ).prop( 'disabled', false );
+   $( '.mw-tpm-sp-error__message' ).text( mw.msg( 
errmsg ) ).show( 'fast' );
} );
}
}
diff --git a/resources/js/jquery.ajaxdispatcher.js 
b/resources/js/jquery.ajaxdispatcher.js
index d237a76..9f45697 100644
--- a/resources/js/jquery.ajaxdispatcher.js
+++ b/resources/js/jquery.ajaxdispatcher.js
@@ -18,6 +18,8 @@
return $.when( helper( list, maxRetries ) )
.then( function ( promises ) {
return deferred.resolve( promises );
+   } ).fail( function ( errmsg ) {
+   return deferred.reject( errmsg );
} );
}
 
@@ -34,8 +36,10 @@
rest = list.slice( 1 );
 
retries = 0;
-   retrier = function () {
-   var promise = this;
+   retrier = function ( result, promise ) {
+   if ( !promise.state ) {
+   return;
+   }
 
if ( promise.state() === 'rejected' ) {
if ( retries < maxRetries ) {
@@ -51,7 +55,9 @@
}
};
 
-   first.call().always( retrier );
+   first.call().always( retrier ).catch( function ( errmsg ) {
+   return deferred.reject( errmsg );
+   } );
 
return deferred;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c1ad68a8aca48ceec04de9ce5f97f20922a4378
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Score[master]: Use Language class to get languages names instead of hardcoding

2018-01-06 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402614 )

Change subject: Use Language class to get languages names instead of hardcoding
..

Use Language class to get languages names instead of hardcoding

Change-Id: Id2ece34c73b50b1600e5b2132749e5b1cfe677bc
---
M includes/Score.php
M includes/ScoreHooks.php
2 files changed, 17 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Score 
refs/changes/14/402614/1

diff --git a/includes/Score.php b/includes/Score.php
index 9010605..d6f1bc7 100644
--- a/includes/Score.php
+++ b/includes/Score.php
@@ -46,21 +46,21 @@
 
/**
 * Supported note languages.
-* Key is LilyPond filename. Value is native word
+* Key is LilyPond filename. Value is language code
 */
public static $supportedNoteLanguages = [
-   'arabic' => 'العربية',
-   'catalan' => 'Català',
-   'deutsch' => 'Deutsch',
-   'english' => 'English',
-   'espanol' => 'Español',
-   'italiano' => 'Italiano',
-   'nederlands' => 'Nederlands',
-   'norsk' => 'Norsk',
-   'portugues' => 'Português',
-   'suomi' => 'Suomi',
-   'svenska' => 'Svenska',
-   'vlaams' => 'Flemish',
+   'arabic' => 'ar',
+   'catalan' => 'ca',
+   'deutsch' => 'de',
+   'english' => 'en',
+   'espanol' => 'es',
+   'italiano' => 'it',
+   'nederlands' => 'nl',
+   'norsk' => 'no',
+   'portugues' => 'pt',
+   'suomi' => 'fi',
+   'svenska' => 'sv',
+   'vlaams' => 'vls',
];
 
/**
diff --git a/includes/ScoreHooks.php b/includes/ScoreHooks.php
index 34d053e..3cc32f7 100644
--- a/includes/ScoreHooks.php
+++ b/includes/ScoreHooks.php
@@ -34,7 +34,10 @@
 */
public static function onBeforePageDisplay( OutputPage &$output, Skin 
&$skin ) {
$output->addJsConfigVars( [
-   'wgScoreNoteLanguages' => 
Score::$supportedNoteLanguages,
+   'wgScoreNoteLanguages' => array_map(
+   'Language::fetchLanguageName',
+   Score::$supportedNoteLanguages
+   ),
'wgScoreDefaultNoteLanguage' => 
Score::$defaultNoteLanguage,
] );
return true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2ece34c73b50b1600e5b2132749e5b1cfe677bc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Score
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Score[master]: Add support for notes languages

2018-01-03 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401820 )

Change subject: Add support for notes languages
..

Add support for notes languages

Language can be set with note-language attribute.
Available languages now are:
arabic, catalan, deutsch, english, espanol, italiano, nederlands,
norsk, portugues, suomi, svenska, vlaams

Bug: T49604
Change-Id: Idd938089ce12134ac0f045dde7d21b1574d2cf27
---
M i18n/en.json
M i18n/qqq.json
M includes/Score.php
3 files changed, 46 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Score 
refs/changes/20/401820/1

diff --git a/i18n/en.json b/i18n/en.json
index 05d1242..2cb0f3e 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -15,6 +15,7 @@
"score-error-category-desc": "There was an error while rendering the 
score.",
"score-getcwderr": "Unable to obtain current working directory",
"score-invalidlang": "Invalid score language 
lang=\"$1\". Currently recognized languages are 
lang=\"lilypond\" (the default) and lang=\"ABC\".",
+   "score-invalidnotelanguage": "Invalid 
note-language=\"$1\". Currently recognized note languages are: 
$2",
"score-invalidaudiooverride": "The file \"$1\" you 
specified with override_audio is invalid. Please specify the file name only, 
omit [[…]] and the \"{{ns:file}}:\" prefix.",
"score-midioverridenotfound": "The file \"$1\" you 
specified with override_midi could not be found. Please specify the file name 
only, omit [[…]] and the \"{{ns:file}}:\" prefix.",
"score-noabcinput": "ABC source file $1 could not be created.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index ed816ad..cc18ba1 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -21,6 +21,7 @@
"score-error-category-desc": "Description on 
[[Special:TrackingCategories]] for the {{msg-mw|score-error-category}} tracking 
category.",
"score-getcwderr": "Displayed if the extension cannot obtain the 
current working directory.",
"score-invalidlang": "Displayed if the lang=\"…\" attribute contains an 
unrecognized score language. $1 is the unrecognized language.",
+   "score-invalidnotelanguage": "Displayed if the note-language=\"…\" 
attribute contains an unrecognized note language. $1 is the unrecognized note 
language. $2 is comma separated list of available languages.",
"score-invalidaudiooverride": "Displayed if the file specified with the 
override_audio=\"…\" attribute is invalid. $1 is the value of the 
override_audio attribute.",
"score-midioverridenotfound": "Displayed if the file specified with the 
override_midi=\"…\" attribute could not be found. $1 is the value of the 
override_midi attribute.",
"score-noabcinput": "Displayed if an ABC source file could not be 
created for lang=\"ABC\". $1 is the path to the file that could not be 
created.",
diff --git a/includes/Score.php b/includes/Score.php
index 18b2596..8479a89 100644
--- a/includes/Score.php
+++ b/includes/Score.php
@@ -45,6 +45,29 @@
private static $supportedLangs = [ 'lilypond', 'ABC' ];
 
/**
+* Supported note languages.
+*/
+   private static $supportedNoteLanguages = [
+   'arabic',
+   'catalan',
+   'deutsch',
+   'english',
+   'espanol',
+   'italiano',
+   'nederlands',
+   'norsk',
+   'portugues',
+   'suomi',
+   'svenska',
+   'vlaams'
+   ];
+
+   /**
+* Default language used for notes.
+*/
+   private static $defaultNoteLanguage = 'nederlands';
+
+   /**
 * LilyPond version string.
 * It defaults to null and is set the first time it is required.
 */
@@ -218,6 +241,21 @@
htmlspecialchars( $options['lang'] ) ) 
);
}
 
+   /* Note language selection */
+   if ( array_key_exists( 'note-language', $args ) ) {
+   $options['note-language'] = 
$args['note-language'];
+   } else {
+   $options['note-language'] = 
self::$defaultNoteLanguage;
+   }
+   if ( !in_array( $options['note-language'], 
self::$supportedNoteLanguages ) ) {
+   throw new ScoreException(
+   wfMessage( 'score-invalidnotelanguage' 
)->plaintextParams(
+   $options['note-language'],
+   join( ', ', 
self::$supportedNoteLanguages )
+   )
+   );
+   }
+
/* Override MIDI file? */
  

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add message to the assert of ApiClearHasMsgTest

2018-01-02 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401654 )

Change subject: Add message to the assert of ApiClearHasMsgTest
..

Add message to the assert of ApiClearHasMsgTest

This adds 'sanity check' message for one of asserts so it is more
clear that it is asserting a precondition.

Change-Id: I10d36c1bf69effd7bd83f4a2259144e9f6e114fc
---
M tests/phpunit/includes/api/ApiClearHasMsgTest.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/54/401654/1

diff --git a/tests/phpunit/includes/api/ApiClearHasMsgTest.php 
b/tests/phpunit/includes/api/ApiClearHasMsgTest.php
index b7d3205..5b12407 100644
--- a/tests/phpunit/includes/api/ApiClearHasMsgTest.php
+++ b/tests/phpunit/includes/api/ApiClearHasMsgTest.php
@@ -13,7 +13,7 @@
public function testClearFlag() {
$user = self::$users['sysop']->getUser();
$user->setNewtalk( true );
-   $this->assertTrue( $user->getNewtalk() );
+   $this->assertTrue( $user->getNewtalk(), 'sanity check' );
 
$data = $this->doApiRequest( [ 'action' => 'clearhasmsg' ], [] 
);
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I10d36c1bf69effd7bd83f4a2259144e9f6e114fc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Add unit test for NewsletterDb::getNewsletterSubscribersCount

2018-01-02 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401497 )

Change subject: Add unit test for NewsletterDb::getNewsletterSubscribersCount
..

Add unit test for NewsletterDb::getNewsletterSubscribersCount

Bug: T183808
Depends-on: I413ee3d9bca3b5b20982f460621071027f399415
Change-Id: I65ad46213f747a992a9f0094c2fde2a964bcb0ef
---
M tests/NewsletterDbTest.php
1 file changed, 63 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/97/401497/1

diff --git a/tests/NewsletterDbTest.php b/tests/NewsletterDbTest.php
index dcd4a27..9441640 100644
--- a/tests/NewsletterDbTest.php
+++ b/tests/NewsletterDbTest.php
@@ -111,6 +111,69 @@
}
 
/**
+* @covers NewsletterDb::getNewsletterSubscribersCount
+*/
+   public function testGetSubscribersCount() {
+   $mockWriteDb = $this->getMockIDatabase();
+   $newsletter = $this->getTestNewsletter();
+   $firstUser = User::newFromName( 'TestUser1' );
+   $secondUser = User::newFromName( 'TestUser2' );
+   $firstUser->addToDatabase();
+   $secondUser->addToDatabase();
+
+   $mockWriteDb
+   ->expects( $this->once() )
+   ->method( 'insert' )
+   ->with(
+   'nl_subscriptions',
+   [
+   [
+   'nls_subscriber_id' => 
$firstUser->getId(),
+   'nls_newsletter_id' => 
$newsletter->getId()
+   ],
+   [
+   'nls_subscriber_id' => 
$secondUser->getId(),
+   'nls_newsletter_id' => 
$newsletter->getId()
+   ]
+   ]
+   );
+   $mockWriteDb->expects( $this->once() )
+   ->method( 'affectedRows' )
+   ->will( $this->returnValue( 2 ) );
+   $mockWriteDb
+   ->expects( $this->once() )
+   ->method( 'update' )
+   ->with(
+   'nl_newsletters',
+   // For index reasons, count is negative
+   [ 'nl_subscriber_count=nl_subscriber_count-2' 
], [ 'nl_id' => $newsletter->getId() ]
+   );
+   $mockWriteDb
+   ->expects( $this->once() )
+   ->method( 'selectField' )
+   ->with(
+   'nl_newsletters',
+   'nl_subscriber_count',
+   [ 'nl_id' => $newsletter->getId() ]
+   )->will(
+   // For index reasons, count is negative
+   $this->returnValue( -2 )
+   );
+
+   $table = new NewsletterDb( $this->getMockLoadBalancer( 
$mockWriteDb ) );
+
+   // Add two subscribers before checking subscribers count
+   $result = $table->addSubscription( $this->getTestNewsletter(), [
+   $firstUser->getId(),
+   $secondUser->getId()
+   ] );
+   $this->assertTrue( $result );
+
+   $result = $table->getNewsletterSubscribersCount( 
$newsletter->getId() );
+   $this->assertEquals( 2, $result );
+}
+
+   /**
 * @covers NewsletterDb::addPublisher
 */
public function testAddPublisher() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I65ad46213f747a992a9f0094c2fde2a964bcb0ef
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Fix incorrect subscriber count updates

2018-01-02 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401495 )

Change subject: Fix incorrect subscriber count updates
..

Fix incorrect subscriber count updates

`NewsletterDb::addSubscription` and `NewsletterDb::removeSubscription`
updated subscribers count incorrectly. Subscriber count was increased
or decreased by 1 even if more than 1 subscribers were added or removed.

Bug: T183912
Change-Id: I413ee3d9bca3b5b20982f460621071027f399415
---
M includes/NewsletterDb.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/95/401495/1

diff --git a/includes/NewsletterDb.php b/includes/NewsletterDb.php
index 46d40bc..d60172b 100644
--- a/includes/NewsletterDb.php
+++ b/includes/NewsletterDb.php
@@ -42,7 +42,7 @@
$dbw->update(
'nl_newsletters',
// For index reasons, count is negative
-   [ 'nl_subscriber_count=nl_subscriber_count-1' ],
+   [ 'nl_subscriber_count=nl_subscriber_count-' . 
count( $userIds ) ],
[ 'nl_id' => $newsletter->getId() ],
__METHOD__
);
@@ -74,7 +74,7 @@
$dbw->update(
'nl_newsletters',
// For index reasons, count is negative
-   [ 'nl_subscriber_count=nl_subscriber_count+1' ],
+   [ 'nl_subscriber_count=nl_subscriber_count+' . 
count( $userIds ) ],
[ 'nl_id' => $newsletter->getId() ],
__METHOD__
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I413ee3d9bca3b5b20982f460621071027f399415
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add tests for ApiClearHasMsg

2018-01-01 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401421 )

Change subject: Add tests for ApiClearHasMsg
..

Add tests for ApiClearHasMsg

Bug: T183769
Change-Id: I60c66a7cddaf03a83afd29e536281916ef3eb6d5
---
A tests/phpunit/includes/api/ApiClearHasMsgTest.php
1 file changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/21/401421/1

diff --git a/tests/phpunit/includes/api/ApiClearHasMsgTest.php 
b/tests/phpunit/includes/api/ApiClearHasMsgTest.php
new file mode 100644
index 000..83e4431
--- /dev/null
+++ b/tests/phpunit/includes/api/ApiClearHasMsgTest.php
@@ -0,0 +1,23 @@
+getUser();
+   $user->setNewtalk( true );
+
+   $data = $this->doApiRequest( [ 'action' => 'clearhasmsg' ], [] 
);
+
+   $this->assertEquals( 'success', $data[0]['clearhasmsg'] );
+   $this->assertFalse( $user->getNewtalk() );
+   }
+
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60c66a7cddaf03a83afd29e536281916ef3eb6d5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add tests for ApiFormatRaw

2018-01-01 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401405 )

Change subject: Add tests for ApiFormatRaw
..

Add tests for ApiFormatRaw

Bug: T183767
Change-Id: I63ce42dd61f6e47f7278c436cad1e4f05e287b04
---
A tests/phpunit/includes/api/format/ApiFormatRawTest.php
1 file changed, 110 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/401405/1

diff --git a/tests/phpunit/includes/api/format/ApiFormatRawTest.php 
b/tests/phpunit/includes/api/format/ApiFormatRawTest.php
new file mode 100644
index 000..9017926
--- /dev/null
+++ b/tests/phpunit/includes/api/format/ApiFormatRawTest.php
@@ -0,0 +1,110 @@
+setRequest( new FauxRequest( $params, true ) );
+   $main = new ApiMain( $context );
+
+   $result = $main->getResult();
+   $result->addValue( null, 'mime', 'text/plain' );
+   $result->addArrayType( null, 'default' );
+   $result->addValue( null, 'text', $data[0] );
+
+   $printer = new ApiFormatRaw( $main );
+   $printer->initPrinter();
+   $printer->execute();
+   ob_start();
+   try {
+   $printer->closePrinter();
+   return ob_get_clean();
+   } catch ( Exception $ex ) {
+   ob_end_clean();
+   throw $ex;
+   }
+   }
+
+   /**
+* Check that ApiFormatRaw throws exception if mime type is not set
+* @expectedException MWException
+*/
+   public function testMissingMimeError() {
+   $context = new RequestContext;
+   $context->setRequest( new FauxRequest( [], true ) );
+   $main = new ApiMain( $context );
+
+   $result = $main->getResult();
+   $result->addArrayType( null, 'default' );
+   $result->addValue( null, 'text', 'some text' );
+
+   $printer = new ApiFormatRaw( $main );
+   $printer->initPrinter();
+   $printer->execute();
+   ob_start();
+   try {
+   $printer->closePrinter();
+   } catch ( Exception $ex ) {
+   throw $ex;
+   }
+   ob_end_clean();
+   }
+
+   /**
+* Check that ApiFormatRaw throws exception if no text is given
+* @expectedException MWException
+*/
+   public function testNoTextError() {
+   $context = new RequestContext;
+   $context->setRequest( new FauxRequest( [], true ) );
+   $main = new ApiMain( $context );
+
+   $result = $main->getResult();
+   $result->addValue( null, 'mime', 'text/plain' );
+   $result->addArrayType( null, 'default' );
+   $result->addValue( null, 'some key', 'some value' );
+
+   $printer = new ApiFormatRaw( $main );
+   $printer->initPrinter();
+   $printer->execute();
+   ob_start();
+   try {
+   $printer->closePrinter();
+   } catch ( Exception $ex ) {
+   throw $ex;
+   }
+   ob_end_clean();
+   }
+
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63ce42dd61f6e47f7278c436cad1e4f05e287b04
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add tests for ApiCheckToken

2017-12-31 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401192 )

Change subject: Add tests for ApiCheckToken
..

Add tests for ApiCheckToken

Bug: T183768
Change-Id: I63ab0413252c7333f73b881995869454c4881a57
---
A tests/phpunit/includes/api/ApiCheckTokenTest.php
1 file changed, 65 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/92/401192/1

diff --git a/tests/phpunit/includes/api/ApiCheckTokenTest.php 
b/tests/phpunit/includes/api/ApiCheckTokenTest.php
new file mode 100644
index 000..02a5abe
--- /dev/null
+++ b/tests/phpunit/includes/api/ApiCheckTokenTest.php
@@ -0,0 +1,65 @@
+doApiRequest( [
+'action' => 'query',
+'meta' => 'tokens',
+] );
+
+$data = $this->doApiRequest( [
+'action' => 'checktoken',
+'type' => 'csrf',
+'token' => $tokens[0]['query']['tokens']['csrftoken'],
+], $tokens[1]->getSessionArray() );
+
+$this->assertEquals( 'valid', $data[0]['checktoken']['result'] );
+$this->assertTrue( isset( $data[0]['checktoken']['generated'] ) );
+}
+
+/**
+ * Test result of checking invalid token
+ */
+public function testCheckTokenInvalid() {
+$session = [];
+$data = $this->doApiRequest( [
+'action' => 'checktoken',
+'type' => 'csrf',
+'token' => 'invalid_token',
+], $session );
+
+$this->assertEquals( 'invalid', $data[0]['checktoken']['result'] );
+}
+
+/**
+ * Test result of checking token with negative max age (should be expired)
+ */
+public function testCheckTokenExpired() {
+// Query token which will be checked later
+$tokens = $this->doApiRequest( [
+'action' => 'query',
+'meta' => 'tokens',
+] );
+
+$data = $this->doApiRequest( [
+'action' => 'checktoken',
+'type' => 'csrf',
+'token' => $tokens[0]['query']['tokens']['csrftoken'],
+'maxtokenage' => -1,
+], $tokens[1]->getSessionArray() );
+
+$this->assertEquals( 'expired', $data[0]['checktoken']['result'] );
+$this->assertTrue( isset( $data[0]['checktoken']['generated'] ) );
+}
+
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63ab0413252c7333f73b881995869454c4881a57
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...GlobalUsage[master]: Create Special:GloballyUnusedFiles

2017-12-30 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401092 )

Change subject: Create Special:GloballyUnusedFiles
..

Create Special:GloballyUnusedFiles

This special page shows unused files at all wikis
So in fact this special page is global equivalent to
Special:UnusedFiles

Bug: T183673
Change-Id: I47a591622ae5955757810ef1995e916a810bc506
---
M GlobalUsage.alias.php
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/GlobalUsageHooks.php
A includes/SpecialGloballyUnusedFiles.php
6 files changed, 144 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalUsage 
refs/changes/92/401092/1

diff --git a/GlobalUsage.alias.php b/GlobalUsage.alias.php
index a0ddb61..3b6e2c4 100644
--- a/GlobalUsage.alias.php
+++ b/GlobalUsage.alias.php
@@ -13,6 +13,7 @@
'GlobalUsage' => [ 'GlobalUsage' ],
'MostGloballyLinkedFiles' => [ 'MostGloballyLinkedFiles' ],
'GloballyWantedFiles' => [ 'GloballyWantedFiles' ],
+   'GloballyUnusedFiles' => [ 'GloballyUnusedFiles' ]
 ];
 
 /** Arabic (العربية) */
diff --git a/extension.json b/extension.json
index f2aba51..84acdd7 100644
--- a/extension.json
+++ b/extension.json
@@ -12,6 +12,7 @@
"SpecialPages": {
"MostGloballyLinkedFiles": "SpecialMostGloballyLinkedFiles",
"GloballyWantedFiles": "SpecialGloballyWantedFiles",
+   "GloballyUnusedFiles": "SpecialGloballyUnusedFiles",
"GlobalUsage": "SpecialGlobalUsage"
},
"JobClasses": {
@@ -37,7 +38,8 @@
"ApiQueryGlobalUsage": "includes/ApiQueryGlobalUsage.php",
"GlobalUsageCachePurgeJob": 
"includes/GlobalUsageCachePurgeJob.php",
"SpecialMostGloballyLinkedFiles": 
"includes/SpecialMostGloballyLinkedFiles.php",
-   "SpecialGloballyWantedFiles": 
"includes/SpecialGloballyWantedFiles.php"
+   "SpecialGloballyWantedFiles": 
"includes/SpecialGloballyWantedFiles.php",
+   "SpecialGloballyUnusedFiles": 
"includes/SpecialGloballyUnusedFiles.php"
},
"@doc": [
"Things that can cause link updates:",
diff --git a/i18n/en.json b/i18n/en.json
index 31733a6..86d473b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -27,5 +27,7 @@
"apihelp-query+globalusage-param-filterlocal": "Filter local usage of 
the file.",
"apihelp-query+globalusage-example-1": "Get usage of 
[[:File:Example.jpg]]",
"globalusage-header": "This page shows where a file is used on other 
wikis. You can also find that information at the bottom of the file description 
page.",
-   "globalusage-header-image": ""
+   "globalusage-header-image": "",
+   "globallyunusedfilestext": "The following files exist but are not 
embedded in any page on any wiki.",
+   "globallyunusedfiles": "Globally unused files"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 1d3db4a..ab0c108 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -39,5 +39,7 @@
"apihelp-query+globalusage-param-filterlocal": 
"{{doc-apihelp-param|query+globalusage|filterlocal}}",
"apihelp-query+globalusage-example-1": 
"{{doc-apihelp-example|query+globalusage}}",
"globalusage-header": "Text message used in [[Special:GlobalUsage]] 
right above the form describing the purpose of special page.",
-   "globalusage-header-image": "{{notranslate}}. Extra header for on-wiki 
customization. $1 - File being looked for."
+   "globalusage-header-image": "{{notranslate}}. Extra header for on-wiki 
customization. $1 - File being looked for.",
+   "globallyunusedfilestext": "Header message of 
[[Special:GloballyUnusedFiles]]",
+   "globallyunusedfiles": "{{doc-special|UnusedImages}}"
 }
diff --git a/includes/GlobalUsageHooks.php b/includes/GlobalUsageHooks.php
index 006abf8..e515a96 100644
--- a/includes/GlobalUsageHooks.php
+++ b/includes/GlobalUsageHooks.php
@@ -223,6 +223,9 @@
public static function onwgQueryPages( &$queryPages ) {
$queryPages[] = [ 'SpecialMostGloballyLinkedFiles', 
'MostGloballyLinkedFiles' ];
$queryPages[] = [ 'SpecialGloballyWantedFiles', 
'GloballyWantedFiles' ];
+   if ( GlobalUsage::onSharedRepo() ) {
+   $queryPages[] = [ 'SpecialGloballyUnusedFiles', 
'GloballyUnusedFiles' ];
+   }
return true;
}
 }
diff --git a/includes/SpecialGloballyUnusedFiles.php 
b/includes/SpecialGloballyUnusedFiles.php
new file mode 100644
index 000..d706e55
--- /dev/null
+++ b/includes/SpecialGloballyUnusedFiles.php
@@ -0,0 +1,131 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup SpecialPage
+ */
+
+/**
+ * A special page that lists globally unused images
+ *
+ * @ingroup SpecialPage
+ */
+class SpecialGloballyUnusedFiles extends ImageQueryPage {
+   function 

[MediaWiki-commits] [Gerrit] integration/config[master]: Add BlueSpiceAbout extension to zuul/layout.yaml

2017-12-29 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400714 )

Change subject: Add BlueSpiceAbout extension to zuul/layout.yaml
..

Add BlueSpiceAbout extension to zuul/layout.yaml

Bug: T183674
Change-Id: If21808f55f67e83e51eb6fa0eb0ebf80cae1f62b
---
M zuul/layout.yaml
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/14/400714/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index c1a5f0b..214885f 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -4346,6 +4346,11 @@
   - name: extension-unittests-generic
   - name: mwgate-npm
 
+  - name: mediawiki/extensions/BlueSpiceAbout
+template:
+  - name: extension-unittests-generic
+  - name: mwgate-npm
+
   - name: mediawiki/extensions/BlueSpiceCategoryManager
 template:
   - name: extension-unittests-composer-non-voting

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If21808f55f67e83e51eb6fa0eb0ebf80cae1f62b
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] integration/config[master]: Add Form extension to zuul/layout.yaml

2017-12-29 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400712 )

Change subject: Add Form extension to zuul/layout.yaml
..

Add Form extension to zuul/layout.yaml

Change-Id: I04a52fa34889a2ef17328b84a5a69e28a5ee4cc8
---
M zuul/layout.yaml
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/12/400712/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index c1a5f0b..fd173b2 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -3480,6 +3480,11 @@
 postmerge:
  - mwext-jsduck-publish
 
+  - name: mediawiki/extensions/Form
+template:
+  - name: extension-unittests-generic
+  - name: mwgate-npm
+
   - name: mediawiki/extensions/FormPreloadPostCache
 template:
   - name: extension-unittests-generic

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I04a52fa34889a2ef17328b84a5a69e28a5ee4cc8
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] translatewiki[master]: Remove keyAlgorithm for some groups using GettextFFS

2017-12-29 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400683 )

Change subject: Remove keyAlgorithm for some groups using GettextFFS
..

Remove keyAlgorithm for some groups using GettextFFS

This is a part of migration of GettextFFS keyAlgorithm
default value to simple
Here we remove keyAlgorithm for groups where it was previously set
to simple. There is no need for that setting anymore because simple
is default value now

Change-Id: I801b8c8c9745c2c7acf6d95d5267719c2df043b5
---
M groups/Dissemin/Dissemin.yaml
M groups/MantisBT/CodevTT.yaml
2 files changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/83/400683/1

diff --git a/groups/Dissemin/Dissemin.yaml b/groups/Dissemin/Dissemin.yaml
index aa8e968..775fcde 100644
--- a/groups/Dissemin/Dissemin.yaml
+++ b/groups/Dissemin/Dissemin.yaml
@@ -23,7 +23,6 @@
 
 FILES:
   class: GettextFFS
-  keyAlgorithm: simple
   sourcePattern: "%GROUPROOT%/dissemin/locale/%CODE%/LC_MESSAGES/django.po"
   definitionFile: "%GROUPROOT%/dissemin/locale/django.pot"
 
@@ -50,6 +49,5 @@
 
 FILES:
   class: GettextFFS
-  keyAlgorithm: simple
   sourcePattern: "%GROUPROOT%/dissemin/locale/%CODE%/LC_MESSAGES/djangojs.po"
   definitionFile: "%GROUPROOT%/dissemin/locale/djangojs.pot"
diff --git a/groups/MantisBT/CodevTT.yaml b/groups/MantisBT/CodevTT.yaml
index 3218bf7..bf09943 100644
--- a/groups/MantisBT/CodevTT.yaml
+++ b/groups/MantisBT/CodevTT.yaml
@@ -9,7 +9,6 @@
 
 FILES:
   class: GettextFFS
-  keyAlgorithm: simple
   sourcePattern: "%GROUPROOT%/codev/i18n/locale/%CODE%/LC_MESSAGES/codev.po"
   definitionFile: "%GROUPROOT%/codev/i18n/locale/codevtt.pot"
   codeMap:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I801b8c8c9745c2c7acf6d95d5267719c2df043b5
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Translate[master]: Migrate GettextFFS keyAlgorithm default value to simple

2017-12-28 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400614 )

Change subject: Migrate GettextFFS keyAlgorithm default value to simple
..

Migrate GettextFFS keyAlgorithm default value to simple

The reason for this migration is the fact that simple algorithm
produces shorter page titles and shorter titles are nicer in many
places where the titles can appear

Bug: T178882
Change-Id: Ibc0f919d09913d96887060448a37a2e06163c0b1
---
M ffs/GettextFFS.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/14/400614/1

diff --git a/ffs/GettextFFS.php b/ffs/GettextFFS.php
index 180195f..3248afe 100644
--- a/ffs/GettextFFS.php
+++ b/ffs/GettextFFS.php
@@ -63,7 +63,7 @@
public function parseGettext( $data ) {
$mangler = $this->group->getMangler();
$useCtxtAsKey = isset( $this->extra['CtxtAsKey'] ) && 
$this->extra['CtxtAsKey'];
-   $keyAlgorithm = 'legacy';
+   $keyAlgorithm = 'simple';
if ( isset( $this->extra['keyAlgorithm'] ) ) {
$keyAlgorithm = $this->extra['keyAlgorithm'];
}
@@ -294,7 +294,7 @@
 * @param string $algorithm Algorithm used to generate message keys: 
simple or legacy
 * @return string
 */
-   public static function generateKeyFromItem( array $item, $algorithm = 
'legacy' ) {
+   public static function generateKeyFromItem( array $item, $algorithm = 
'simple' ) {
$lang = Language::factory( 'en' );
 
if ( $item['ctxt'] === '' ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc0f919d09913d96887060448a37a2e06163c0b1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] translatewiki[master]: Update groups GettextFFS keyAlgorithm

2017-12-28 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400613 )

Change subject: Update groups GettextFFS keyAlgorithm
..

Update groups GettextFFS keyAlgorithm

This is a part of migration of GettextFFS keyAlgorithm
default value to simple

Bug: T178882
Change-Id: Iae3945e902630b20e24fe06797c2aa3f8645e114
---
M groups/Dissemin/Dissemin.yaml
M groups/MantisBT/CodevTT.yaml
M groups/Nocc/Nocc.yaml
M groups/OpenStreetMap/WaymarkedTrails.yaml
4 files changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/13/400613/1

diff --git a/groups/Dissemin/Dissemin.yaml b/groups/Dissemin/Dissemin.yaml
index aa8e968..775fcde 100644
--- a/groups/Dissemin/Dissemin.yaml
+++ b/groups/Dissemin/Dissemin.yaml
@@ -23,7 +23,6 @@
 
 FILES:
   class: GettextFFS
-  keyAlgorithm: simple
   sourcePattern: "%GROUPROOT%/dissemin/locale/%CODE%/LC_MESSAGES/django.po"
   definitionFile: "%GROUPROOT%/dissemin/locale/django.pot"
 
@@ -50,6 +49,5 @@
 
 FILES:
   class: GettextFFS
-  keyAlgorithm: simple
   sourcePattern: "%GROUPROOT%/dissemin/locale/%CODE%/LC_MESSAGES/djangojs.po"
   definitionFile: "%GROUPROOT%/dissemin/locale/djangojs.pot"
diff --git a/groups/MantisBT/CodevTT.yaml b/groups/MantisBT/CodevTT.yaml
index 3218bf7..bf09943 100644
--- a/groups/MantisBT/CodevTT.yaml
+++ b/groups/MantisBT/CodevTT.yaml
@@ -9,7 +9,6 @@
 
 FILES:
   class: GettextFFS
-  keyAlgorithm: simple
   sourcePattern: "%GROUPROOT%/codev/i18n/locale/%CODE%/LC_MESSAGES/codev.po"
   definitionFile: "%GROUPROOT%/codev/i18n/locale/codevtt.pot"
   codeMap:
diff --git a/groups/Nocc/Nocc.yaml b/groups/Nocc/Nocc.yaml
index a177256..ab55240 100644
--- a/groups/Nocc/Nocc.yaml
+++ b/groups/Nocc/Nocc.yaml
@@ -63,6 +63,7 @@
 
 FILES:
   class: GettextFFS
+  keyAlgorithm: legacy
   definitionFile: "%GROUPROOT%/nocc/htdocs/engine/languages/en.pot"
   sourcePattern: "%GROUPROOT%/nocc/htdocs/engine/languages/%CODE%.po"
   codeMap:
diff --git a/groups/OpenStreetMap/WaymarkedTrails.yaml 
b/groups/OpenStreetMap/WaymarkedTrails.yaml
index 0157699..04f1c5d 100644
--- a/groups/OpenStreetMap/WaymarkedTrails.yaml
+++ b/groups/OpenStreetMap/WaymarkedTrails.yaml
@@ -29,6 +29,7 @@
 
 FILES:
   class: GettextFFS
+  keyAlgorithm: legacy
   sourcePattern: 
"%GROUPROOT%/waymarked-trails-site/django/locale/%CODE%/LC_MESSAGES/django.po"
   definitionFile: 
"%GROUPROOT%/waymarked-trails-site/django/locale/qot/LC_MESSAGES/django.po"
   codeMap:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae3945e902630b20e24fe06797c2aa3f8645e114
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...EventBus[master]: Fix unintentionally created global functions in EventBusHooks

2017-12-28 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400571 )

Change subject: Fix unintentionally created global functions in EventBusHooks
..

Fix unintentionally created global functions in EventBusHooks

Functions EventBusHooks::onArticleRevisionVisibilitySet and
EventBusHooks::onBlockIpComplete created new global functions
unintentionally. This is now fixed by moving functions inside
those functions to separate private static helper functions.

Bug: T183730
Change-Id: I184cc8102b02a60937c526dd4be70c37ab6cb48b
---
M EventBus.hooks.php
1 file changed, 44 insertions(+), 44 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventBus 
refs/changes/71/400571/1

diff --git a/EventBus.hooks.php b/EventBus.hooks.php
index 3e15488..b124147 100644
--- a/EventBus.hooks.php
+++ b/EventBus.hooks.php
@@ -296,26 +296,6 @@
global $wgDBname;
$events = [];
 
-   /**
-* Returns true if the Revision::DELETED_* field is set
-* in the $hiddenBits.  False otherwise.
-*/
-   function isHidden( $hiddenBits, $field ) {
-   return ( $hiddenBits & $field ) == $field;
-   }
-
-   /**
-* Converts a revision visibility hidden bitfield to an array 
with keys
-* of each of the possible visibility settings name mapped to a 
boolean.
-*/
-   function bitsToVisibilityObject( $bits ) {
-   return [
-   'text'=> !isHidden( $bits, 
Revision::DELETED_TEXT ),
-   'user'=> !isHidden( $bits, 
Revision::DELETED_USER ),
-   'comment' => !isHidden( $bits, 
Revision::DELETED_COMMENT ),
-   ];
-   }
-
$performer = RequestContext::getMain()->getUser();
$performer->loadFromId();
 
@@ -363,9 +343,9 @@
'rev_content_format' => 
$revision->getContentModel(),
 
// visibility-change state fields:
-   'visibility'   => 
bitsToVisibilityObject( $visibilityChangeMap[$revId]['newBits'] ),
+   'visibility'   => 
self::bitsToVisibilityObject( $visibilityChangeMap[$revId]['newBits'] ),
'prior_state' => [
-   'visibility' => 
bitsToVisibilityObject( $visibilityChangeMap[$revId]['oldBits'] ),
+   'visibility' => 
self::bitsToVisibilityObject( $visibilityChangeMap[$revId]['oldBits'] ),
]
];
 
@@ -405,6 +385,26 @@
EventBus::getInstance()->send( $events );
}
);
+   }
+
+   /**
+* Returns true if the Revision::DELETED_* field is set
+* in the $hiddenBits.  False otherwise.
+*/
+   private static function isHidden( $hiddenBits, $field ) {
+   return ( $hiddenBits & $field ) == $field;
+   }
+
+   /**
+* Converts a revision visibility hidden bitfield to an array with keys
+* of each of the possible visibility settings name mapped to a boolean.
+*/
+   private static function bitsToVisibilityObject( $bits ) {
+   return [
+   'text'=> !self::isHidden( $bits, 
Revision::DELETED_TEXT ),
+   'user'=> !self::isHidden( $bits, 
Revision::DELETED_USER ),
+   'comment' => !self::isHidden( $bits, 
Revision::DELETED_COMMENT ),
+   ];
}
 
/**
@@ -509,26 +509,6 @@
global $wgDBname;
$events = [];
 
-   /**
-* Given a Block $block, returns an array suitable for use
-* as a 'blocks' object in the user/blocks-change event schema.
-* This function exists just to DRY the code a bit.
-*/
-   function getUserBlocksChangeAttributes( $block ) {
-   $blockAttrs = [
-   # mHideName is sometimes a string/int like '0'.
-   # Cast to int then to bool to make sure it is a 
proper bool.
-   'name'   => 
(bool)(int)$block->mHideName,
-   'email'  => (bool)$block->prevents( 
'sendemail' ),
-   'user_talk'  => (bool)$block->prevents( 
'editownusertalk' ),
-   'account_create' => (bool)$block->prevents( 
'createaccount' ),
-   ];
-   if ( 

[MediaWiki-commits] [Gerrit] mediawiki...Translate[master]: Add RTL direction support in the Special:PageMigration

2017-12-26 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400251 )

Change subject: Add RTL direction support in the Special:PageMigration
..

Add RTL direction support in the Special:PageMigration

Bug: T139463
Change-Id: I38654e0d05e23451a744ea49e9dac750d66ebcd4
---
M resources/js/ext.translate.special.pagemigration.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/51/400251/1

diff --git a/resources/js/ext.translate.special.pagemigration.js 
b/resources/js/ext.translate.special.pagemigration.js
index 08a477a..e5baf91 100644
--- a/resources/js/ext.translate.special.pagemigration.js
+++ b/resources/js/ext.translate.special.pagemigration.js
@@ -211,7 +211,7 @@
sourceUnit = $( '' ).addClass( 
'mw-tpm-sp-unit__source five columns' )
.prop( 'readonly', true ).attr( 'tabindex', '-1' ).val( 
sourceText );
targetUnit = $( '' ).addClass( 
'mw-tpm-sp-unit__target five columns' )
-   .val( targetText );
+   .val( targetText ).attr( 'dir', $.uls.data.getDir( 
langCode ) );
actionUnit = $( '' ).addClass( 'mw-tpm-sp-unit__actions 
two columns' );
actionUnit.append(
$( '' ).addClass( 'mw-tpm-sp-action 
mw-tpm-sp-action--add' )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I38654e0d05e23451a744ea49e9dac750d66ebcd4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Unit test NewsletterDb::restoreNewsletter

2017-12-26 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400232 )

Change subject: Unit test NewsletterDb::restoreNewsletter
..

Unit test NewsletterDb::restoreNewsletter

Bug: T183613
Change-Id: Iceb06041d81ef230eb3d95cc4df49f08c1b2c097
---
M tests/NewsletterDbTest.php
1 file changed, 27 insertions(+), 0 deletions(-)


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

diff --git a/tests/NewsletterDbTest.php b/tests/NewsletterDbTest.php
index b7d902f..1648bde 100644
--- a/tests/NewsletterDbTest.php
+++ b/tests/NewsletterDbTest.php
@@ -193,4 +193,31 @@
 
$this->assertTrue( $result );
}
+
+   /**
+* @covers NewsletterDb::restoreNewsletter
+*/
+   public function testRestoreNewsletter() {
+   $mockWriteDb = $this->getMockIDatabase();
+   $newsletter = $this->getTestNewsletter();
+
+   $mockWriteDb
+   ->expects( $this->once() )
+   ->method( 'update' )
+   ->with(
+   'nl_newsletters',
+   [ 'nl_active' => 1 ], [ 'nl_name' => 
$newsletter->getName() ]
+   );
+   $mockWriteDb
+   ->expects( $this->once() )
+   ->method( 'affectedRows' )
+   ->will( $this->returnValue( 1 ) );
+
+   $table = new NewsletterDb( $this->getMockLoadBalancer( 
$mockWriteDb ) );
+
+   $result = $table->restoreNewsletter( $newsletter->getName() );
+
+   $this->assertTrue( $result );
+   }
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iceb06041d81ef230eb3d95cc4df49f08c1b2c097
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Unit test NewsletterDb::removeSubscription

2017-12-26 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400229 )

Change subject: Unit test NewsletterDb::removeSubscription
..

Unit test NewsletterDb::removeSubscription

Additionally, add subscriber change database operation
mock to NewsletterDbTest::testAddSubscriber

Bug: T183614
Change-Id: I283fb32b6ee7290756bb11fbc08db4cb229eebd9
---
M tests/NewsletterDbTest.php
1 file changed, 43 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/29/400229/1

diff --git a/tests/NewsletterDbTest.php b/tests/NewsletterDbTest.php
index 622f9c0..b7d902f 100644
--- a/tests/NewsletterDbTest.php
+++ b/tests/NewsletterDbTest.php
@@ -59,6 +59,14 @@
$mockWriteDb->expects( $this->once() )
->method( 'affectedRows' )
->will( $this->returnValue( 1 ) );
+   $mockWriteDb
+   ->expects( $this->once() )
+   ->method( 'update' )
+   ->with(
+   'nl_newsletters',
+   // For index reasons, count is negative
+   [ 'nl_subscriber_count=nl_subscriber_count-1' 
], [ 'nl_id' => 1 ]
+   );
 
$table = new NewsletterDb( $this->getMockLoadBalancer( 
$mockWriteDb ) );
 
@@ -68,6 +76,41 @@
}
 
/**
+* @covers NewsletterDb::removeSubscription
+*/
+   public function testRemoveSubscriber() {
+   $mockWriteDb = $this->getMockIDatabase();
+   $user = User::newFromName( 'Test User' );
+   $user->addToDatabase();
+
+   $mockWriteDb
+   ->expects( $this->once() )
+   ->method( 'delete' )
+   ->with(
+   'nl_subscriptions',
+   [ 'nls_subscriber_id' => [ $user->getId() ], 
'nls_newsletter_id' => 1 ]
+   );
+   $mockWriteDb
+   ->expects( $this->once() )
+   ->method( 'affectedRows' )
+   ->will( $this->returnValue( 1 ) );
+   $mockWriteDb
+   ->expects( $this->once() )
+   ->method( 'update' )
+   ->with(
+   'nl_newsletters',
+   // For index reasons, count is negative
+   [ 'nl_subscriber_count=nl_subscriber_count+1' 
], [ 'nl_id' => 1 ]
+   );
+
+   $table = new NewsletterDb( $this->getMockLoadBalancer( 
$mockWriteDb ) );
+
+   $result = $table->removeSubscription( 
$this->getTestNewsletter(), [ $user->getId() ] );
+
+   $this->assertTrue( $result );
+   }
+
+   /**
 * @covers NewsletterDb::addPublisher
 */
public function testAddPublisher() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I283fb32b6ee7290756bb11fbc08db4cb229eebd9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Unit test NewsletterDb::addNewsletter

2017-12-26 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400225 )

Change subject: Unit test NewsletterDb::addNewsletter
..

Unit test NewsletterDb::addNewsletter

Bug: T183617
Change-Id: I725eb1fbf37c66e1610f4a4857f180ba879ab5c1
---
M tests/NewsletterDbTest.php
1 file changed, 31 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/25/400225/1

diff --git a/tests/NewsletterDbTest.php b/tests/NewsletterDbTest.php
index 57a9aeb..42010df 100644
--- a/tests/NewsletterDbTest.php
+++ b/tests/NewsletterDbTest.php
@@ -95,6 +95,37 @@
}
 
/**
+* @covers NewsletterDb::addNewsletter
+*/
+   public function testAddNewsletter() {
+   $mockWriteDb = $this->getMockIDatabase();
+   $newsletter = $this->getTestNewsletter();
+
+   $mockWriteDb
+   ->expects( $this->once() )
+   ->method( 'insert' )
+   ->with(
+   'nl_newsletters',
+   [
+   'nl_name' => $newsletter->getName(),
+   'nl_desc' => 
$newsletter->getDescription(),
+   'nl_main_page_id' => 
$newsletter->getPageId()
+   ]
+   )
+   ->will( $this->returnValue( true ) );
+   $mockWriteDb
+   ->expects( $this->once() )
+   ->method( 'insertId' )
+   ->will ( $this->returnValue( 1 ) );
+
+   $table = new NewsletterDb( $this->getMockLoadBalancer( 
$mockWriteDb ) );
+
+   $result = $table->addNewsletter( $newsletter );
+
+   $this->assertEquals( 1, $result );
+   }
+
+   /**
 * @covers NewsletterDb::deleteNewsletter
 */
public function testDeleteNewsletter() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I725eb1fbf37c66e1610f4a4857f180ba879ab5c1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Add @covers annotation to each NewsletterDb test case

2017-12-26 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400224 )

Change subject: Add @covers annotation to each NewsletterDb test case
..

Add @covers annotation to each NewsletterDb test case

Bug: T183613
Change-Id: Idbf543ee32f4ee8ab3407b1a235b31dbcded8a9a
---
M tests/NewsletterDbTest.php
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/24/400224/1

diff --git a/tests/NewsletterDbTest.php b/tests/NewsletterDbTest.php
index d7558a4..57a9aeb 100644
--- a/tests/NewsletterDbTest.php
+++ b/tests/NewsletterDbTest.php
@@ -41,6 +41,9 @@
);
}
 
+   /**
+* @covers NewsletterDb::addSubscription
+*/
public function testAddSubscriber() {
$mockWriteDb = $this->getMockIDatabase();
$user = User::newFromName( 'Test User' );
@@ -64,6 +67,9 @@
$this->assertEquals( true, $result );
}
 
+   /**
+* @covers NewsletterDb::addPublisher
+*/
public function testAddPublisher() {
$mockWriteDb = $this->getMockIDatabase();
$user = User::newFromName( 'Test User' );
@@ -88,6 +94,9 @@
$this->assertTrue( $result );
}
 
+   /**
+* @covers NewsletterDb::deleteNewsletter
+*/
public function testDeleteNewsletter() {
$mockWriteDb = $this->getMockIDatabase();
$newsletter = $this->getTestNewsletter();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idbf543ee32f4ee8ab3407b1a235b31dbcded8a9a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Unit test NewsletterDb::deleteNewsletter

2017-12-26 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400209 )

Change subject: Unit test NewsletterDb::deleteNewsletter
..

Unit test NewsletterDb::deleteNewsletter

Bug: T183621
Change-Id: Idb19a89056bad96d56845dd378f0834f773181d2
---
M tests/NewsletterDbTest.php
1 file changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/09/400209/1

diff --git a/tests/NewsletterDbTest.php b/tests/NewsletterDbTest.php
index ef056ed..d7558a4 100644
--- a/tests/NewsletterDbTest.php
+++ b/tests/NewsletterDbTest.php
@@ -87,4 +87,27 @@
 
$this->assertTrue( $result );
}
+
+   public function testDeleteNewsletter() {
+   $mockWriteDb = $this->getMockIDatabase();
+   $newsletter = $this->getTestNewsletter();
+
+   $mockWriteDb
+   ->expects( $this->once() )
+   ->method( 'update' )
+   ->with(
+   'nl_newsletters',
+   [ 'nl_active' => 0 ], [ 'nl_id' => 
$newsletter->getId() ]
+   );
+   $mockWriteDb
+   ->expects( $this->once() )
+   ->method( 'affectedRows' )
+   ->will( $this->returnValue( 1 ) );
+
+   $table = new NewsletterDb( $this->getMockLoadBalancer( 
$mockWriteDb ) );
+
+   $result = $table->deleteNewsletter( $newsletter );
+
+   $this->assertTrue( $result );
+   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb19a89056bad96d56845dd378f0834f773181d2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Add Hooks::runWithoutAbort support

2017-12-25 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400194 )

Change subject: Add Hooks::runWithoutAbort support
..

Add Hooks::runWithoutAbort support

Bug: T183194
Change-Id: Icec627f2d549ce617757479e60ccee486769ed45
---
M src/MWVisitor.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/tools/phan/SecurityCheckPlugin 
refs/changes/94/400194/1

diff --git a/src/MWVisitor.php b/src/MWVisitor.php
index 8c4b1b0..41df90e 100644
--- a/src/MWVisitor.php
+++ b/src/MWVisitor.php
@@ -94,6 +94,7 @@
$this->handleNormalHookRegistration( 
$node );
break;
case '\Hooks::run':
+   case '\Hooks::runWithoutAbort':
$this->triggerHook( $node );
break;
default:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icec627f2d549ce617757479e60ccee486769ed45
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/phan/SecurityCheckPlugin
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] integration/config[master]: Run phan for mediawiki/extensions/CiteThisPage

2017-12-25 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400187 )

Change subject: Run phan for mediawiki/extensions/CiteThisPage
..

Run phan for mediawiki/extensions/CiteThisPage

Bug: T179554
Change-Id: Id205ade2bc44e244c3905b984c94ae47f0542827
---
M zuul/layout.yaml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/87/400187/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index d25eb60..43dd53d 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -2991,6 +2991,7 @@
 template:
   - name: extension-unittests-generic
   - name: mwgate-npm
+  - name: extension-phan-generic
 
   - name: mediawiki/extensions/Citoid
 template:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id205ade2bc44e244c3905b984c94ae47f0542827
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] integration/config[master]: Run phan for mediawiki/extensions/Cite

2017-12-25 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400186 )

Change subject: Run phan for mediawiki/extensions/Cite
..

Run phan for mediawiki/extensions/Cite

Bug: T179554
Change-Id: I4cc1fab386c09f7068ab417ce50b52c3371e52cf
---
M zuul/layout.yaml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/86/400186/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index d25eb60..15b797e 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -2986,6 +2986,7 @@
 template:
   - name: extension-gate
   - name: mwgate-npm
+  - name: extension-phan-generic
 
   - name: mediawiki/extensions/CiteThisPage
 template:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4cc1fab386c09f7068ab417ce50b52c3371e52cf
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CiteThisPage[master]: Add phan configuration for static analysis

2017-12-25 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400185 )

Change subject: Add phan configuration for static analysis
..

Add phan configuration for static analysis

Bug: T179554
Change-Id: I9f099e07e5873c1125b4b75839f0089f59b4fa8b
---
M .gitignore
M SpecialCiteThisPage.php
A tests/phan/config.php
3 files changed, 310 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CiteThisPage 
refs/changes/85/400185/1

diff --git a/.gitignore b/.gitignore
index 4489bce..e9de19d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 /node_modules/
 /vendor/
+/tests/phan/issues
 /composer.lock
 
 # Editors
diff --git a/SpecialCiteThisPage.php b/SpecialCiteThisPage.php
index 9a17686..3e770e8 100644
--- a/SpecialCiteThisPage.php
+++ b/SpecialCiteThisPage.php
@@ -55,6 +55,7 @@
if ( strlen( $data['page'] ) ) {
$this->title = Title::newFromText( $data['page'] );
}
+   return true;
}
 
/**
@@ -71,10 +72,12 @@
// No prefix suggestion in special and media namespace
return [];
}
+
// Autocomplete subpage the same as a normal search
-   $prefixSearcher = new StringPrefixSearch;
-   $result = $prefixSearcher->search( $search, $limit, [], $offset 
);
-   return $result;
+   $result = SearchEngine::completionSearch( $search );
+   return array_map( function ( $sub ) {
+   return $sub->getSuggestedTitle();
+   }, $result->getSuggestions() );
}
 
protected function getGroupName() {
diff --git a/tests/phan/config.php b/tests/phan/config.php
new file mode 100644
index 000..2264c5d
--- /dev/null
+++ b/tests/phan/config.php
@@ -0,0 +1,303 @@
+ [
+   ],
+
+   /**
+* A list of directories that should be parsed for class and
+* method information. After excluding the directories
+* defined in exclude_analysis_directory_list, the remaining
+* files will be statically analyzed for errors.
+*
+* Thus, both first-party and third-party code being used by
+* your application should be included in this list.
+*/
+   'directory_list' => [
+   '.',
+   './../../includes',
+   './../../languages',
+   './../../maintenance',
+   './../../vendor',
+   ],
+
+   /**
+* A file list that defines files that will be excluded
+* from parsing and analysis and will not be read at all.
+*
+* This is useful for excluding hopelessly unanalyzable
+* files that can't be removed for whatever reason.
+*/
+   'exclude_file_list' => [
+   ],
+
+   /**
+* A list of directories holding code that we want
+* to parse, but not analyze. Also works for individual
+* files.
+*/
+   "exclude_analysis_directory_list" => [
+   './../../includes',
+   './../../languages',
+   './../../maintenance',
+   './../../vendor',
+   ],
+
+   /**
+* Backwards Compatibility Checking. This is slow
+* and expensive, but you should consider running
+* it before upgrading your version of PHP to a
+* new version that has backward compatibility
+* breaks.
+*/
+   'backward_compatibility_checks' => false,
+
+   /**
+* A set of fully qualified class-names for which
+* a call to parent::__construct() is required
+*/
+   'parent_constructor_required' => [
+   ],
+
+   /**
+* Run a quick version of checks that takes less
+* time at the cost of not running as thorough
+* an analysis. You should consider setting this
+* to true only when you wish you had more issues
+* to fix in your code base.
+*
+* In quick-mode the scanner doesn't rescan a function
+* or a method's code block every time a call is seen.
+* This means that the problem here won't be detected:
+*
+* ```php
+*  false,
+
+   /**
+* By default, Phan will not analyze all node types
+* in order to save time. If this config is set to true,
+* Phan will dig deeper into the AST tree and do an
+* analysis on all nodes, possibly finding more issues.
+*
+* See \Phan\Analysis::shouldVisit for the set of skipped
+* nodes.
+*/
+   'should_visit_all_nodes' => true,
+
+   /**
+* If enabled, check all methods that override a
+* parent method to make sure its signature is
+* compatible with the parent's. This check
+* can add quite a bit of time to the 

[MediaWiki-commits] [Gerrit] mediawiki...Cite[master]: Add phan configuration for static analysis

2017-12-25 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400174 )

Change subject: Add phan configuration for static analysis
..

Add phan configuration for static analysis

Bug: T179554
Change-Id: I2bfd52c08aac1aa8f34e0664e6314835f79a0324
---
M .gitignore
M includes/ApiQueryReferences.php
M includes/Cite.php
M includes/CiteHooks.php
A tests/phan/config.php
5 files changed, 326 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite 
refs/changes/74/400174/1

diff --git a/.gitignore b/.gitignore
index 4489bce..e9de19d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 /node_modules/
 /vendor/
+/tests/phan/issues
 /composer.lock
 
 # Editors
diff --git a/includes/ApiQueryReferences.php b/includes/ApiQueryReferences.php
index 75b314c..100b742 100644
--- a/includes/ApiQueryReferences.php
+++ b/includes/ApiQueryReferences.php
@@ -21,6 +21,8 @@
  * @see https://www.mediawiki.org/wiki/Extension:Cite#API
  */
 
+use MediaWiki\MediaWikiServices;
+
 class ApiQueryReferences extends ApiQueryBase {
 
public function __construct( $query, $moduleName ) {
@@ -36,12 +38,15 @@
}
 
public function execute() {
-   $config = ConfigFactory::getDefaultInstance()->makeConfig( 
'cite' );
+   $config = 
MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'cite' );
if ( !$config->get( 'CiteStoreReferencesData' ) ) {
if ( is_callable( [ $this, 'dieWithError' ] ) ) {
$this->dieWithError( 
'apierror-citestoragedisabled' );
} else {
-   $this->dieUsage( 'Cite extension reference 
storage is not enabled', 'citestoragedisabled' );
+   $this->dieWithError(
+   new RawMessage( '$1', [ 'Cite extension 
reference storage is not enabled' ] ),
+   'citestoragedisabled'
+   );
}
}
$params = $this->extractRequestParams();
diff --git a/includes/Cite.php b/includes/Cite.php
index 02b93c5..63283e0 100644
--- a/includes/Cite.php
+++ b/includes/Cite.php
@@ -22,6 +22,7 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
 
+use MediaWiki\MediaWikiServices;
 use Wikimedia\Rdbms\IDatabase;
 
 /**
@@ -454,7 +455,7 @@
 * @throws Exception
 * @return string
 */
-   private function stack( $str, $key = null, $group, $follow, array $call 
) {
+   private function stack( $str, $key, $group, $follow, array $call ) {
if ( !isset( $this->mRefs[$group] ) ) {
$this->mRefs[$group] = [];
}
@@ -760,15 +761,18 @@
global $wgCiteCacheReferences, $wgMemc;
$data = false;
if ( $wgCiteCacheReferences ) {
-   $cacheKey = wfMemcKey(
+   $cacheKey = 
ObjectCache::getLocalClusterInstance()->makeKey(
'citeref',
md5( $parserInput ),
$this->mParser->Title()->getArticleID()
);
$data = $wgMemc->get( $cacheKey );
+   if ( !$this->mParser->isValidHalfParsedText( $data ) ) {
+   $data = false;
+   }
}
 
-   if ( !$data || !$this->mParser->isValidHalfParsedText( $data ) 
) {
+   if ( !$data ) {
// Live hack: parse() adds two newlines on WM, can't 
reproduce it locally -ævar
$ret = rtrim( $this->mParser->recursiveTagParse( 
$parserInput ), "\n" );
 
@@ -1335,7 +1339,7 @@
 * Return an error message based on an error ID
 *
 * @param string $key   Message name for the error
-* @param string|null $param Parameter to pass to the message
+* @param mixed $param Parameter to pass to the message
 * @param string $parse Whether to parse the message ('parse') or not 
('noparse')
 * @return string XHTML or wikitext ready for output
 */
@@ -1429,7 +1433,7 @@
if ( !$wgCiteStoreReferencesData ) {
return false;
}
-   $cache = ObjectCache::getMainWANInstance();
+   $cache = 
MediaWikiServices::getInstance()->getMainWANObjectCache();
$key = $cache->makeKey( self::EXT_DATA_KEY, 
$title->getArticleID() );
return $cache->getWithSetCallback(
$key,
diff --git a/includes/CiteHooks.php b/includes/CiteHooks.php
index bcf65fd..4bdeab6 100644
--- a/includes/CiteHooks.php
+++ 

[MediaWiki-commits] [Gerrit] integration/config[master]: Run phan for mediawiki/skins/Modern

2017-12-24 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400159 )

Change subject: Run phan for mediawiki/skins/Modern
..

Run phan for mediawiki/skins/Modern

Bug: T179554
Change-Id: Ic9e8fdb1d7c8e1ac2f1d006d3493436b344fcec2
---
M zuul/layout.yaml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/59/400159/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index d25eb60..40800cc 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -1999,6 +1999,7 @@
  - name: mw-checks-test
  - name: mwgate-npm
  - name: skin-tests
+ - name: extension-phan-generic
 
   - name: mediawiki/skins/MonoBook
 template:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9e8fdb1d7c8e1ac2f1d006d3493436b344fcec2
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Modern[master]: Add phan configuration for static analysis

2017-12-24 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400158 )

Change subject: Add phan configuration for static analysis
..

Add phan configuration for static analysis

Bug: T179554
Change-Id: I75f6df702e2664fbbd27fd32a03efee18f2235e6
---
M .gitignore
A tests/phan/config.php
2 files changed, 306 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Modern 
refs/changes/58/400158/1

diff --git a/.gitignore b/.gitignore
index 53bbca6..db3b235 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,7 @@
 
 # Building & testing
 node_modules/
+/tests/phan/issues
 
 # Composer
 /vendor
diff --git a/tests/phan/config.php b/tests/phan/config.php
new file mode 100644
index 000..70bcde5
--- /dev/null
+++ b/tests/phan/config.php
@@ -0,0 +1,305 @@
+ [
+   ],
+
+   /**
+* A list of directories that should be parsed for class and
+* method information. After excluding the directories
+* defined in exclude_analysis_directory_list, the remaining
+* files will be statically analyzed for errors.
+*
+* Thus, both first-party and third-party code being used by
+* your application should be included in this list.
+*/
+   'directory_list' => [
+   '.',
+   './../../includes',
+   './../../languages',
+   './../../maintenance',
+   './../../vendor',
+   ],
+
+   /**
+* A file list that defines files that will be excluded
+* from parsing and analysis and will not be read at all.
+*
+* This is useful for excluding hopelessly unanalyzable
+* files that can't be removed for whatever reason.
+*/
+   'exclude_file_list' => [
+   ],
+
+   /**
+* A list of directories holding code that we want
+* to parse, but not analyze. Also works for individual
+* files.
+*/
+   "exclude_analysis_directory_list" => [
+   './../../includes',
+   './../../languages',
+   './../../maintenance',
+   './../../vendor',
+   ],
+
+   /**
+* Backwards Compatibility Checking. This is slow
+* and expensive, but you should consider running
+* it before upgrading your version of PHP to a
+* new version that has backward compatibility
+* breaks.
+*/
+   'backward_compatibility_checks' => false,
+
+   /**
+* A set of fully qualified class-names for which
+* a call to parent::__construct() is required
+*/
+   'parent_constructor_required' => [
+   ],
+
+   /**
+* Run a quick version of checks that takes less
+* time at the cost of not running as thorough
+* an analysis. You should consider setting this
+* to true only when you wish you had more issues
+* to fix in your code base.
+*
+* In quick-mode the scanner doesn't rescan a function
+* or a method's code block every time a call is seen.
+* This means that the problem here won't be detected:
+*
+* ```php
+*  false,
+
+   /**
+* By default, Phan will not analyze all node types
+* in order to save time. If this config is set to true,
+* Phan will dig deeper into the AST tree and do an
+* analysis on all nodes, possibly finding more issues.
+*
+* See \Phan\Analysis::shouldVisit for the set of skipped
+* nodes.
+*/
+   'should_visit_all_nodes' => true,
+
+   /**
+* If enabled, check all methods that override a
+* parent method to make sure its signature is
+* compatible with the parent's. This check
+* can add quite a bit of time to the analysis.
+*/
+   'analyze_signature_compatibility' => true,
+
+   // Emit all issues. They are then suppressed via
+   // suppress_issue_types, rather than a minimum
+   // severity.
+   "minimum_severity" => 0,
+
+   /**
+* If true, missing properties will be created when
+* they are first seen. If false, we'll report an
+* error message if there is an attempt to write
+* to a class property that wasn't explicitly
+* defined.
+*/
+   'allow_missing_properties' => false,
+
+   /**
+* Allow null to be cast as any type and for any
+* type to be cast to null. Setting this to false
+* will cut down on false positives.
+*/
+   'null_casts_as_any_type' => true,
+
+   /**
+* If enabled, scalars (int, float, bool, string, null)
+* are treated as if they can cast to each other.
+*
+* MediaWiki is pretty lax and uses many scalar
+* types interchangably.
+*/
+   'scalar_implicit_cast' => true,
+
+   

[MediaWiki-commits] [Gerrit] integration/config[master]: Run phan for mediawiki/skins/Vector

2017-12-24 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400157 )

Change subject: Run phan for mediawiki/skins/Vector
..

Run phan for mediawiki/skins/Vector

Bug: T179554
Change-Id: Iced3b9f7d10a149eead2e6a3e102b3edc0b5bc1d
---
M zuul/layout.yaml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/57/400157/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index d25eb60..58890fc 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -2083,6 +2083,7 @@
  - name: mwgate-composer
  - name: mwgate-npm
  - name: skin-tests
+ - name: extension-phan-generic
 test:
  - mediawiki-core-qunit-selenium-jessie
 gate-and-submit: 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iced3b9f7d10a149eead2e6a3e102b3edc0b5bc1d
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Vector[master]: Add phan configuration for static analysis

2017-12-24 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400156 )

Change subject: Add phan configuration for static analysis
..

Add phan configuration for static analysis

Bug: T179554
Change-Id: I587285fb3687541233156e19e24cd448e9a7976a
---
M .gitignore
M VectorTemplate.php
A tests/phan/config.php
3 files changed, 306 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector 
refs/changes/56/400156/1

diff --git a/.gitignore b/.gitignore
index 7c9e72a..4a10ec2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,7 @@
 /docs
 /node_modules
 /vendor
+/tests/phan/issues
 
 # Operating systems
 ## Mac OS X
diff --git a/VectorTemplate.php b/VectorTemplate.php
index fe2c878..6f2c00f 100644
--- a/VectorTemplate.php
+++ b/VectorTemplate.php
@@ -152,7 +152,7 @@

msg( 'navigation-heading' ) ?>

-   renderNavigation( 'PERSONAL' ); ?>
+   renderNavigation( [ 'PERSONAL' ] 
); ?>

renderNavigation( [ 
'NAMESPACES', 'VARIANTS' ] ); ?>

@@ -271,10 +271,10 @@
$msg = $name;
}
$msgObj = wfMessage( $msg );
-   $labelId = Sanitizer::escapeId( "p-$name-label" );
+   $labelId = Sanitizer::escapeIdForAttribute( "p-$name-label" );
?>
 aria-labelledby=''>
diff --git a/tests/phan/config.php b/tests/phan/config.php
new file mode 100644
index 000..ee8f443
--- /dev/null
+++ b/tests/phan/config.php
@@ -0,0 +1,302 @@
+ [
+   ],
+
+   /**
+* A list of directories that should be parsed for class and
+* method information. After excluding the directories
+* defined in exclude_analysis_directory_list, the remaining
+* files will be statically analyzed for errors.
+*
+* Thus, both first-party and third-party code being used by
+* your application should be included in this list.
+*/
+   'directory_list' => [
+   '.',
+   './../../includes',
+   './../../languages',
+   './../../maintenance',
+   './../../vendor',
+   ],
+
+   /**
+* A file list that defines files that will be excluded
+* from parsing and analysis and will not be read at all.
+*
+* This is useful for excluding hopelessly unanalyzable
+* files that can't be removed for whatever reason.
+*/
+   'exclude_file_list' => [
+   ],
+
+   /**
+* A list of directories holding code that we want
+* to parse, but not analyze. Also works for individual
+* files.
+*/
+   "exclude_analysis_directory_list" => [
+   './../../includes',
+   './../../languages',
+   './../../maintenance',
+   './../../vendor',
+   ],
+
+   /**
+* Backwards Compatibility Checking. This is slow
+* and expensive, but you should consider running
+* it before upgrading your version of PHP to a
+* new version that has backward compatibility
+* breaks.
+*/
+   'backward_compatibility_checks' => false,
+
+   /**
+* A set of fully qualified class-names for which
+* a call to parent::__construct() is required
+*/
+   'parent_constructor_required' => [
+   ],
+
+   /**
+* Run a quick version of checks that takes less
+* time at the cost of not running as thorough
+* an analysis. You should consider setting this
+* to true only when you wish you had more issues
+* to fix in your code base.
+*
+* In quick-mode the scanner doesn't rescan a function
+* or a method's code block every time a call is seen.
+* This means that the problem here won't be detected:
+*
+* ```php
+*  false,
+
+   /**
+* By default, Phan will not analyze all node types
+* in order to save time. If this config is set to true,
+* Phan will dig deeper into the AST tree and do an
+* analysis on all nodes, possibly finding more issues.
+*
+* See \Phan\Analysis::shouldVisit for the set of skipped
+* nodes.
+*/
+   'should_visit_all_nodes' => true,
+
+   /**
+* If enabled, check all methods that override a
+* parent method to make sure its signature is
+* compatible with the parent's. This check
+* can add quite a bit of time to the analysis.
+*/
+   'analyze_signature_compatibility' => true,
+
+   // Emit all issues. They are then suppressed via
+   // suppress_issue_types, rather than a 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceGroupManager[master]: Add minus-x to composer test and fix

2017-12-24 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400114 )

Change subject: Add minus-x to composer test and fix
..

Add minus-x to composer test and fix

Bug: T175794
Change-Id: Ia165046562b15499770dbae2bd839836a7a9f5ca
---
M composer.json
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceGroupManager 
refs/changes/14/400114/1

diff --git a/composer.json b/composer.json
index 7e4dd81..094f084 100644
--- a/composer.json
+++ b/composer.json
@@ -12,11 +12,16 @@
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.1"
},
"scripts": {
"test": [
-   "parallel-lint . --exclude vendor --exclude 
node_modules"
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
+   "minus-x check ."
+   ],
+   "fix": [
+   "minus-x fix ."
]
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia165046562b15499770dbae2bd839836a7a9f5ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceGroupManager
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtendedStatistics[master]: Add minus-x to composer test and fix

2017-12-24 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400113 )

Change subject: Add minus-x to composer test and fix
..

Add minus-x to composer test and fix

Bug: T175794
Change-Id: I3789453a529dd6926970d83c45799fb9a4376226
---
M composer.json
M i18n/av.json
M i18n/awa.json
M i18n/azb.json
M i18n/ba.json
M i18n/bcc.json
M i18n/bgn.json
M i18n/bn.json
M i18n/br.json
M i18n/ca.json
M i18n/ce.json
M i18n/cs.json
M i18n/cv.json
M i18n/de-formal.json
M i18n/dty.json
M i18n/el.json
M i18n/eu.json
M i18n/fy.json
M i18n/gu.json
M i18n/he.json
M i18n/hu.json
M i18n/ja.json
M i18n/ko.json
M i18n/ksh.json
M i18n/ku-latn.json
M i18n/lki.json
M i18n/lt.json
M i18n/mai.json
M i18n/mk.json
M i18n/my.json
M i18n/ne.json
M i18n/nl.json
M i18n/oc.json
M i18n/os.json
M i18n/ps.json
M i18n/ru.json
M i18n/shy-latn.json
M i18n/sl.json
M i18n/sq.json
M i18n/sr-ec.json
M i18n/sr-el.json
M i18n/sv.json
M i18n/szl.json
M i18n/ta.json
M i18n/tcy.json
M i18n/te.json
M i18n/tr.json
M i18n/vi.json
M i18n/yi.json
M i18n/zh-hant.json
M includes/api/BSApiStatisticsAvailableDiagramsStore.php
M includes/api/BSApiStatisticsSearchOptionsStore.php
M resources/bluespice.statistics.css
M resources/bluespice.statistics.js
M resources/images/bs-searchstatistics.png
55 files changed, 7 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtendedStatistics
 refs/changes/13/400113/1

diff --git a/composer.json b/composer.json
index 24c0aa4..ef25197 100644
--- a/composer.json
+++ b/composer.json
@@ -14,11 +14,16 @@
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.1"
},
"scripts": {
"test": [
-   "parallel-lint . --exclude vendor --exclude 
node_modules"
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
+   "minus-x check ."
+   ],
+   "fix": [
+   "minus-x fix ."
]
}
 }
diff --git a/i18n/av.json b/i18n/av.json
old mode 100755
new mode 100644
diff --git a/i18n/awa.json b/i18n/awa.json
old mode 100755
new mode 100644
diff --git a/i18n/azb.json b/i18n/azb.json
old mode 100755
new mode 100644
diff --git a/i18n/ba.json b/i18n/ba.json
old mode 100755
new mode 100644
diff --git a/i18n/bcc.json b/i18n/bcc.json
old mode 100755
new mode 100644
diff --git a/i18n/bgn.json b/i18n/bgn.json
old mode 100755
new mode 100644
diff --git a/i18n/bn.json b/i18n/bn.json
old mode 100755
new mode 100644
diff --git a/i18n/br.json b/i18n/br.json
old mode 100755
new mode 100644
diff --git a/i18n/ca.json b/i18n/ca.json
old mode 100755
new mode 100644
diff --git a/i18n/ce.json b/i18n/ce.json
old mode 100755
new mode 100644
diff --git a/i18n/cs.json b/i18n/cs.json
old mode 100755
new mode 100644
diff --git a/i18n/cv.json b/i18n/cv.json
old mode 100755
new mode 100644
diff --git a/i18n/de-formal.json b/i18n/de-formal.json
old mode 100755
new mode 100644
diff --git a/i18n/dty.json b/i18n/dty.json
old mode 100755
new mode 100644
diff --git a/i18n/el.json b/i18n/el.json
old mode 100755
new mode 100644
diff --git a/i18n/eu.json b/i18n/eu.json
old mode 100755
new mode 100644
diff --git a/i18n/fy.json b/i18n/fy.json
old mode 100755
new mode 100644
diff --git a/i18n/gu.json b/i18n/gu.json
old mode 100755
new mode 100644
diff --git a/i18n/he.json b/i18n/he.json
old mode 100755
new mode 100644
diff --git a/i18n/hu.json b/i18n/hu.json
old mode 100755
new mode 100644
diff --git a/i18n/ja.json b/i18n/ja.json
old mode 100755
new mode 100644
diff --git a/i18n/ko.json b/i18n/ko.json
old mode 100755
new mode 100644
diff --git a/i18n/ksh.json b/i18n/ksh.json
old mode 100755
new mode 100644
diff --git a/i18n/ku-latn.json b/i18n/ku-latn.json
old mode 100755
new mode 100644
diff --git a/i18n/lki.json b/i18n/lki.json
old mode 100755
new mode 100644
diff --git a/i18n/lt.json b/i18n/lt.json
old mode 100755
new mode 100644
diff --git a/i18n/mai.json b/i18n/mai.json
old mode 100755
new mode 100644
diff --git a/i18n/mk.json b/i18n/mk.json
old mode 100755
new mode 100644
diff --git a/i18n/my.json b/i18n/my.json
old mode 100755
new mode 100644
diff --git a/i18n/ne.json b/i18n/ne.json
old mode 100755
new mode 100644
diff --git a/i18n/nl.json b/i18n/nl.json
old mode 100755
new mode 100644
diff --git a/i18n/oc.json b/i18n/oc.json
old mode 100755
new mode 100644
diff --git a/i18n/os.json b/i18n/os.json
old mode 100755
new mode 100644
diff --git a/i18n/ps.json b/i18n/ps.json
old mode 100755
new mode 100644
diff --git a/i18n/ru.json b/i18n/ru.json
old mode 100755
new mode 100644
diff --git a/i18n/shy-latn.json b/i18n/shy-latn.json
old mode 100755
new mode 100644
diff --git 

[MediaWiki-commits] [Gerrit] mediawiki...PushToWatch[master]: Add minus-x to composer test and fix

2017-12-24 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400111 )

Change subject: Add minus-x to composer test and fix
..

Add minus-x to composer test and fix

Bug: T175794
Change-Id: Id8ed5462cda90f0fe02a042225b75ed9fc19c9ec
---
M PushToWatch.php
M composer.json
2 files changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PushToWatch 
refs/changes/11/400111/1

diff --git a/PushToWatch.php b/PushToWatch.php
old mode 100755
new mode 100644
diff --git a/composer.json b/composer.json
index aebd773..7d306d5 100644
--- a/composer.json
+++ b/composer.json
@@ -1,11 +1,16 @@
 {
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.1"
},
"scripts": {
"test": [
-   "parallel-lint . --exclude vendor --exclude 
node_modules"
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
+   "minus-x check ."
+   ],
+   "fix": [
+   "minus-x fix ."
]
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8ed5462cda90f0fe02a042225b75ed9fc19c9ec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PushToWatch
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PdfExport[master]: Add minus-x to composer test and fix

2017-12-24 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400110 )

Change subject: Add minus-x to composer test and fix
..

Add minus-x to composer test and fix

Bug: T175794
Change-Id: Ia42f237a2a021326b1887cd3efafcbca0bca7193
---
M package.json
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PdfExport 
refs/changes/10/400110/1

diff --git a/package.json b/package.json
index e87548c..48490a0 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,16 @@
 {
"private": true,
+   "require-dev": {
+   "mediawiki/minus-x": "0.2.1"
+   },
"scripts": {
-   "test": "grunt test"
+   "test": [
+   "grunt test",
+   "minus-x check ."
+   ],
+   "fix": [
+   "minus-x fix ."
+   ]
},
"devDependencies": {
"grunt": "1.0.1",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia42f237a2a021326b1887cd3efafcbca0bca7193
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PdfExport
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlogPage[master]: Add minus-x to composer test and fix

2017-12-23 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400077 )

Change subject: Add minus-x to composer test and fix
..

Add minus-x to composer test and fix

Change-Id: I886409e371d8f73f20c0e5af36c437acbe8acccf
---
M composer.json
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlogPage 
refs/changes/77/400077/1

diff --git a/composer.json b/composer.json
index a3aecbe..be133c3 100644
--- a/composer.json
+++ b/composer.json
@@ -1,11 +1,16 @@
 {
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.1"
},
"scripts": {
"test": [
-   "parallel-lint . --exclude node_modules --exclude 
vendor"
+   "parallel-lint . --exclude node_modules --exclude 
vendor",
+   "minus-x check ."
+   ],
+   "fix": [
+   "minus-x fix ."
]
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I886409e371d8f73f20c0e5af36c437acbe8acccf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlogPage
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Athena[master]: Add minus-x to composer test and fix

2017-12-23 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400076 )

Change subject: Add minus-x to composer test and fix
..

Add minus-x to composer test and fix

Bug: T175794
Change-Id: I94e38542f8381f87bed9f9efb1540969f7b1db04
---
M AthenaHelper.php
M composer.json
M data/temp
3 files changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Athena 
refs/changes/76/400076/1

diff --git a/AthenaHelper.php b/AthenaHelper.php
old mode 100755
new mode 100644
diff --git a/composer.json b/composer.json
index aebd773..7d306d5 100644
--- a/composer.json
+++ b/composer.json
@@ -1,11 +1,16 @@
 {
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.1"
},
"scripts": {
"test": [
-   "parallel-lint . --exclude vendor --exclude 
node_modules"
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
+   "minus-x check ."
+   ],
+   "fix": [
+   "minus-x fix ."
]
}
 }
diff --git a/data/temp b/data/temp
old mode 100755
new mode 100644

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I94e38542f8381f87bed9f9efb1540969f7b1db04
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Athena
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] labs...ZppixBot[master]: Refactor documentation html and add simple css styling

2017-12-23 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399979 )

Change subject: Refactor documentation html and add simple css styling
..

Refactor documentation html and add simple css styling

Bug: T182252
Change-Id: I900b6147e8915ec6731029a0998a61577e940c04
---
A public_html/css/docs.css
M public_html/documentation.html
2 files changed, 455 insertions(+), 388 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ZppixBot 
refs/changes/79/399979/1

diff --git a/public_html/css/docs.css b/public_html/css/docs.css
new file mode 100644
index 000..b00decf
--- /dev/null
+++ b/public_html/css/docs.css
@@ -0,0 +1,41 @@
+html {
+font-family: 'Times New Roman';
+}
+
+body {
+margin: 8px;
+}
+
+h1 {
+font-weight: normal;
+display: block;
+border-bottom: 1px solid #a2a9b1;
+}
+
+a {
+text-decoration: none;
+color: #0645ad;
+}
+
+table {
+border-collapse: collapse;
+}
+
+th {
+background-color: #ebebeb;
+}
+
+tr:nth-child(even) {
+background-color: #f5f5f5;
+}
+
+th, td {
+padding: 0.5em;
+}
+
+pre {
+padding: 1em;
+font-family: monospace;
+background-color: #f5f5f5;
+white-space: pre-wrap;
+}
diff --git a/public_html/documentation.html b/public_html/documentation.html
index bf083fb..6516771 100644
--- a/public_html/documentation.html
+++ b/public_html/documentation.html
@@ -1,364 +1,385 @@
-Documentation -ZppixBot
-Table of contents
-
-List of commands
-Module Development
-
-List of commands
-
-
-
-Commands
-Purpose
-Example
-Module
-
-
-
-
-.accesslevel
-Shows what level of access you have.
-
-adminlist
-
-
-.ban
-This give admins the ability to ban a user.The bot 
must be a Channel Operator for this command to work.
-
-adminchannel
-
-
-.blocks
-Manage ZppixBots blocking features.https://github.com/sopel-irc/sopel/wiki/Making-Sopel-ignore-people;>https://github.com/sopel-irc/sopel/wiki/Making-Sopel-ignore-people
-
-coretasks
-
-
-
-.c
-Google calculator.
-.c 5 + 3
-calc
-
-
-.chairs
-Set the meeting chairs.https://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module;>https://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module
-.chairs Tyrope Jason elad
-meetbot
-
-
-.commands
-Return a list of ZppixBots commands
-
-help
-
-
-.duck
-Queries Duck Duck Go for the specified input.
-
-search
-
-
-.endmeeting
-End a meeting.https://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module;>https://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module
-.endmeeting
-meetbot
-
-
-.ety
-Look up the etymology of a word
-.ety word
-etymology
-
-
-.countdown
-.countdown- displays a countdown to a 
given date.
-
-countdown
-
-
-.tld
-Show information about the given Top Level Domain.
-
-tld
-
-
-.task>
-Gives a link to the specified task on Miraheze Phabricator
-.task 1
-mh_phab
-
-
-.iplookup.ip
-IP Lookup tool
-.iplookup 8.8.8.8
-ip
-
-
-.isup
-isup.me website status checker
-
-isup
-
-
-.kick
-Kick a user from the channel.
-
-adminchannel
-
-
-.in
-Gives you a reminder in the given amount of time.
-.in 3h45m Release a new version of ZppixBot
-reminders
-
-
-.at
-Gives you a reminder at the given time. Time format: hh:mm:ss. To see what 
timezone is used, type .getchanneltz (if setting a reminder in a IRC channel) 
or .gettz (elsewhere)
-.at 13:47 Update the servers!
-reminders
-
-
-.cancelreminder
-Pings the bot operators to cancel a reminder that you no longer need.
-.cancelreminder (insert reminder message here)
-reminders
-
-
-.miraheze
-This command will tell you about Miraheze and where to learn more
-
-miraheze
-
-
-.gethelp
-Pings Miraheze admins, prompting to help a user that needs help.
-.gethelp I cannot access https://www.meta.miraheze.org
-miraheze
-
-
-.python
-Tells you what version of Python ZppixBot is running.
-
-pyver
-
-
-.kickban.kb
-   This gives admins the ability to kickban a user.   The bot 
must be a Channel Operator for this command to work   .kickban [#chan] 
user1 user!@ get out of here
-
-adminchannel>
-
-
-.mangle
-Repeatedly translate the input until it makes no sense.
-
-translate
-
-
-.action
-Log an action in the meeting loghttps://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module;>https://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module
-.action elad will develop a meetbot
-meetbot
-
-
-.agreed
-Log an agreement in the meeting log.https://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module;>https://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module
-.agreed bowties are not cool
-meetbot
-
-
-.info
-Log an informational item in the meeting loghttps://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module;>https://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module
-.info all board members present
-meetbot
-
-
-.link
-Log a link in the meeting log.

[MediaWiki-commits] [Gerrit] oojs/ui[master]: Add `margin-bottom` for widgets which are part of OOUI Horiz...

2017-12-20 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399423 )

Change subject: Add `margin-bottom` for widgets which are part of OOUI 
HorizontalLayout
..

Add `margin-bottom` for widgets which are part of OOUI HorizontalLayout

Bug: T179040
Change-Id: I368c67d576bf3aba9baca0bdea43d87436e4b034
---
M src/themes/apex/layouts.less
M src/themes/wikimediaui/layouts.less
2 files changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/23/399423/1

diff --git a/src/themes/apex/layouts.less b/src/themes/apex/layouts.less
index c5dc5f3..48d84a1 100644
--- a/src/themes/apex/layouts.less
+++ b/src/themes/apex/layouts.less
@@ -210,6 +210,7 @@
> .oo-ui-layout,
> .oo-ui-widget {
.oo-ui-inline-spacing( 0.5em );
+   margin-bottom: 0.5em;
}
 
> .oo-ui-layout {
diff --git a/src/themes/wikimediaui/layouts.less 
b/src/themes/wikimediaui/layouts.less
index 11be561..4955e25 100644
--- a/src/themes/wikimediaui/layouts.less
+++ b/src/themes/wikimediaui/layouts.less
@@ -274,6 +274,7 @@
> .oo-ui-layout,
> .oo-ui-widget {
.oo-ui-inline-spacing( 0.5em );
+   margin-bottom: 0.5em;
}
 
> .oo-ui-layout {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I368c67d576bf3aba9baca0bdea43d87436e4b034
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add `margin-bottom` for editButtons (EditPage)

2017-12-20 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399416 )

Change subject: Add `margin-bottom` for editButtons (EditPage)
..

Add `margin-bottom` for editButtons (EditPage)

Bug: T179040
Change-Id: I9e6c04556e4ff7f0cc567877041449f50abf4b4c
---
M resources/src/mediawiki.action/mediawiki.action.edit.styles.less
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/16/399416/1

diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.styles.less 
b/resources/src/mediawiki.action/mediawiki.action.edit.styles.less
index 1d578e4..c7044c7 100644
--- a/resources/src/mediawiki.action/mediawiki.action.edit.styles.less
+++ b/resources/src/mediawiki.action/mediawiki.action.edit.styles.less
@@ -57,4 +57,10 @@
.editOptions {
border-radius: 0 0 2px 2px;
}
+
+   .editButtons {
+   #wpSaveWidget, #wpPreviewWidget, #wpDiffWidget {
+   margin-bottom: 0.5em;
+   }
+   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e6c04556e4ff7f0cc567877041449f50abf4b4c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Elastica[master]: Add cURL PHP extension to the list of composer requirements

2017-12-19 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399339 )

Change subject: Add cURL PHP extension to the list of composer requirements
..

Add cURL PHP extension to the list of composer requirements

Bug: T166355
Change-Id: I55cb50f2b962b08543ad13f00acef333db43d816
---
M composer.json
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Elastica 
refs/changes/39/399339/1

diff --git a/composer.json b/composer.json
index 886b9cb..5f7af92 100644
--- a/composer.json
+++ b/composer.json
@@ -64,7 +64,8 @@
],
"require": {
"php": ">=5.5.9",
-   "ruflin/elastica": "5.3.0"
+   "ruflin/elastica": "5.3.0",
+   "ext-curl": "*"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I55cb50f2b962b08543ad13f00acef333db43d816
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Elastica
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Add cURL PHP extension to the list of composer requirements

2017-12-19 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399241 )

Change subject: Add cURL PHP extension to the list of composer requirements
..

Add cURL PHP extension to the list of composer requirements

Bug: T166355
Change-Id: If312c65617c23e51a76a611ae0b6dadeb96d892e
---
M composer.json
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/41/399241/1

diff --git a/composer.json b/composer.json
index 7823a83..d2165e9 100644
--- a/composer.json
+++ b/composer.json
@@ -7,7 +7,8 @@
"require": {
"php": ">=5.5.9",
"composer/installers": ">=1.0.1",
-   "wikimedia/textcat": "1.2.0"
+   "wikimedia/textcat": "1.2.0",
+   "ext-curl": "*"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If312c65617c23e51a76a611ae0b6dadeb96d892e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Fail gracefully if curl is not installed

2017-12-17 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398773 )

Change subject: Fail gracefully if curl is not installed
..

Fail gracefully if curl is not installed

Bug: T166355
Change-Id: Iaf4864dc76535efc3ccd09efe1b6c4f9178130c4
---
M includes/Version.php
1 file changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/73/398773/1

diff --git a/includes/Version.php b/includes/Version.php
index c1868cb..457cd35 100644
--- a/includes/Version.php
+++ b/includes/Version.php
@@ -39,6 +39,20 @@
public function get() {
global $wgCirrusSearchClientSideSearchTimeout;
 
+   if ( !function_exists( 'curl_version' ) ) {
+   $phpVersionCheck = new \PHPVersionCheck();
+   $phpVersionCheck->triggerError(
+   null,
+   $phpVersionCheck->getIndexErrorOutput(
+   'Required dependency for CirrusSearch 
is missing',
+   'CirrusSearch extension requires 
cURL in order to operate, but it is not installed on this server.'
+   . ' Please install PHP 
cURL extension.',
+   null
+   ),
+   null, null
+   );
+   }
+
$cache = ObjectCache::getLocalClusterInstance();
$mcKey = $cache->makeKey( 'CirrusSearch', 'Elasticsearch', 
'version' );
$result = $cache->get( $mcKey );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf4864dc76535efc3ccd09efe1b6c4f9178130c4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Using plaintextParams instead of rawParams for newsletter name

2017-12-09 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/396590 )

Change subject: Using plaintextParams instead of rawParams for newsletter name
..

Using plaintextParams instead of rawParams for newsletter name

Bug: T182213
Change-Id: I7d7633b349554eca93e0fee0e75884b2a1ecbd76
---
M includes/specials/SpecialNewsletter.php
1 file changed, 5 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/90/396590/1

diff --git a/includes/specials/SpecialNewsletter.php 
b/includes/specials/SpecialNewsletter.php
index 4c565b4..62bb077 100644
--- a/includes/specials/SpecialNewsletter.php
+++ b/includes/specials/SpecialNewsletter.php
@@ -175,16 +175,6 @@
}
 
/**
-* We need the escaped newsletter name several times so
-* extract the method here.
-*
-* @return string
-*/
-   protected function getEscapedName() {
-   return htmlspecialchars( $this->newsletter->getName() );
-   }
-
-   /**
 * Build the (un)subscribe form for Special:Newsletter/$id/(un)subscribe
 * The actual form showed will be switched depending on whether the 
current
 * user is subscribed or not.
@@ -198,7 +188,7 @@
if ( $this->newsletter->isSubscribed( $this->getUser() ) ) {
// User is subscribed so show the unsubscribe form
$txt = $this->msg( 'newsletter-unsubscribe-text' )
-   ->rawParams( $this->getEscapedName() )->parse();
+   ->plaintextParams( $this->newsletter->getName() 
)->parse();
$button = [
'unsubscribe' => [
'type' => 'submit',
@@ -211,7 +201,7 @@
} else {
// Show the subscribe form if the user is not 
subscribed currently
$txt = $this->msg( 'newsletter-subscribe-text' )
-   ->rawParams( $this->getEscapedName() )->parse();
+   ->plaintextParams( $this->newsletter->getName() 
)->parse();
$button = [
'subscribe' => [
'type' => 'submit',
@@ -257,7 +247,7 @@
// Messages used: 'newsletter-subscribe-success', 
'newsletter-unsubscribe-success'
$this->getOutput()->addHTML(
$this->msg( "newsletter-$action-success" )
-   ->rawParams( $this->getEscapedName() 
)->parse()
+   ->plaintextParams( 
$this->newsletter->getName() )->parse()
);
}
 
@@ -293,7 +283,7 @@
 
$out->setPageTitle(
$this->msg( 'newsletter-announce' )
-   ->rawParams( $this->getEscapedName() )
+   ->plaintextParams( $this->newsletter->getName() 
)
);
 
$fields = [
@@ -327,7 +317,7 @@
// Success!
$out->addHTML(
$this->msg( 'newsletter-announce-success' )
-   ->rawParams( $this->getEscapedName() )
+   ->plaintextParams( 
$this->newsletter->getName() )
->numParams( 
$this->newsletter->getSubscribersCount() )
->parseAsBlock()
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d7633b349554eca93e0fee0e75884b2a1ecbd76
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Cast block start to int in maintenace SQL

2017-12-08 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/396450 )

Change subject: Cast block start to int in maintenace SQL
..

Cast block start to int in maintenace SQL

Bug: T182209
Change-Id: Ic2dbbacdf0a77b8ac531cff8e11be0da8014e083
---
M maintenance/cleanupBlocks.php
M maintenance/migrateUserGroup.php
M maintenance/orphans.php
M maintenance/populateBacklinkNamespace.php
M maintenance/populateIpChanges.php
M maintenance/populateLogSearch.php
M maintenance/populateLogUsertext.php
M maintenance/populateRecentChangesSource.php
M maintenance/populateRevisionSha1.php
M maintenance/rebuildFileCache.php
M maintenance/recountCategories.php
M maintenance/updateRestrictions.php
12 files changed, 19 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/50/396450/1

diff --git a/maintenance/cleanupBlocks.php b/maintenance/cleanupBlocks.php
index 5c5c88f..41d492d 100644
--- a/maintenance/cleanupBlocks.php
+++ b/maintenance/cleanupBlocks.php
@@ -55,8 +55,8 @@
'ipblocks',
[ 'ipb_user' ],
[
-   "ipb_user >= $from",
-   "ipb_user <= $to",
+   "ipb_user >= " . (int)$from,
+   "ipb_user <= " . (int)$to,
],
__METHOD__,
[
@@ -128,8 +128,8 @@
[ 'ipb_id', 'user_name' ],
[
'ipb_user = user_id',
-   "ipb_user >= $from",
-   "ipb_user <= $to",
+   "ipb_user >= " . (int)$from,
+   "ipb_user <= " . (int)$to,
'ipb_address != user_name',
],
__METHOD__
diff --git a/maintenance/migrateUserGroup.php b/maintenance/migrateUserGroup.php
index 81c2353..703d97f 100644
--- a/maintenance/migrateUserGroup.php
+++ b/maintenance/migrateUserGroup.php
@@ -63,7 +63,7 @@
$dbw->update( 'user_groups',
[ 'ug_group' => $newGroup ],
[ 'ug_group' => $oldGroup,
-   "ug_user BETWEEN $blockStart AND 
$blockEnd" ],
+   "ug_user BETWEEN " . (int)$blockStart . 
" AND " . (int)$blockEnd ],
__METHOD__,
[ 'IGNORE' ]
);
@@ -74,7 +74,7 @@
// user/group is UNIQUE.
$dbw->delete( 'user_groups',
[ 'ug_group' => $oldGroup,
-   "ug_user BETWEEN $blockStart AND 
$blockEnd" ],
+   "ug_user BETWEEN " . (int)$blockStart . 
" AND " . (int)$blockEnd ],
__METHOD__
);
$affected += $dbw->affectedRows();
@@ -86,7 +86,7 @@
// were in the new group and not in the group.
$res = $dbw->select( 'user_groups', 'ug_user',
[ 'ug_group' => $newGroup,
-   "ug_user BETWEEN $blockStart 
AND $blockEnd" ],
+   "ug_user BETWEEN " . 
(int)$blockStart . " AND " . (int)$blockEnd ],
__METHOD__
);
if ( $res !== false ) {
diff --git a/maintenance/orphans.php b/maintenance/orphans.php
index 644fb95..8c5c202 100644
--- a/maintenance/orphans.php
+++ b/maintenance/orphans.php
@@ -202,8 +202,8 @@
$result2 = $dbw->query( "
SELECT MAX(rev_timestamp) as max_timestamp
FROM $revision
-   WHERE rev_page=$row->page_id
-   " );
+   WHERE rev_page=" . (int)($row->page_id)
+   );
$row2 = $dbw->fetchObject( $result2 );
if ( $row2 ) {
if ( $row->rev_timestamp != 
$row2->max_timestamp ) {
diff --git a/maintenance/populateBacklinkNamespace.php 
b/maintenance/populateBacklinkNamespace.php
index eb82806..f5f1de6 100644
--- a/maintenance/populateBacklinkNamespace.php
+++ b/maintenance/populateBacklinkNamespace.php
@@ -67,7 +67,7 @@
$blockEnd = $start + $batchSize - 1;
  

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add quotes to comment based strip markers

2017-12-08 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/396392 )

Change subject: Add quotes to comment based strip markers
..

Add quotes to comment based strip markers

Bug: T180159
Change-Id: Ic9dbb8ef3948fe751d16c3963769b616b5db2fc7
---
M includes/parser/LinkHolderArray.php
M includes/parser/Parser.php
2 files changed, 12 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/92/396392/1

diff --git a/includes/parser/LinkHolderArray.php 
b/includes/parser/LinkHolderArray.php
index bc5182c..816f7f7 100644
--- a/includes/parser/LinkHolderArray.php
+++ b/includes/parser/LinkHolderArray.php
@@ -134,7 +134,7 @@
$maxId = $newKey > $maxId ? $newKey : $maxId;
}
}
-   $texts = preg_replace_callback( '/()/',
+   $texts = preg_replace_callback( '/()/',
[ $this, 'mergeForeignCallback' ], $texts );
 
# Renumber interwiki links
@@ -143,7 +143,7 @@
$this->interwikis[$newKey] = $entry;
$maxId = $newKey > $maxId ? $newKey : $maxId;
}
-   $texts = preg_replace_callback( '/()/',
+   $texts = preg_replace_callback( '/()/',
[ $this, 'mergeForeignCallback' ], $texts );
 
# Set the parent link ID to be beyond the highest used ID
@@ -172,7 +172,7 @@
# Internal links
$pos = 0;
while ( $pos < strlen( $text ) ) {
-   if ( !preg_match( '//',
+   if ( !preg_match( '//',
$text, $m, PREG_OFFSET_CAPTURE, $pos )
) {
break;
@@ -186,7 +186,7 @@
# Interwiki links
$pos = 0;
while ( $pos < strlen( $text ) ) {
-   if ( !preg_match( '//', $text, $m, 
PREG_OFFSET_CAPTURE, $pos ) ) {
+   if ( !preg_match( '//', $text, 
$m, PREG_OFFSET_CAPTURE, $pos ) ) {
break;
}
$key = $m[1][0];
@@ -249,12 +249,12 @@
// Use a globally unique ID to keep the objects 
mergable
$key = $this->parent->nextLinkID();
$this->interwikis[$key] = $entry;
-   $retVal = "{$trail}";
+   $retVal = "{$trail}";
} else {
$key = $this->parent->nextLinkID();
$ns = $nt->getNamespace();
$this->internals[$ns][$key] = $entry;
-   $retVal = "{$trail}";
+   $retVal = "{$trail}";
}
$this->size++;
}
@@ -374,7 +374,7 @@
$title = $entry['title'];
$query = isset( $entry['query'] ) ? 
$entry['query'] : [];
$key = "$ns:$index";
-   $searchkey = "";
+   $searchkey = "";
$displayText = $entry['text'];
if ( isset( $entry['selflink'] ) ) {
$replacePairs[$searchkey] = 
Linker::makeSelfLinkObj( $title, $displayText, $query );
@@ -408,7 +408,7 @@
 
# Do the thing
$text = preg_replace_callback(
-   '/()/',
+   '/()/',
$replacer->cb(),
$text
);
@@ -437,7 +437,7 @@
$replacer = new HashtableReplacer( $replacePairs, 1 );
 
$text = preg_replace_callback(
-   '//',
+   '//',
$replacer->cb(),
$text );
}
@@ -612,7 +612,7 @@
 */
public function replaceText( $text ) {
$text = preg_replace_callback(
-   '//',
+   '//',
[ $this, 'replaceTextCallback' ],
$text );
 
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 3548da9..ea58acc 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3944,7 +3944,7 @@
$this->mForceTocPosition = true;
 
# Set a placeholder. At the end we'll fill it in with 
the TOC.
-   $text = $mw->replace( '', $text, 1 );
+   $text = $mw->replace( '', $text, 1 );
 
# Only keep the first 

[MediaWiki-commits] [Gerrit] labs...ZppixBot[master]: Documentation on how to make a module

2017-12-06 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395827 )

Change subject: Documentation on how to make a module
..

Documentation on how to make a module

Change-Id: I9cbf79ba1c417ad88b4b61bcafdfab49a06c76e7
---
M public_html/documentation.html
1 file changed, 98 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ZppixBot 
refs/changes/27/395827/1

diff --git a/public_html/documentation.html b/public_html/documentation.html
index 4a8038b..bf083fb 100644
--- a/public_html/documentation.html
+++ b/public_html/documentation.html
@@ -1,5 +1,10 @@
-List of Commands -ZppixBot
-Commands
+Documentation -ZppixBot
+Table of contents
+
+List of commands
+Module Development
+
+List of commands
 
 
 
@@ -349,4 +354,95 @@
 
 
 
+Module development
+If you decided to extend ZppixBot with some functionality, you will need to 
create a new module.
+This instruction will guide you through the process of custom module 
development
+First of all, create a new file in modules directory with name 
your_module.py
+Bot modules are python scripts, so we shall start with importing required 
libraries (bot is using sopel) for your module to work. Here is the list of 
imports typically used:
+
+from __future__ import unicode_literals, absolute_import, print_function, 
division
+import sopel
+import sopel.module
+import requests
+import sopel.tools
+from sopel.module import rule, priority, thread, commands, example
+
+
 
+Let's define a function, which replies to ".hi" command with a greeting:
+
+@commands('hi')
+def bot_hi(bot, trigger):
+bot.say('Hi ' + trigger.nick + '!')
+
+Explanation: using @commands we specify which command bot should 
react to (in our case ".hi")
+Handler function has two parameters:
+
+bot - bot instance, we use it to interact with chat (i.e. to send 
messages)
+trigger - provides us info about incoming command (text, sender, 
etc)
+
+So in our example, we use bot.say to send message to the chat saying 
"hi, your_name!"
+This is minimum required code for your module to function. You may try running 
it now.
+
+
+Unluckily, our bot will react only to ".hi" messages, but you may want it to 
react to ".hello" and ".hey" as well
+In order to achieve that, we may set multiple command variations bot will 
respond to by specifying all of them in the decorator:
+
+@commands('hi', 'hello', 'hey')
+def bot_hi(bot, trigger):
+bot.say('Hi ' + trigger.nick + '!')
+
+You may try running that code and see that bot will react to all commands 
mentioned by saying "hi" to message sender.
+
+
+Finally, you may want bot to accept some input from user. To demonstrate how 
to achieve that, let's develop a function which will welcome chat newcomers
+For example, if John joins your chat, you may ask bot to welcome him with 
command ".welcome John" and bot will send a message saying "Welcome, John! 
Enjoy yourself in this chat!"
+Similarly, you may ask bot to welcome Bob my saying ".welcome Bob" and bot 
will say "Welcome, Bob! Enjoy yourself in this chat!"
+Let's also use @example decorator to provide command usage example:
+
+@commands('welcome')
+@example('.welcome John')
+def bot_welcome(bot, trigger):
+bot.say('Welcome ' + trigger.group(2) + '! Enjoy yourself in this chat!')
+
+Explanation: we use trigger.group(2) to get the text after the command 
(in our example - name of user to welcome)
+
+
+Additionally, you may use bot.reply, which is similar to 
bot.say, but puts message sender name in the beginning of the message
+To demonstrate that, let's create an "echo" function - it will send back to 
you your message, which will be starting with you name (i.e mention you):
+
+@commands('echo')
+@example('.echo hello world!')
+def bot_welcome(bot, trigger):
+bot.reply('You said: ' + trigger.group(2))
+
+
+
+That was an example of simple module. We recommend you visiting https://github.com/sopel-irc/sopel/wiki;>Sopel Wiki for more info on 
this topic.
+
+
+Complete source code of this example (file simple_module.py):
+
+from __future__ import unicode_literals, absolute_import, print_function, 
division
+import sopel
+import sopel.module
+import requests
+import sopel.tools
+from sopel.module import rule, priority, thread, commands, example
+
+@commands('hi', 'hello', 'hey')
+def bot_hi(bot, trigger):
+bot.say('Hi ' + trigger.nick + '!')
+
+
+commands('welcome')
+@example('.welcome John')
+def bot_welcome(bot, trigger):
+bot.say('Welcome ' + trigger.group(2) + '! Enjoy yourself in this chat!')
+
+
+@commands('echo')
+@example('.echo hello world!')
+def bot_welcome(bot, trigger):
+bot.reply('You said: ' + trigger.group(2))
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9cbf79ba1c417ad88b4b61bcafdfab49a06c76e7
Gerrit-PatchSet: 1

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Fix linewrap issue on wikimedia error page

2017-12-05 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395552 )

Change subject: Fix linewrap issue on wikimedia error page
..

Fix linewrap issue on wikimedia error page

Bug: T180656
Change-Id: I1642539063bb1d20367023729513bc705a2233da
---
M modules/mediawiki/templates/errorpage.html.erb
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/52/395552/1

diff --git a/modules/mediawiki/templates/errorpage.html.erb 
b/modules/mediawiki/templates/errorpage.html.erb
index 83bbd0f..c870bc4 100644
--- a/modules/mediawiki/templates/errorpage.html.erb
+++ b/modules/mediawiki/templates/errorpage.html.erb
@@ -20,6 +20,7 @@
 img { float: left; margin: 0 2em 2em 0; }
 a img { border: 0; }
 h1 { margin-top: 1em; font-size: 1.2em; }
+.content-text { overflow: hidden; }
 p { margin: 0.7em 0 1em 0; }
 a { color: #0645AD; text-decoration: none; }
 a:hover { text-decoration: underline; }
@@ -33,7 +34,7 @@
 
 <% end -%>
 <%= @errorpage['pagetitle'] %>
-<%= @errorpage['content'] %>
+<%= @errorpage['content'] %>
 
 <% if @errorpage['footer'] && @errorpage['footer'] != :undef -%>
 <%= @errorpage['footer'] %>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1642539063bb1d20367023729513bc705a2233da
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Translate[master]: Migrate to BaseTemplateToolbox hook

2017-11-29 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394029 )

Change subject: Migrate to BaseTemplateToolbox hook
..

Migrate to BaseTemplateToolbox hook

Bug: T178699
Change-Id: I463d45fb0d2604259732a7e4fea9e80d4a144b13
---
M Translate.php
M utils/ToolBox.php
2 files changed, 8 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/29/394029/1

diff --git a/Translate.php b/Translate.php
index 34579bf..ec872bd 100644
--- a/Translate.php
+++ b/Translate.php
@@ -134,7 +134,7 @@
 $wgHooks['SpecialRecentChangesPanel'][] = 
'TranslateRcFilter::translationFilterForm';
 $wgHooks['ChangesListSpecialPageStructuredFilters'][] =
'TranslateRcFilter::onChangesListSpecialPageStructuredFilters';
-$wgHooks['SkinTemplateToolboxEnd'][] = 
'TranslateToolbox::toolboxAllTranslations';
+$wgHooks['BaseTemplateToolbox'][] = 'TranslateToolbox::toolboxAllTranslations';
 $wgHooks['AbortEmailNotification'][] = 
'TranslateHooks::onAbortEmailNotificationReview';
 
 // Translation memory related
diff --git a/utils/ToolBox.php b/utils/ToolBox.php
index 3388a65..30c4113 100644
--- a/utils/ToolBox.php
+++ b/utils/ToolBox.php
@@ -22,18 +22,20 @@
 *
 * @return bool
 */
-   public static function toolboxAllTranslations( &$quickTemplate ) {
-   $title = $quickTemplate->getSkin()->getTitle();
+   public static function toolboxAllTranslations( $baseTemplate, &$toolbox 
) {
+   $title = $baseTemplate->getSkin()->getTitle();
$handle = new MessageHandle( $title );
if ( $handle->isValid() ) {
$message = $title->getNsText() . ':' . 
$handle->getKey();
-   $desc = wfMessage( 'translate-sidebar-alltrans' 
)->escaped();
$url = htmlspecialchars( SpecialPage::getTitleFor( 
'Translations' )
->getLocalURL( [ 'message' => $message ] ) );
 
// Add the actual toolbox entry.
-   // Add newlines and tabs for nicer HTML output.
-   echo "\n\t\t\t\t$desc\n";
+   $toolbox[ 'alltrans' ] = array(
+   'href' => $url,
+   'id' => 't-alltrans',
+   'msg' => 'translate-sidebar-alltrans',
+   );
}
 
return true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I463d45fb0d2604259732a7e4fea9e80d4a144b13
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Quiz[master]: Use WMF style colors in graded quizzes

2017-08-07 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370597 )

Change subject: Use WMF style colors in graded quizzes
..

Use WMF style colors in graded quizzes

Bug: T168304
Change-Id: I5bc5cc377b5e8d4421cff3ba4338875139d81e29
---
M modules/ext.quiz.css
1 file changed, 16 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Quiz 
refs/changes/97/370597/1

diff --git a/modules/ext.quiz.css b/modules/ext.quiz.css
index fb14907..5dd02d4 100644
--- a/modules/ext.quiz.css
+++ b/modules/ext.quiz.css
@@ -31,11 +31,11 @@
 }
 
 .quiz .margin.right {
-   background-color: #1ff72d;
+   background-color: #14866d;
 }
 
 .quiz .margin.wrong {
-   background-color: #f74245;
+   background-color: #d33;
 }
 
 .quiz .margin.correction {
@@ -43,11 +43,11 @@
 }
 
 .quiz .margin.NA {
-   background-color: #2834ff;
+   background-color: #36c;
 }
 
 .quiz .margin.error {
-   background-color: #d700d7;
+   background-color: #fc3;
 }
 
 /* This should be based on content direction, not interface direction */
@@ -70,11 +70,11 @@
 }
 
 .quiz .question .border.right {
-   border-color: #1ff72d;
+   border-color: #14866d;
 }
 
 .quiz .question .border.wrong {
-   border-color: #f74245;
+   border-color: #d33;
 }
 
 .quiz .question .border.correction {
@@ -82,21 +82,21 @@
 }
 
 .quiz .question .border.NA {
-   border-color: #2834ff;
+   border-color: #36c;
 }
 
 .quiz .question .border.error {
-   border-color: #d700d7;
+   border-color: #fc3;
 }
 
 .quiz .question .check.right {
-   outline: 3px solid #1ff72d;
-   *border: 3px solid #1ff72d;
+   outline: 3px solid #14866d;
+   *border: 3px solid #14866d;
 }
 
 .quiz .question .check.wrong {
-   outline: 3px solid #f74245;
-   *border: 3px solid #f74245;
+   outline: 3px solid #d33;
+   *border: 3px solid #d33;
 }
 
 .quiz .question .check.correction {
@@ -105,13 +105,13 @@
 }
 
 .quiz .question .check.NA {
-   outline: 3px solid #2834ff;
-   *border: 3px solid #2834ff;
+   outline: 3px solid #36c;
+   *border: 3px solid #36c;
 }
 
 .quiz .question .check.error {
-   outline: 3px solid #d700d7;
-   *border: 3px solid #d700d7;
+   outline: 3px solid #fc3;
+   *border: 3px solid #fc3;
 }
 
 .quiz .header .questionId {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bc5cc377b5e8d4421cff3ba4338875139d81e29
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Quiz
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Fix Newsletter publisher name not showing up correctly on Ma...

2017-07-05 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363358 )

Change subject: Fix Newsletter publisher name not showing up correctly on 
Manage page.
..

Fix Newsletter publisher name not showing up correctly on Manage page.

Bug: T169421
Change-Id: Icd1a1e8c89bee3c3b824a1e264ad0c9c3ea050e2
---
M includes/NewsletterEditPage.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/58/363358/1

diff --git a/includes/NewsletterEditPage.php b/includes/NewsletterEditPage.php
index 9910d52..dc04bbe 100644
--- a/includes/NewsletterEditPage.php
+++ b/includes/NewsletterEditPage.php
@@ -127,7 +127,7 @@
'type' => 'usersmultiselect',
'label-message' => 'newsletter-manage-publishers',
'exists' => true,
-   'default' => $publishersNames,
+   'default' => implode( "\n", $publishersNames ),
];
$fields['Summary'] = [
'type' => 'text',
@@ -371,7 +371,7 @@
$modified = true;
}
 
-   $publisherNames = $data['Publishers'];
+   $publisherNames = explode( "\n", $data['Publishers'] );
// Ask for confirmation before removing all the publishers
if ( !$confirmed && count( $publisherNames ) === 0 ) {
return Status::newFatal( 
'newsletter-manage-no-publishers' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd1a1e8c89bee3c3b824a1e264ad0c9c3ea050e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix Newsletter publisher name not showing up correctly on Ma...

2017-07-05 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363342 )

Change subject: Fix Newsletter publisher name not showing up correctly on 
Manage page.
..

Fix Newsletter publisher name not showing up correctly on Manage page.

Bug: T169421
Change-Id: I8376f90f80aedcb7dd142c9461aebde57e927ff8
---
M includes/htmlform/fields/HTMLUsersMultiselectField.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/42/363342/1

diff --git a/includes/htmlform/fields/HTMLUsersMultiselectField.php 
b/includes/htmlform/fields/HTMLUsersMultiselectField.php
index 286cb8d..c571eb1 100644
--- a/includes/htmlform/fields/HTMLUsersMultiselectField.php
+++ b/includes/htmlform/fields/HTMLUsersMultiselectField.php
@@ -16,7 +16,7 @@
  */
 class HTMLUsersMultiselectField extends HTMLUserTextField {
public function loadDataFromRequest( $request ) {
-   $value = $request->getText( $this->mName, $this->getDefault() );
+   $value = $request->getText( $this->mName, implode( "\n", 
$this->getDefault() ) );
 
$usersArray = explode( "\n", $value );
// Remove empty lines

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8376f90f80aedcb7dd142c9461aebde57e927ff8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Fix AttributeError on Travis

2017-02-04 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335995 )

Change subject: Fix AttributeError on Travis
..

Fix AttributeError on Travis

This reverts commit 829637ffda7525d8aa25d09e8b26a0e1cf079a94.

Bug: T157188
Change-Id: I29e64651af99b2829651373dfd0077aefa02d54b
---
M pywikibot/page.py
M pywikibot/site.py
M tests/wikibase_tests.py
3 files changed, 4 insertions(+), 51 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/95/335995/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index c83e1bd..f015e45 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -12,7 +12,7 @@
 
 """
 #
-# (C) Pywikibot team, 2008-2017
+# (C) Pywikibot team, 2008-2016
 #
 # Distributed under the terms of the MIT license.
 #
@@ -4274,17 +4274,6 @@
 if not hasattr(self, '_type'):
 self._type = self.repo.getPropertyType(self)
 return self._type
-
-@property
-def labels(self):
-"""
-Return labels of this property.
-
-@rtype: dict
-"""
-if not hasattr(self, '_labels'):
-self._labels = self.repo.get_property_labels(self)
-return self._labels
 
 @deprecated("Property.type")
 def getType(self):
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 2cb14f1..2491a54 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -6,7 +6,7 @@
 groups of wikis on the same topic in different languages.
 """
 #
-# (C) Pywikibot team, 2008-2017
+# (C) Pywikibot team, 2008-2016
 #
 # Distributed under the terms of the MIT license.
 #
@@ -7243,30 +7243,6 @@
 dtype = data['entities'][prop.getID()]['datatype']
 except KeyError:
 dtype = data['entities'][prop.getID().lower()]['datatype']
-
-return dtype
-
-def get_property_labels(self, prop):
-"""
-Obtain labels of a property.
-
-Results are cached for 1 day.
-"""
-params = dict(
-action='wbgetentities',
-ids=prop.getID(),
-props='labels',
-)
-expiry = datetime.timedelta(days=1)
-req = self._request(expiry=expiry, parameters=params)
-data = req.submit()
-
-# the IDs returned from the API can be upper or lowercase, depending
-# on the version. See bug T55894 for more information.
-try:
-dtype = data['entities'][prop.getID()]['labels']
-except KeyError:
-dtype = data['entities'][prop.getID().lower()]['labels']
 
 return dtype
 
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index 70aaa22..0aaad45 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 """Tests for the Wikidata parts of the page module."""
 #
-# (C) Pywikibot team, 2008-2017
+# (C) Pywikibot team, 2008-2016
 #
 # Distributed under the terms of the MIT license.
 #
@@ -18,7 +18,7 @@
 import pywikibot
 
 from pywikibot import pagegenerators
-from pywikibot.page import WikibasePage, ItemPage, Property, PropertyPage
+from pywikibot.page import WikibasePage, ItemPage, PropertyPage
 from pywikibot.site import Namespace, NamespacesDict
 from pywikibot.tools import MediaWikiVersion
 
@@ -716,18 +716,6 @@
 self.assertTrue(item.isRedirectPage())
 target = pywikibot.ItemPage(wikidata, 'Q8422626')
 self.assertEqual(item.getRedirectTarget(), target)
-
-
-class TestProperty(WikidataTestCase):
-
-"""Test Property."""
-
-def test_labels(self):
-"""Test retrieving Property labels."""
-wikidata = self.get_repo()
-property = Property(wikidata, 'P625')
-expected = {'language': 'en', 'value': 'coordinate location'}
-self.assertDictEqual(property.labels['en'], expected)
 
 
 class TestPropertyPage(WikidataTestCase):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29e64651af99b2829651373dfd0077aefa02d54b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MultimediaViewer[master]: Fix displaying images with uppercase extension.

2017-01-24 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333998 )

Change subject: Fix displaying images with uppercase extension.
..

Fix displaying images with uppercase extension.

Bug: T154862
Change-Id: Ib74066340a869a49036215a6ea1df39daa17890c
---
M resources/mmv/mmv.js
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer 
refs/changes/98/333998/1

diff --git a/resources/mmv/mmv.js b/resources/mmv/mmv.js
index 9fcef6d..f7b2eee 100644
--- a/resources/mmv/mmv.js
+++ b/resources/mmv/mmv.js
@@ -178,7 +178,7 @@
var imageWidths, canvasDimensions,
viewer = this,
image = this.thumbs[ this.currentIndex ].image,
-   ext = this.thumbs[ this.currentIndex ].title.ext;
+   ext = this.thumbs[ this.currentIndex 
].title.ext.toLowerCase();
 
this.preloadThumbnails();
 
@@ -242,7 +242,7 @@
$initialImage = $( initialImage ),
extraStatsDeferred = $.Deferred();
 
-   pluginsPromise = this.loadExtensionPlugins( 
image.filePageTitle.ext );
+   pluginsPromise = this.loadExtensionPlugins( 
image.filePageTitle.ext.toLowerCase() );
 
this.currentIndex = image.index;
 
@@ -262,7 +262,7 @@
// the aspect ratio
$initialImage.hide();
$initialImage.addClass( 'mw-mmv-placeholder-image' );
-   $initialImage.addClass( image.filePageTitle.ext );
+   $initialImage.addClass( image.filePageTitle.ext.toLowerCase() );
 
this.ui.canvas.set( image, $initialImage );
 
@@ -307,7 +307,7 @@
} );
}
 
-   imageElement.className = 'mw-mmv-final-image ' + 
image.filePageTitle.ext;
+   imageElement.className = 'mw-mmv-final-image ' + 
image.filePageTitle.ext.toLowerCase();
imageElement.alt = image.alt;
 
$.when( metadataPromise, pluginsPromise ).done( 
function ( metadata ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib74066340a869a49036215a6ea1df39daa17890c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MultimediaViewer[master]: Fix displaying of transparent background

2017-01-21 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333474 )

Change subject: Fix displaying of transparent background
..

Fix displaying of transparent background

Fix checker background is not showed after resizing browser window.

Bug: T155913
Change-Id: Icc9236474d595c19566e294967a156865a3a1d31
---
M resources/mmv/mmv.js
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer 
refs/changes/74/333474/1

diff --git a/resources/mmv/mmv.js b/resources/mmv/mmv.js
index 21adca8..9fcef6d 100644
--- a/resources/mmv/mmv.js
+++ b/resources/mmv/mmv.js
@@ -177,7 +177,8 @@
MMVP.resize = function ( ui ) {
var imageWidths, canvasDimensions,
viewer = this,
-   image = this.thumbs[ this.currentIndex ].image;
+   image = this.thumbs[ this.currentIndex ].image,
+   ext = this.thumbs[ this.currentIndex ].title.ext;
 
this.preloadThumbnails();
 
@@ -190,6 +191,7 @@
this.fetchThumbnailForLightboxImage(
image, imageWidths.real
).then( function ( thumbnail, image ) {
+   image.className = ext;
viewer.setImage( ui, thumbnail, image, 
imageWidths );
}, function ( error ) {
viewer.ui.canvas.showError( error );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc9236474d595c19566e294967a156865a3a1d31
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Fix failing tests due to missing apihelp messages.

2017-01-20 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/19 )

Change subject: Fix failing tests due to missing apihelp messages.
..

Fix failing tests due to missing apihelp messages.

Bug: T155055
Change-Id: I5bb7db1be94618820cabbf0c4c89cad64fb27399
---
M Avatars/i18n/en.json
M Avatars/i18n/qqq.json
M ExtendedSearch/api/ApiFeedExtendedSearch.php
M ExtendedSearch/i18n/en.json
M ExtendedSearch/i18n/qqq.json
M PageAssignments/i18n/en.json
M PageAssignments/i18n/qqq.json
M Readers/i18n/en.json
M Readers/i18n/qqq.json
M UserManager/i18n/en.json
M UserManager/i18n/qqq.json
M UserSidebar/api/ApiSidebar.php
M UserSidebar/i18n/en.json
M UserSidebar/i18n/qqq.json
M WantedArticle/i18n/en.json
M WantedArticle/i18n/qqq.json
16 files changed, 82 insertions(+), 36 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/19/19/1

diff --git a/Avatars/i18n/en.json b/Avatars/i18n/en.json
index 02e7f16..1a0a9f7 100644
--- a/Avatars/i18n/en.json
+++ b/Avatars/i18n/en.json
@@ -21,5 +21,6 @@
"bs-avatars-set-userimage-failed": "Not a valid URL or picture from 
wiki.",
"bs-avatars-set-userimage-saved": "The user picture was saved.",
"bs-avatars-file-upload-fieldset-title": "Picture upload",
-   "bs-avatars-auto-generate-fieldset-title": "Auto generate avatar"
+   "bs-avatars-auto-generate-fieldset-title": "Auto generate avatar",
+   "apihelp-bs-avatars-tasks-description": "Uploading, generating and 
setting user avatars"
 }
diff --git a/Avatars/i18n/qqq.json b/Avatars/i18n/qqq.json
index 18d8655..dfbd50f 100644
--- a/Avatars/i18n/qqq.json
+++ b/Avatars/i18n/qqq.json
@@ -21,5 +21,6 @@
"bs-avatars-set-userimage-failed": "Text for not a valid picture from 
wiki or picture URL.",
"bs-avatars-set-userimage-saved": "Text for user picture successfully 
saved.",
"bs-avatars-file-upload-fieldset-title": "Fieldset title for picture 
upload",
-   "bs-avatars-auto-generate-fieldset-title": "Fieldset title auto 
generate avatar"
+   "bs-avatars-auto-generate-fieldset-title": "Fieldset title auto 
generate avatar",
+   "apihelp-bs-avatars-tasks-description": 
"{{doc-apihelp-description|bs-avatars-tasks}}"
 }
diff --git a/ExtendedSearch/api/ApiFeedExtendedSearch.php 
b/ExtendedSearch/api/ApiFeedExtendedSearch.php
index 8a9852f..3e432df 100644
--- a/ExtendedSearch/api/ApiFeedExtendedSearch.php
+++ b/ExtendedSearch/api/ApiFeedExtendedSearch.php
@@ -125,27 +125,25 @@
);
}
 
-   public function getParamDescription() {
-   return array(
-   'q'  => 'Search string',
-   'feedformat' => 'Maximum amount of results to return',
-   'user'   => 'Do nothing if 
$wgEnableOpenSearchSuggest is false',
-   'namespace'  => 'Namespaces to search',
-   'category '  => 'Categories to search',
-   'files'  => 'Whether to search in files'
-   );
-   }
-
-   public function getDescription() {
-   return 'Search the wiki using the OpenSearch protocol';
-   }
-
+   /**
+   * @deprecated since MediaWiki core 1.25
+   */
public function getExamples() {
return array(
'api.php?action=feedextendedsearch=Test=0|2'
);
}
 
+   /**
+   * @see ApiBase::getExamplesMessages()
+   */
+   protected function getExamplesMessages() {
+   return array(
+   'api.php?action=feedextendedsearch=Test=0|2'
+   => 'apihelp-feedextendedsearch-example'
+   );
+   }
+
public function getHelpUrls() {
return 'http://help.blue-spice.org/index.php/ExtendedSearch';
}
diff --git a/ExtendedSearch/i18n/en.json b/ExtendedSearch/i18n/en.json
index 6cbcb0e..bac530b 100644
--- a/ExtendedSearch/i18n/en.json
+++ b/ExtendedSearch/i18n/en.json
@@ -106,5 +106,13 @@
"action-extendedsearch-viewspecialpage":"view the special page 
\"{{int:specialextendedsearch}}\"",
"action-extendedsearchadmin-viewspecialpage":"view the special page 
\"{{int:extendedsearchadmin}}\"",
"extendedsearchadmin": "Extended search administration",
-   "bs-extendedsearch-create-page": "Create page \"$1\"."
+   "bs-extendedsearch-create-page": "Create page \"$1\".",
+   "apihelp-feedextendedsearch-description": "Search the wiki using the 
OpenSearch protocol",
+   "apihelp-feedextendedsearch-param-q": "Search string",
+   "apihelp-feedextendedsearch-param-feedformat": "Maximum amount of 
results to return",
+   "apihelp-feedextendedsearch-param-user": "Do nothing if 
$wgEnableOpenSearchSuggest is false",
+   

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Fix pytest-httpbin support breaking Python 2.6 builds

2017-01-19 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333146 )

Change subject: Fix pytest-httpbin support breaking Python 2.6 builds
..

Fix pytest-httpbin support breaking Python 2.6 builds

Bug: T155208
Change-Id: I482df3e10bd684d35abd9d72435fd48f2f3e0fd7
---
M tests/aspects.py
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/46/333146/1

diff --git a/tests/aspects.py b/tests/aspects.py
index 993f9cd..2a259c0 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -502,7 +502,11 @@
 
 # If pytest_httpbin will be used during tests, then remove httpbin.org 
from sites.
 if httpbin_used:
-cls.sites = {k: v for k, v in cls.sites.items() if 'httpbin.org' 
not in v['hostname']}
+altered_sites = {}
+for k, v in cls.sites.items():
+if 'httpbin.org' not in v['hostname']:
+altered_sites[k] = v
+cls.sites = altered_sites
 
 for key, data in cls.sites.items():
 if 'hostname' not in data:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I482df3e10bd684d35abd9d72435fd48f2f3e0fd7
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Make Wikibase Property provide labels data

2017-01-16 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332384 )

Change subject: Make Wikibase Property provide labels data
..

Make Wikibase Property provide labels data

Change-Id: I139ef7e263343e965a9de12acc8c531b774ce63c
---
M pywikibot/page.py
M pywikibot/site.py
2 files changed, 37 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/84/332384/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 586e907..cb9947a 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -12,7 +12,7 @@
 
 """
 #
-# (C) Pywikibot team, 2008-2016
+# (C) Pywikibot team, 2008-2017
 #
 # Distributed under the terms of the MIT license.
 #
@@ -4275,6 +4275,17 @@
 self._type = self.repo.getPropertyType(self)
 return self._type
 
+@property
+def labels(self):
+"""
+Return labels of this property.
+
+@rtype dict
+"""
+if not hasattr(self, '_labels'):
+self._labels = self.repo.get_property_labels(self)
+return self._labels
+
 @deprecated("Property.type")
 def getType(self):
 """
diff --git a/pywikibot/site.py b/pywikibot/site.py
index f2724d9..d03cd37 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -6,7 +6,7 @@
 groups of wikis on the same topic in different languages.
 """
 #
-# (C) Pywikibot team, 2008-2016
+# (C) Pywikibot team, 2008-2017
 #
 # Distributed under the terms of the MIT license.
 #
@@ -7246,6 +7246,30 @@
 
 return dtype
 
+def get_property_labels(self, prop):
+"""
+Obtain labels of a property.
+
+Results are cached for 1 day
+"""
+params = dict(
+action='wbgetentities',
+ids=prop.getID(),
+props='labels',
+)
+expiry = datetime.timedelta(days=1)
+req = self._request(expiry=expiry, parameters=params)
+data = req.submit()
+
+# the IDs returned from the API can be upper or lowercase, depending
+# on the version. See bug T55894 for more information.
+try:
+dtype = data['entities'][prop.getID()]['labels']
+except KeyError:
+dtype = data['entities'][prop.getID().lower()]['labels']
+
+return dtype
+
 @must_be(group='user')
 def editEntity(self, identification, data, bot=True, **kwargs):
 """

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I139ef7e263343e965a9de12acc8c531b774ce63c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Add DictPatchManager and WikibasePatchManager

2017-01-15 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332189 )

Change subject: Add DictPatchManager and WikibasePatchManager
..

Add DictPatchManager and WikibasePatchManager

Add DictPatchManager (can be used to compare dicts)
and WikibasePatchManager (can be used to compare wikibase entities)

Bug: T66468
Change-Id: I4d5165f8361ddb8007dd237a0a40cfc694e376a6
---
M pywikibot/diff.py
M pywikibot/page.py
M pywikibot/site.py
A pywikibot/wikibase_diff.py
M requirements.txt
M tests/diff_tests.py
A tests/wikibase_diff_tests.py
7 files changed, 1,100 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/89/332189/1

diff --git a/pywikibot/diff.py b/pywikibot/diff.py
index 12fe490..434c878 100644
--- a/pywikibot/diff.py
+++ b/pywikibot/diff.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 """Diff module."""
 #
-# (C) Pywikibot team, 2014-2015
+# (C) Pywikibot team, 2014-2017
 #
 # Distributed under the terms of the MIT license.
 #
@@ -563,6 +563,256 @@
 return l_text
 
 
+class DictHunk(Hunk):
+"""One change (change of one key) between two dictionaries."""
+
+def __init__(self, key, a, b, grouped_opcode):
+"""
+Constructor.
+
+@param key: key of two dictionaries, which is compared.
+@param a: first value.
+@param b: second value.
+@param grouped_opcode: list of 5-tuples describing how to turn a into 
b.
+it has the same format as returned by difflib.get_opcodes().
+"""
+self.key = key
+Hunk.__init__(self, a, b, grouped_opcode)
+self.diff_plain_text = u''.join(self.diff)
+
+def create_diff(self):
+"""Generator of diff text for this hunk, without formatting."""
+for line in Hunk.create_diff(self):
+yield u'%s %s: %s' % (line[0], self.key, line[2:])
+
+def __str__(self):
+"""Return the diff as formatted text."""
+return self.diff_text
+
+
+class DictPatchManager(PatchManager):
+"""Similar to PatchManager, but compares dictionaries instead."""
+
+def __init__(self, dict_a, dict_b):
+"""
+Constructor.
+
+@param dict_a: first dictionary to compare.
+@param dict_b: second dictionary to compare.
+"""
+self.a = dict_a
+self.b = dict_b
+
+self.hunks = []
+
+self.add_dict_hunks(self.a, self.b)
+
+def add_hunk(self, a, b, key, add_quotes=True):
+"""
+Add new hunk to the list of hunks.
+
+@param a: first value.
+@param b: second value.
+@param key: key of the dictionary (used when displaying)
+@param add_quotes: whether to add quotes to string values when 
displaying
+"""
+if isinstance(a, Sequence):
+if add_quotes:
+a = u'"%s"' % a
+else:
+a = a or ''
+a = str(a)
+
+a = a.splitlines(1)
+
+if isinstance(b, Sequence):
+if add_quotes:
+b = u'"%s"' % b
+else:
+b = b or ''
+b = str(b)
+
+b = b.splitlines(1)
+
+s = difflib.SequenceMatcher(None, a, b)
+groups = list(s.get_grouped_opcodes(0))
+if len(groups) > 0:
+hunk = DictHunk(key, a, b, groups[0])
+self.hunks.append(hunk)
+
+def add_dict_hunks(self, a, b, key_prefix=None, key_parts=[], 
sort_keys=True):
+"""
+Compare two dictionaries (recursively).
+
+@param a: first dictionary.
+@param b: second dictionary.
+@param key_prefix: prefix to add to each key (used when displayed).
+@param key_parts: list of keys, indicating location of dictionaries 
relative to the root.
+@param sort_keys: whether to sort keys when creating diff.
+"""
+a = a or {}
+b = b or {}
+
+keys = []
+keys.extend(a.keys())
+for key in b.keys():
+if key not in keys:
+keys.append(key)
+
+if sort_keys:
+keys = sorted(keys)
+
+for key in keys:
+a_value = None
+b_value = None
+
+if key in a:
+a_value = a[key]
+if key in b:
+b_value = b[key]
+
+if key_prefix:
+prefixed_key = '%s.%s' % (key_prefix, key)
+else:
+prefixed_key = key
+
+new_key_parts = key_parts + [key]
+
+if isinstance(a_value, dict) or isinstance(b_value, dict):
+self.add_dict_hunks(a_value, b_value, prefixed_key, 
new_key_parts)
+continue
+
+if isinstance(a_value, list) or isinstance(b_value, list):
+self.add_list_hunks(a_value, b_value, prefixed_key, 
new_key_parts)
+continue
+
+self.add_hunk(a_value, b_value, 

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Added tests for cherry_pick function of diff module

2017-01-10 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331576 )

Change subject: Added tests for cherry_pick function of diff module
..

Added tests for cherry_pick function of diff module

Bug: T130805
Change-Id: I8fc121dc44382a6edfb9990f0442704d0f269f10
---
M tests/diff_tests.py
1 file changed, 63 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/76/331576/1

diff --git a/tests/diff_tests.py b/tests/diff_tests.py
index cbdc76d..de920ed 100644
--- a/tests/diff_tests.py
+++ b/tests/diff_tests.py
@@ -11,7 +11,7 @@
 
 import sys
 
-from pywikibot.diff import html_comparator, PatchManager
+from pywikibot.diff import cherry_pick, html_comparator, PatchManager
 from pywikibot.tools import PY2
 
 from tests import join_html_data_path
@@ -192,6 +192,68 @@
 self.assertEqual(p.hunks[key].diff_plain_text, case[2][key])
 
 
+class TestCherryPick(TestCase):
+
+"""Test cherry_pick method."""
+
+net = False
+
+# texts used during testing
+oldtext = 'old'
+newtext = 'new'
+
+# output messages expected during testing
+diff_message = '\x03{lightred}- old\n\x03{default}\x03{lightgreen}+ 
new\n\x03{default}'
+none_message = '\x03{{lightpurple}}{0: ^50}\x03{{default}}'.format('None.')
+header_base = '\n\x03{{lightpurple}}{0:*^50}\x03{{default}}\n'
+headers = ['  ALL CHANGES  ', '  REVIEW CHANGES  ', '  APPROVED CHANGES  ']
+diff_by_letter_message = ("\x03{lightred}- o\n\x03{default}"
+  "\x03{lightred}- l\n\x03{default}"
+  "\x03{lightred}- d\n\x03{default}"
+  "\x03{lightgreen}+ n\n\x03{default}"
+  "\x03{lightgreen}+ e\n\x03{default}"
+  "\x03{lightgreen}+ w\n\x03{default}")
+
+def check_headers(self, mock):
+"""Check if all headers were added to ouput."""
+for header in self.headers:
+mock.assert_any_call(self.header_base.format(header))
+
+@patch('pywikibot.output')
+@patch('pywikibot.userinterfaces.terminal_interface_base.UI.input', 
return_value='y')
+def test_accept(self, input, mock):
+"""Check output of cherry_pick if changes accepted."""
+self.assertEqual(cherry_pick(self.oldtext, self.newtext), self.newtext)
+self.check_headers(mock)
+mock.assert_any_call(self.diff_message)
+
+@patch('pywikibot.output')
+@patch('pywikibot.userinterfaces.terminal_interface_base.UI.input', 
return_value='n')
+def test_reject(self, input, mock):
+"""Check output of cherry_pick if changes rejected."""
+self.assertEqual(cherry_pick(self.oldtext, self.newtext), self.oldtext)
+self.check_headers(mock)
+mock.assert_any_call(self.diff_message)
+mock.assert_any_call(self.none_message)
+
+@patch('pywikibot.output')
+@patch('pywikibot.userinterfaces.terminal_interface_base.UI.input', 
return_value='q')
+def test_quit(self, input, mock):
+"""Check output of cherry_pick if quitted."""
+self.assertEqual(cherry_pick(self.oldtext, self.newtext), self.oldtext)
+self.check_headers(mock)
+mock.assert_any_call(self.diff_message)
+mock.assert_any_call(self.none_message)
+
+@patch('pywikibot.output')
+@patch('pywikibot.userinterfaces.terminal_interface_base.UI.input', 
return_value='q')
+def test_by_letter(self, input, mock):
+"""Check output of cherry_pick if by_letter diff is enabled."""
+self.assertEqual(cherry_pick(self.oldtext, self.newtext, 
by_letter=True), self.oldtext)
+self.check_headers(mock)
+mock.assert_any_call(self.diff_by_letter_message)
+mock.assert_any_call(self.none_message)
+
 if __name__ == '__main__':  # pragma: no cover
 try:
 unittest.main()

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fc121dc44382a6edfb9990f0442704d0f269f10
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Added intro message to Special:Newsletter, shortened dialog ...

2017-01-09 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331402 )

Change subject: Added intro message to Special:Newsletter, shortened dialog 
messages
..

Added intro message to Special:Newsletter, shortened dialog messages

Intro message is added, which is displayed right under the header.
Dialog messages, which are shown after subscribing/unsubscribing, are
shorter now.

Bug: T154770
Change-Id: I559391b4f7974f69a6d77a62c179b8f374215521
---
M i18n/en.json
M i18n/qqq.json
M includes/specials/SpecialNewsletters.php
3 files changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/02/331402/1

diff --git a/i18n/en.json b/i18n/en.json
index d738e4b..90d5ad5 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -75,13 +75,13 @@
"newsletter-subscribe": "Newsletter subscription management",
"newsletter-subscribe-text": "This interface allows you to subscribe to 
\"$1\" newsletter. If you subscribe, you will receive notifications when new 
issues of this newsletter are announced.",
"newsletter-do-subscribe": "Subscribe to this newsletter",
-   "newsletter-subscribe-success": "You have been subscribed to \"$1\" 
newsletter. You will now receive notifications when new issues of this 
newsletter are announced.",
+   "newsletter-subscribe-success": "You have subscribed to \"$1\".",
"newsletter-subscribe-fail": "Could not subscribe to \"$1\" newsletter 
as you are already subscribed to this newsletter.",
"newsletter-subscribe-error": "Error in subscribing to newsletter.",
"newsletter-subscribe-ip-notallowed": "Please login to subscribe to a 
newsletter.",
"newsletter-unsubscribe-text": "This interface allows you to 
unsubscribe from \"$1\" newsletter. If you unsubscribe, you will stop receiving 
notifications when new issues of this newsletter are announced.",
"newsletter-do-unsubscribe": "Unsubscribe from this newsletter",
-   "newsletter-unsubscribe-success": "You are no longer a subscriber of 
\"$1\" newsletter and you will not receive notifications when new issues of 
this newsletter are announced.",
+   "newsletter-unsubscribe-success": "You are no longer a subscriber of 
\"$1\".",
"newsletter-unsubscribe-fail": "Could not unsubscribe from \"$1\" 
newsletter as you are not currently subscribed to this newsletter.",
"newsletter-unsubscribe-error": "Error in unsubscribing from 
newsletter.",
"newsletter-subscribe-section": "Subscribe newsletters",
@@ -134,6 +134,7 @@
"notification-header-newsletter-announce": "$1 {{GENDER:$2|has 
announced}} a new issue of $3.",
"notification-header-newsletter-newpublisher": "{{GENDER:$2|You}} have 
been {{GENDER:$3|added}} as a publisher of \"$1\" newsletter.",
"notification-body-newsletter-announce": "$1",
+   "newsletter-list-intro": "This is a list of newsletters registered to 
this wiki. Subscribe to a newsletter to receive a notification when a new issue 
is announced. You will receive notifications via web or email, according to 
your [[Special:Preferences#mw-prefsection-echo|preferences]].",
"newsletter-list-table": "Filter by: ",
"newsletter-list-option-all": "All newsletters",
"newsletter-list-option-subscribed": "Newsletters I am subscribed to",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 5923a9c..60d8a17 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -141,6 +141,7 @@
"notification-header-newsletter-announce": "Header text for a 
notification when a new issue of a newsletter is announced. Parameters:\n* $1 
is that user's name (not suitable for GENDER).\n* $2 is the user's name for use 
in GENDER.\n* $3 is the title of the newsletter.",
"notification-header-newsletter-newpublisher": "Notifications header 
message when a user is added as a newsletter publisher. Parameters:\n* $1 - 
name of the newsletter\n* $2 - name of the user viewing the notification, for 
GENDER support\n* $3 - name of the user who added the current user as a 
publisher, for GENDER support",
"notification-body-newsletter-announce": "Body text for a notification 
when a new issue of a newsletter is announced. Parameters:\n* $1 is the summary 
of the new newsletter issue.",
+   "newsletter-list-intro": "Intro message right under the header in 
[[Special:Newsletters]]",
"newsletter-list-table": "Label of the drop down menu in 
[[Special:Newsletters]], the options of which can be used to customize the 
search of newsletters",
"newsletter-list-option-all": "Option of the drop down menu in 
[[Special:Newsletters]] to display all newsletters",
"newsletter-list-option-subscribed": "Option of the drop down menu in 
[[Special:Newsletters]] to display those newsletters to which the logged in 
user is subscribed to",
diff --git 

[MediaWiki-commits] [Gerrit] mediawiki...DeviceMapLogCapture[master]: Fix failing tests due to some apihelp messages missing

2017-01-09 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331311 )

Change subject: Fix failing tests due to some apihelp messages missing
..

Fix failing tests due to some apihelp messages missing

Added 5 messages related to apihelp

Bug: T154602
Change-Id: I60e8b98954da406e65000723942e219aa64f47cb
---
M ApiDeviceMapLogCapture.php
M DeviceMapLogCapture.php
A i18n/en.json
A i18n/qqq.json
4 files changed, 16 insertions(+), 14 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DeviceMapLogCapture 
refs/changes/11/331311/1

diff --git a/ApiDeviceMapLogCapture.php b/ApiDeviceMapLogCapture.php
index b96404c..d1daeea 100644
--- a/ApiDeviceMapLogCapture.php
+++ b/ApiDeviceMapLogCapture.php
@@ -40,20 +40,6 @@
$result->addValue( 'query', $this->getModuleName(), $data );
}
 
-   public function getParamDescription() {
-   return array(
-   'eventid' => 'string of eventID',
-   'token'  => 'unique edit ID for this edit session',
-   'site' => 'the site being used',
-   );
-   }
-
-   public function getDescription() {
-   return array(
-   'Combined with User-Agent and x-wap-profile HTTP 
headers, this provides basic device information that the server can save'
-   );
-   }
-
public function getAllowedParams() {
return array(
'eventid' => array(
diff --git a/DeviceMapLogCapture.php b/DeviceMapLogCapture.php
index e1a6c05..9d4ba82 100644
--- a/DeviceMapLogCapture.php
+++ b/DeviceMapLogCapture.php
@@ -38,3 +38,5 @@
 
 $wgHooks['LoadExtensionSchemaUpdates'][] = 
'DeviceMapLogCaptureHooks::loadExtensionSchemaUpdates';
 $wgAPIModules['devicemaplogcapture'] = 'ApiDeviceMapLogCapture';
+
+$wgMessagesDirs['DeviceMapLogCapture'] = __DIR__ . '/i18n';
diff --git a/i18n/en.json b/i18n/en.json
new file mode 100644
index 000..450f5fb
--- /dev/null
+++ b/i18n/en.json
@@ -0,0 +1,7 @@
+{
+   "apihelp-devicemaplogcapture-description": "Combined with User-Agent 
and x-wap-profile HTTP headers, this provides basic device information that the 
server can save",
+   "apihelp-devicemaplogcapture-param-eventid": "string of eventID",
+   "apihelp-devicemaplogcapture-param-site": "the site being used",
+   "apihelp-devicemaplogcapture-param-token": "unique edit ID for this 
edit session",
+   "apihelp-devicemaplogcapture-param-dmap": "string of device map value"
+}
diff --git a/i18n/qqq.json b/i18n/qqq.json
new file mode 100644
index 000..6a658d7
--- /dev/null
+++ b/i18n/qqq.json
@@ -0,0 +1,7 @@
+{
+   "apihelp-devicemaplogcapture-description": 
"{{doc-apihelp-description|devicemaplogcapture}}",
+   "apihelp-devicemaplogcapture-param-eventid": 
"{{doc-apihelp-param|devicemaplogcapture|eventid}}",
+   "apihelp-devicemaplogcapture-param-site": 
"{{doc-apihelp-param|devicemaplogcapture|site}}",
+   "apihelp-devicemaplogcapture-param-token": 
"{{doc-apihelp-param|devicemaplogcapture|token}}",
+   "apihelp-devicemaplogcapture-param-dmap": 
"{{doc-apihelp-param|devicemaplogcapture|dmap}}"
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60e8b98954da406e65000723942e219aa64f47cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DeviceMapLogCapture
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Annotator[master]: Fix failing tests due to some apihelp messages missing

2017-01-08 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331228 )

Change subject: Fix failing tests due to some apihelp messages missing
..

Fix failing tests due to some apihelp messages missing

Added 10 messages related to apihelp

Bug: T154836
Change-Id: I41c9db2759bb57c65f25bd9a3ad23bd55ccab7cf
---
M i18n/en.json
M i18n/qqq.json
2 files changed, 23 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Annotator 
refs/changes/28/331228/1

diff --git a/i18n/en.json b/i18n/en.json
index bc5299b..b189245 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -5,5 +5,15 @@
]
},
"annotator-desc": "Allows inline comments on pages",
-   "annotator-view-annotations": "View annotations"
-}
\ No newline at end of file
+   "annotator-view-annotations": "View annotations",
+   "apihelp-annotator-create-description": "Create new annotation",
+   "apihelp-annotator-create-param-revid": "Revision ID related to this 
annotation",
+   "apihelp-annotator-read-description": "Find annotation by ID and return 
its data",
+   "apihelp-annotator-read-param-id": "Annotation ID",
+   "apihelp-annotator-search-description": "Find all annotations by 
revision ID they are related to",
+   "apihelp-annotator-search-param-revid": "Revision ID",
+   "apihelp-annotator-update-description": "Update existing annotation 
with new data",
+   "apihelp-annotator-update-param-id": "Annotation ID",
+   "apihelp-annotator-destroy-description": "Delete annotation",
+   "apihelp-annotator-destroy-param-id": "Annotation ID"
+}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 2919ce1..d62527d 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -7,5 +7,15 @@
]
},
"annotator-desc": 
"{{desc|name=Annotator|url=https://www.mediawiki.org/wiki/Extension:Annotator}};,
-   "annotator-view-annotations": "The message shown in the tab which 
allows the user to load annotations on a page"
+   "annotator-view-annotations": "The message shown in the tab which 
allows the user to load annotations on a page",
+   "apihelp-annotator-create-description": 
"{{doc-apihelp-description|annotator-create}}",
+   "apihelp-annotator-create-param-revid": 
"{{doc-apihelp-param|annotator-create|revid}}",
+   "apihelp-annotator-read-description": 
"{{doc-apihelp-description|annotator-read}}",
+   "apihelp-annotator-read-param-id": 
"{{doc-apihelp-param|annotator-read|id}}",
+   "apihelp-annotator-search-description": 
"{{doc-apihelp-description|annotator-search}}",
+   "apihelp-annotator-search-param-revid": 
"{{doc-apihelp-param|annotator-search|revid}}",
+   "apihelp-annotator-update-description": 
"{{doc-apihelp-description|annotator-update}}",
+   "apihelp-annotator-update-param-id": 
"{{doc-apihelp-param|annotator-update|id}}",
+   "apihelp-annotator-destroy-description": 
"{{doc-apihelp-description|annotator-destroy}}",
+   "apihelp-annotator-destroy-param-id": 
"{{doc-apihelp-param|annotator-destroy|id}}"
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41c9db2759bb57c65f25bd9a3ad23bd55ccab7cf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Annotator
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...AjaxLogin[master]: Fix AjaxLogin failing tests due to some messages missing

2017-01-08 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331223 )

Change subject: Fix AjaxLogin failing tests due to some messages missing
..

Fix AjaxLogin failing tests due to some messages missing

Added 7 messages related to apihelp

Bug: T126415
Change-Id: I612fcf1c7efd974a0255574a36521e9612450cac
---
M i18n/en.json
M i18n/qqq.json
2 files changed, 16 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AjaxLogin 
refs/changes/23/331223/1

diff --git a/i18n/en.json b/i18n/en.json
index 64e6657..cc4a06e 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -10,5 +10,12 @@
"ajaxlogin-create": "Create an account",
"al-nosuchuser": "There is no user by the name \"$1\".\nUser names are 
case sensitive.\nCheck your spelling.",
"al-createblocked": "Your IP address is blocked from account creation.",
-   "al-throttled": "You have had too many recent password attempts. Please 
wait $1 {{PLURAL:$1|second|seconds}} before trying again."
+   "al-throttled": "You have had too many recent password attempts. Please 
wait $1 {{PLURAL:$1|second|seconds}} before trying again.",
+   "apihelp-ajaxlogin-description": "Authenticate user or mail password",
+   "apihelp-ajaxlogin-param-Name": "User name",
+   "apihelp-ajaxlogin-param-Password": "User password",
+   "apihelp-ajaxlogin-param-Remember": "Whether to save user token to a 
cookie",
+   "apihelp-ajaxlogin-param-Loginattempt": "If set, then authenticate user 
with provided credentials",
+   "apihelp-ajaxlogin-param-Mailmypassword": "If set, then send password 
reset email to user with provided name",
+   "apihelp-ajaxlogin-param-Token": "Login token to use while 
authenticating user"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 3c3c0d3..165c8b0 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -12,5 +12,12 @@
"ajaxlogin-create": "{{Identical|Create account}}",
"al-nosuchuser": "This message refers to you have no user by that name 
and user names are case sensative.",
"al-createblocked": "This message refers to your ip address is blocked 
from creating an account.",
-   "al-throttled": "This message refers to you have had too many recent 
password attempts."
+   "al-throttled": "This message refers to you have had too many recent 
password attempts.",
+   "apihelp-ajaxlogin-description": 
"{{doc-apihelp-description|ajaxlogin}}",
+   "apihelp-ajaxlogin-param-Name": "{{doc-apihelp-param|ajaxlogin|Name}}",
+   "apihelp-ajaxlogin-param-Password": 
"{{doc-apihelp-param|ajaxlogin|Password}}",
+   "apihelp-ajaxlogin-param-Remember": 
"{{doc-apihelp-param|ajaxlogin|Remember}}",
+   "apihelp-ajaxlogin-param-Loginattempt": 
"{{doc-apihelp-param|ajaxlogin|Loginattempt}}",
+   "apihelp-ajaxlogin-param-Mailmypassword": 
"{{doc-apihelp-param|ajaxlogin|Mailmypassword}}",
+   "apihelp-ajaxlogin-param-Token": "{{doc-apihelp-param|ajaxlogin|Token}}"
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I612fcf1c7efd974a0255574a36521e9612450cac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AjaxLogin
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Use UsersMultiselectWidget to manage publishers list

2017-01-08 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331214 )

Change subject: Use UsersMultiselectWidget to manage publishers list
..

Use UsersMultiselectWidget to manage publishers list

Bug: T131492
Change-Id: I002bd1534ad7c58f627c03711cfb189889b03cdf
---
M i18n/en.json
M i18n/qqq.json
M includes/NewsletterEditPage.php
3 files changed, 6 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/14/331214/1

diff --git a/i18n/en.json b/i18n/en.json
index d738e4b..d10927b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -57,14 +57,13 @@
"newsletter-announce-nonexistent-page": "The provided issue page does 
not exist. Please enter an existing page.",
"newsletter-announce-failure": "A new issue could not be announced. 
Please try again.",
"newsletter-manage": "Manage \"$1\" newsletter",
-   "newsletter-manage-publishers": "Publishers (separated by newline):",
+   "newsletter-manage-publishers": "Publishers:",
"newsletter-manage-name": "Newsletter name:",
"newsletter-manage-title": "Title of Main Page",
"newsletter-manage-description": "Description:",
"newsletter-manage-text": "You can add or remove publishers for \"$1\" 
by modifying the list below.",
"newsletter-managenewsletter-button": "Submit",
"newsletter-manage-no-publishers": "Are you sure that you want to 
remove all the publishers from this newsletter?",
-   "newsletter-manage-invalid-publisher": "\"$1\" is not a valid user. 
Please make sure that you entered valid input and try again.",
"newsletter-manage-remove-self-publisher": "Are you sure that you want 
to remove yourself from the publishers?",
"newsletter-manage-newsletter-success": "The newsletter have been 
modified.",
"newsletter-manage-newsletter-nochanges": "No changes were made to the 
existing newsletter.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 5923a9c..0df2d1b 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -71,7 +71,6 @@
"newsletter-manage-text": "Introductory message shown on 
Special:Newsletter's manage form. $1 - Name of the newsletter",
"newsletter-managenewsletter-button": "Label of submit button on 
Special:Newsletter's manage form\n{{Identical|Submit}}",
"newsletter-manage-no-publishers": "Confirmation message shown on 
Special:Newsletter's manage form if the user attempted to remove all the 
publishers.",
-   "newsletter-manage-invalid-publisher": "Error message shown on 
Special:Newsletter's manage form if an invalid user was entered in the input. 
$1 - Name of invalid user",
"newsletter-manage-remove-self-publisher": "Confirmation message shown 
on Special:Newsletter's manage form if the user removes themselves from the 
publishers' list.",
"newsletter-manage-newsletter-success": "Success message shown on 
Special:Newsletter's manage form when the publishers have been modfied.",
"newsletter-manage-newsletter-nochanges": "Message shown on 
Special:Newsletter if no changes were made to the existing publishers' list.",
diff --git a/includes/NewsletterEditPage.php b/includes/NewsletterEditPage.php
index 569bb07..7a0ad72 100644
--- a/includes/NewsletterEditPage.php
+++ b/includes/NewsletterEditPage.php
@@ -100,10 +100,10 @@
'required' => true,
);
$fields['Publishers'] = array(
-   'type' => 'textarea',
+   'type' => 'usersmultiselect',
'label-message' => 'newsletter-manage-publishers',
-   'rows' => 10,
-   'default' => implode( "\n", $publishersNames ),
+   'users' => $publishersNames,
+   'exists' => true,
);
$fields['Summary'] = array(
'type' => 'text',
@@ -326,25 +326,14 @@
$modified = true;
}
 
-   $publisherNames = explode( "\n", $data['Publishers'] );
-   // Strip whitespace, then remove blank lines and duplicates
-   $publisherNames = array_unique( array_filter( array_map( 
'trim', $publisherNames ) ) );
-
+   $publisherNames = $data['Publishers'];
// Ask for confirmation before removing all the publishers
if ( !$confirmed && count( $publisherNames ) === 0 ) {
return Status::newFatal( 
'newsletter-manage-no-publishers' );
}
 
/** @var User[] $newPublishers */
-   $newPublishers = array();
-   foreach ( $publisherNames as $publisherName ) {
-   $user = User::newFromName( $publisherName );
-   if ( !$user || !$user->getId() ) {
- 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: UsersMultiselect widget and form field.

2017-01-07 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331205 )

Change subject: UsersMultiselect widget and form field.
..

UsersMultiselect widget and form field.

New widget and html form field, which allows selecting multiple
users using convenient single-line input (CapsuleMultiselectWidget)

Bug: T131492
Change-Id: I7b6ffe7fb47e0a7083e2a956156ab0f142444398
---
M autoload.php
M includes/htmlform/HTMLForm.php
A includes/htmlform/fields/HTMLUsersMultiselectField.php
A includes/widget/UsersMultiselectWidget.php
M languages/i18n/en.json
M resources/Resources.php
A resources/src/mediawiki.widgets/mw.widgets.UsersMultiselectWidget.js
7 files changed, 306 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/331205/1

diff --git a/autoload.php b/autoload.php
index c8033cf..6632654 100644
--- a/autoload.php
+++ b/autoload.php
@@ -568,6 +568,7 @@
'HTMLTextFieldWithButton' => __DIR__ . 
'/includes/htmlform/fields/HTMLTextFieldWithButton.php',
'HTMLTitleTextField' => __DIR__ . 
'/includes/htmlform/fields/HTMLTitleTextField.php',
'HTMLUserTextField' => __DIR__ . 
'/includes/htmlform/fields/HTMLUserTextField.php',
+   'HTMLUsersMultiselectField' => __DIR__ . 
'/includes/htmlform/fields/HTMLUsersMultiselectField.php',
'HTTPFileStreamer' => __DIR__ . 
'/includes/libs/filebackend/HTTPFileStreamer.php',
'HWLDFWordAccumulator' => __DIR__ . '/includes/diff/DairikiDiff.php',
'HashBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/HashBagOStuff.php',
@@ -937,6 +938,7 @@
'MediaWiki\\Widget\\Search\\SimpleSearchResultWidget' => __DIR__ . 
'/includes/widget/search/SimpleSearchResultWidget.php',
'MediaWiki\\Widget\\TitleInputWidget' => __DIR__ . 
'/includes/widget/TitleInputWidget.php',
'MediaWiki\\Widget\\UserInputWidget' => __DIR__ . 
'/includes/widget/UserInputWidget.php',
+   'MediaWiki\\Widget\\UsersMultiselectWidget' => __DIR__ . 
'/includes/widget/UsersMultiselectWidget.php',
'MemCachedClientforWiki' => __DIR__ . 
'/includes/compat/MemcachedClientCompat.php',
'MemcLockManager' => __DIR__ . 
'/includes/libs/lockmanager/MemcLockManager.php',
'MemcachedBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/MemcachedBagOStuff.php',
diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php
index 5c5a9a7..ad8c6b4 100644
--- a/includes/htmlform/HTMLForm.php
+++ b/includes/htmlform/HTMLForm.php
@@ -165,6 +165,7 @@
'url' => 'HTMLTextField',
'title' => 'HTMLTitleTextField',
'user' => 'HTMLUserTextField',
+   'usersmultiselect' => 'HTMLUsersMultiselectField',
];
 
public $mFieldData;
diff --git a/includes/htmlform/fields/HTMLUsersMultiselectField.php 
b/includes/htmlform/fields/HTMLUsersMultiselectField.php
new file mode 100644
index 000..d9fc802
--- /dev/null
+++ b/includes/htmlform/fields/HTMLUsersMultiselectField.php
@@ -0,0 +1,98 @@
+ false,
+   'ipallowed' => false,
+   ];
+
+   parent::__construct( $params );
+   }
+
+   public function loadDataFromRequest( $request ) {
+   if ( !$request->getCheck( $this->mName ) ) {
+   return $this->getDefault();
+   }
+
+   return json_decode( $request->getText( $this->mName ) );
+   }
+
+   public function validate( $value, $alldata ) {
+   if ( !$this->mParams['exists'] ) {
+   return true;
+   }
+
+   if ( is_null( $value ) ) {
+   return false;
+   }
+
+   foreach ( $value as $username ) {
+   // check, if a user exists with the given username
+   $user = User::newFromName( $username, false );
+
+   if ( !$user ) {
+   return $this->msg( 'htmlform-user-not-valid', 
$value );
+   } elseif (
+   $user->getId() === 0 && !( 
$this->mParams['ipallowed'] && User::isIP( $value ) )
+   ) {
+   return $this->msg( 'htmlform-user-not-exists', 
$user->getName() );
+   }
+   }
+
+   return true;
+   }
+
+   public function getInputHTML( $values ) {
+   return $this->getInputOOUI( $values );
+   }
+
+   public function getInputOOUI( $values ) {
+   $params = [ 'name' => $this->mName ];
+
+   if ( isset( $this->mParams['users'] ) ) {
+   $params['users'] = $this->mParams['users'];
+   }
+
+   if ( isset( $this->mParams['placeholder'] ) ) {
+   $params['placeholder'] = $this->mParams['placeholder'];
+   

[MediaWiki-commits] [Gerrit] mediawiki...Quiz[master]: Fix bug with grading when several quizes on page.

2017-01-04 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330620 )

Change subject: Fix bug with grading when several quizes on page.
..

Fix bug with grading when several quizes on page.

Fixed bug, that clicking submit button on a single quiz graded all
quizes on the page.

Bug: T152398
Change-Id: I31365873574a9fb8c72dba58c882197904adab0d
---
M extension.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Quiz 
refs/changes/20/330620/1

diff --git a/extension.json b/extension.json
index 47bf181..e8b52e5 100644
--- a/extension.json
+++ b/extension.json
@@ -31,7 +31,7 @@
"ParserFirstCallInit": [
"QuizHooks::onParserFirstCallInit"
],
-   "ParserClearState": [
+   "ParserAfterTidy": [
"Quiz::resetQuizID"
]
},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I31365873574a9fb8c72dba58c882197904adab0d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Quiz
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Fix HttpServerProblemTestCase.test_502 failing

2017-01-03 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330281 )

Change subject: Fix HttpServerProblemTestCase.test_502 failing
..

Fix HttpServerProblemTestCase.test_502 failing

HttpbinTestCase class moved to aspects.py, pytest_httpbin is now used
instead of httpbin.org site only if test case inherits HttpbinTestCase

Bug: T154452
Change-Id: Ica26594a553de2e4555ffba56056141a56c3c6c5
---
M tests/aspects.py
M tests/http_tests.py
2 files changed, 55 insertions(+), 59 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/81/330281/1

diff --git a/tests/aspects.py b/tests/aspects.py
index 305c4be..813ba08 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -29,7 +29,6 @@
 UITestCase:
 Not integrated; direct subclass of unittest.TestCase.
 """
-import imp
 import inspect
 import itertools
 import os
@@ -60,6 +59,16 @@
 add_metaclass, execute_pwb, DrySite, DryRequest,
 WarningSourceSkipContextManager, AssertAPIErrorContextManager,
 )
+
+try:
+import pytest_httpbin
+optional_pytest_httpbin_cls_decorator = 
pytest_httpbin.use_class_based_httpbin
+except ImportError:
+pytest_httpbin = None
+
+def optional_pytest_httpbin_cls_decorator(f):
+"""Empty decorator in case pytest_httpbin is not installed."""
+return f
 
 OSWIN32 = (sys.platform == 'win32')
 
@@ -484,13 +493,10 @@
 if not hasattr(cls, 'sites'):
 return
 
-# Check is pytest is used and pytest_httpbin module is installed.
-if hasattr(sys, '_test_runner_pytest'):
-try:
-imp.find_module('pytest_httpbin')
-httpbin_used = True
-except ImportError:
-httpbin_used = False
+if issubclass(cls, HttpbinTestCase):
+# If test uses httpbin, then check is pytest test runner is used
+# and pytest_httpbin module is installed.
+httpbin_used = hasattr(sys, '_test_runner_pytest') and 
pytest_httpbin
 else:
 httpbin_used = False
 
@@ -1658,3 +1664,43 @@
 CapturingTestCase.process_assert,
 CapturingTestCase.patch_assert,
 ]
+
+
+@optional_pytest_httpbin_cls_decorator
+class HttpbinTestCase(TestCase):
+
+"""
+Custom test case class, which allows doing dry httpbin tests using 
pytest-httpbin.
+
+Test cases, which use httpbin, need to inherit this class.
+"""
+
+sites = {
+'httpbin': {
+'hostname': 'httpbin.org',
+},
+}
+
+def get_httpbin_url(self, path=''):
+"""
+Return url of httpbin.
+
+If pytest is used, returns url of local httpbin server.
+Otherwise, returns: http://httpbin.org
+"""
+if hasattr(self, 'httpbin'):
+return self.httpbin.url + path
+else:
+return 'http://httpbin.org' + path
+
+def get_httpbin_hostname(self):
+"""
+Return httpbin hostname.
+
+If pytest is used, returns hostname of local httpbin server.
+Otherwise, returns: httpbin.org
+"""
+if hasattr(self, 'httpbin'):
+return '{0}:{1}'.format(self.httpbin.host, self.httpbin.port)
+else:
+return 'httpbin.org'
diff --git a/tests/http_tests.py b/tests/http_tests.py
index 72db94c..f41f930 100644
--- a/tests/http_tests.py
+++ b/tests/http_tests.py
@@ -25,57 +25,7 @@
 )
 
 from tests import join_images_path
-from tests.aspects import unittest, TestCase, DeprecationTestCase, 
require_modules
-
-try:
-import pytest_httpbin
-optional_pytest_httpbin_cls_decorator = 
pytest_httpbin.use_class_based_httpbin
-except ImportError:
-pytest_httpbin = None
-
-def optional_pytest_httpbin_cls_decorator(f):
-"""Empty decorator in case pytest_httpbin is not installed."""
-return f
-
-
-@optional_pytest_httpbin_cls_decorator
-class HttpbinTestCase(TestCase):
-
-"""
-Custom test case class, which allows doing dry httpbin tests using 
pytest-httpbin.
-
-Test cases, which use httpbin, need to inherit this class.
-"""
-
-sites = {
-'httpbin': {
-'hostname': 'httpbin.org',
-},
-}
-
-def get_httpbin_url(self, path=''):
-"""
-Return url of httpbin.
-
-If pytest is used, returns url of local httpbin server.
-Otherwise, returns: http://httpbin.org
-"""
-if hasattr(self, 'httpbin'):
-return self.httpbin.url + path
-else:
-return 'http://httpbin.org' + path
-
-def get_httpbin_hostname(self):
-"""
-Return httpbin hostname.
-
-If pytest is used, returns hostname of local httpbin server.
-Otherwise, returns: httpbin.org
-"""
-if hasattr(self, 'httpbin'):
-return '{0}:{1}'.format(self.httpbin.host, self.httpbin.port)
-else:

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Fix broken LDAP based login

2017-01-02 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330144 )

Change subject: Fix broken LDAP based login
..

Fix broken LDAP based login

Fixed that LDAP based login failed, if wiki used two or more
domains.

Bug: T90149
Change-Id: I819137c4592cf43608904a4d30a981d965dee1c3
---
M pywikibot/data/api.py
1 file changed, 8 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/44/330144/1

diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 3b2ae9d..cf635b0 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -3028,11 +3028,14 @@
 time.sleep(diff.seconds)
 
 # base login request
-login_request = self.site._request(
-use_get=False,
-parameters=dict(action='login',
-lgname=self.login_name,
-lgpassword=self.password))
+predata = dict(action='login',
+   lgname=self.login_name,
+   lgpassword=self.password)
+
+if self.site.family.ldapDomain:
+predata['lgdomain'] = self.site.family.ldapDomain
+
+login_request = self.site._request(use_get=False, parameters=predata)
 
 # get token using meta=tokens if supported
 if MediaWikiVersion(self.site.version()) >= MediaWikiVersion('1.27'):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I819137c4592cf43608904a4d30a981d965dee1c3
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Using pytest-httpbin

2016-12-29 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329644 )

Change subject: Using pytest-httpbin
..

Using pytest-httpbin

Now http_tests use pytest-httpbin if pytest is used to run the tests
Otherwise, http://httpbin.org is used

Bug: T153560
Change-Id: I2000fed5e5273dbfef5d51ac81698a32c7fc5676
---
M dev-requirements.txt
M tests/http_tests.py
2 files changed, 39 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/44/329644/1

diff --git a/dev-requirements.txt b/dev-requirements.txt
index edd5005..44a3038 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -7,6 +7,7 @@
 pytest-runner
 pytest-cov
 pytest-attrib
+pytest-httpbin
 
 six
 
diff --git a/tests/http_tests.py b/tests/http_tests.py
index e62b390..c059a45 100644
--- a/tests/http_tests.py
+++ b/tests/http_tests.py
@@ -27,6 +27,7 @@
 from tests import join_images_path
 from tests.aspects import unittest, TestCase, DeprecationTestCase, 
require_modules
 
+import pytest, pytest_httpbin
 
 class HttpTestCase(TestCase):
 
@@ -157,6 +158,7 @@
  'InsecureRequestWarning')
 
 
+@pytest_httpbin.use_class_based_httpbin
 class TestHttpStatus(TestCase):
 
 """Test HTTP status code handling and errors."""
@@ -175,9 +177,14 @@
 
 def test_http_504(self):
 """Test that a HTTP 504 raises the correct exception."""
+if hasattr(self, 'httpbin'):
+httpbinUrl = self.httpbin.url
+else:
+httpbinUrl = 'http://httpbin.org'
+
 self.assertRaises(pywikibot.Server504Error,
   http.fetch,
-  uri='http://httpbin.org/status/504')
+  uri=httpbinUrl + '/status/504')
 
 def test_server_not_found(self):
 """Test server not found exception."""
@@ -316,6 +323,7 @@
 self._test_fake_user_agent_randomness()
 
 
+@pytest_httpbin.use_class_based_httpbin
 class LiveFakeUserAgentTestCase(TestCase):
 
 """Test the usage of fake user agent."""
@@ -338,24 +346,29 @@
 
 def _test_fetch_use_fake_user_agent(self):
 """Test `use_fake_user_agent` argument of http.fetch."""
+if hasattr(self, 'httpbin'):
+httpbinUrl = self.httpbin.url
+else:
+httpbinUrl = 'http://httpbin.org'
+
 # Existing headers
 r = http.fetch(
-'http://httpbin.org/status/200', headers={'user-agent': 
'EXISTING'})
+httpbinUrl + '/status/200', headers={'user-agent': 'EXISTING'})
 self.assertEqual(r.headers['user-agent'], 'EXISTING')
 
 # Argument value changes
-r = http.fetch('http://httpbin.org/status/200', 
use_fake_user_agent=True)
+r = http.fetch(httpbinUrl + '/status/200', use_fake_user_agent=True)
 self.assertNotEqual(r.headers['user-agent'], http.user_agent())
-r = http.fetch('http://httpbin.org/status/200', 
use_fake_user_agent=False)
+r = http.fetch(httpbinUrl + '/status/200', use_fake_user_agent=False)
 self.assertEqual(r.headers['user-agent'], http.user_agent())
 r = http.fetch(
-'http://httpbin.org/status/200', use_fake_user_agent='ARBITRARY')
+httpbinUrl + '/status/200', use_fake_user_agent='ARBITRARY')
 self.assertEqual(r.headers['user-agent'], 'ARBITRARY')
 
 # Manually overridden domains
-config.fake_user_agent_exceptions = {'httpbin.org': 'OVERRIDDEN'}
+config.fake_user_agent_exceptions = {httpbinUrl[7:]: 'OVERRIDDEN'}
 r = http.fetch(
-'http://httpbin.org/status/200', use_fake_user_agent=False)
+httpbinUrl + '/status/200', use_fake_user_agent=False)
 self.assertEqual(r.headers['user-agent'], 'OVERRIDDEN')
 
 @require_modules('browseragents')
@@ -561,6 +574,7 @@
 self.assertIs(main_module_cookie_jar, http.cookie_jar)
 
 
+@pytest_httpbin.use_class_based_httpbin
 class QueryStringParamsTestCase(TestCase):
 
 """
@@ -576,9 +590,15 @@
 },
 }
 
+def getHttpbinUrl(self):
+if hasattr(self, 'httpbin'):
+return self.httpbin.url
+else:
+return 'https://httpbin.org'
+
 def test_no_params(self):
 """Test fetch method with no parameters."""
-r = http.fetch(uri='https://httpbin.org/get', params={})
+r = http.fetch(uri=self.getHttpbinUrl() + '/get', params={})
 self.assertEqual(r.status, 200)
 
 content = json.loads(r.content)
@@ -591,7 +611,7 @@
 HTTPBin returns the args in their urldecoded form, so what we put in 
should be
 the same as what we get out.
 """
-r = http.fetch(uri='https://httpbin.org/get', params={'fish': 
'delicious'})
+r = http.fetch(uri=self.getHttpbinUrl() + '/get', 
params={'fish': 'delicious'})
 self.assertEqual(r.status, 200)
 
 content = 

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Port table2wiki to core

2016-12-28 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329503 )

Change subject: Port table2wiki to core
..

Port table2wiki to core

Script table2wiki is ported from compat to core

Bug: T115104
Change-Id: I6aee53160d9b0f1d1e98cf780fe641752ae2f057
---
A scripts/table2wiki.py
1 file changed, 586 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/03/329503/1

diff --git a/scripts/table2wiki.py b/scripts/table2wiki.py
new file mode 100644
index 000..f776feb
--- /dev/null
+++ b/scripts/table2wiki.py
@@ -0,0 +1,586 @@
+#!/usr/bin/python
+# -*- coding: utf-8  -*-
+"""
+Nifty script to convert HTML-tables to MediaWiki's own syntax.
+
+These command line parameters can be used to specify which pages to work on:
+
+
+
+-xml  Retrieve information from a local XML dump (pages_current, 
see
+  http://download.wikimedia.org).
+  Argument can also be given as "-xml:filename".
+  Searches for pages with HTML tables, and tries to convert 
them
+  on the live wiki.
+
+-sql  Retrieve information from a local mirror.
+  Searches for pages with HTML tables, and tries to convert 
them
+  on the live wiki.
+
+-namespace:n  Number or name of namespace to process. The parameter can be
+  used multiple times. It works in combination with all other
+  parameters, except for the -start parameter. If you e.g.
+  want to iterate over all categories starting at M, use
+  -start:Category:M.
+
+This SQL query can be used to find pages to work on:
+
+  SELECT CONCAT('[[', cur_title, ']]')
+  FROM cur
+  WHERE (cur_text LIKE '%
+# (C) Pywikibot team, 2003-2013
+#
+# Distributed under the terms of the MIT license.
+#
+# Automatically ported from compat branch by compat2core.py script
+#
+__version__ = '$Id$'
+#
+
+import re
+
+import pywikibot
+from pywikibot import i18n
+from pywikibot import config
+from pywikibot import pagegenerators
+
+# This is required for the text that is shown when you run this script
+# with the parameter -help.
+docuReplacements = {
+'': pagegenerators.parameterHelp,
+}
+
+
+class TableXmlDumpPageGenerator:
+'''
+A page generator that will yield all pages that seem to contain an HTML
+table.
+'''
+def __init__(self, xmlfilename):
+import xmlreader
+self.xmldump = xmlreader.XmlDump(xmlfilename)
+
+def __iter__(self):
+tableTagR = re.compile('

[MediaWiki-commits] [Gerrit] mediawiki...Quiz[master]: Update outdated libraries

2016-12-27 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329366 )

Change subject: Update outdated libraries
..

Update outdated libraries

Change-Id: I39ff5685efb3a8baa527117aa2f1859e4cfdbc62
T: T146021
---
M package.json
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Quiz 
refs/changes/66/329366/1

diff --git a/package.json b/package.json
index 335401b..6308cb3 100644
--- a/package.json
+++ b/package.json
@@ -4,10 +4,10 @@
 "test": "grunt test"
   },
   "devDependencies": {
-"grunt": "0.4.5",
-"grunt-cli": "0.1.13",
-"grunt-banana-checker": "0.4.0",
-"grunt-contrib-jshint": "0.11.3",
-"grunt-jsonlint": "1.0.7"
+"grunt": "1.0.1",
+"grunt-cli": "1.2.0",
+"grunt-banana-checker": "0.5.0",
+"grunt-contrib-jshint": "1.1.0",
+"grunt-jsonlint": "1.1.0"
   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I39ff5685efb3a8baa527117aa2f1859e4cfdbc62
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Quiz
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Translate[master]: Use HTML tags as insertables for MediaWiki messages

2016-12-25 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329134 )

Change subject: Use HTML tags as insertables for MediaWiki messages
..

Use HTML tags as insertables for MediaWiki messages

Bug: T106632
Change-Id: I1abb3b1128ae8768cab48042dcb1657326776cde
---
M insertables/MediaWikiInsertablesSuggester.php
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/34/329134/1

diff --git a/insertables/MediaWikiInsertablesSuggester.php 
b/insertables/MediaWikiInsertablesSuggester.php
index f4a9cbf..ca49c0a 100644
--- a/insertables/MediaWikiInsertablesSuggester.php
+++ b/insertables/MediaWikiInsertablesSuggester.php
@@ -33,6 +33,13 @@
}, $matches );
$insertables = array_merge( $insertables, $new );
 
+   $matches = array();
+   preg_match_all( '/<\/?[a-z]+>/', $text, $matches, 
PREG_SET_ORDER );
+   $new = array_map( function( $match ) {
+   return new Insertable( $match[0], $match[0] );
+   }, $matches );
+   $insertables = array_merge( $insertables, $new );
+
return $insertables;
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1abb3b1128ae8768cab48042dcb1657326776cde
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix rendering issues on RecentChanges Special page

2016-12-24 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329117 )

Change subject: Fix rendering issues on RecentChanges Special page
..

Fix rendering issues on RecentChanges Special page

Legend is rendered correctly now, fixed namespace checkboxes
behaviour, fixed styles of the changes list.

Bug: T112693
Change-Id: If2c5701587eee50a6d578459f6b38b6f16cd5fe9
---
M resources/Resources.php
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/17/329117/1

diff --git a/resources/Resources.php b/resources/Resources.php
index e8be528..ae95c78 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1849,9 +1849,11 @@
],
'mediawiki.special.changeslist' => [
'styles' => 
'resources/src/mediawiki.special/mediawiki.special.changeslist.css',
+   'targets' => [ 'desktop', 'mobile' ],
],
'mediawiki.special.changeslist.legend' => [
'styles' => 
'resources/src/mediawiki.special/mediawiki.special.changeslist.legend.css',
+   'targets' => [ 'desktop', 'mobile' ],
],
'mediawiki.special.changeslist.legend.js' => [
'scripts' => 
'resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js',
@@ -1859,6 +1861,7 @@
'jquery.makeCollapsible',
'mediawiki.cookie',
],
+   'targets' => [ 'desktop', 'mobile' ],
],
'mediawiki.special.changeslist.enhanced' => [
'styles' => 
'resources/src/mediawiki.special/mediawiki.special.changeslist.enhanced.css',
@@ -1929,6 +1932,7 @@
],
'mediawiki.special.recentchanges' => [
'scripts' => 
'resources/src/mediawiki.special/mediawiki.special.recentchanges.js',
+   'targets' => [ 'desktop', 'mobile' ],
],
'mediawiki.special.search' => [
'scripts' => 
'resources/src/mediawiki.special/mediawiki.special.search.js',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2c5701587eee50a6d578459f6b38b6f16cd5fe9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/aqs[master]: Monthly request stats per article title

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

Change subject: Monthly request stats per article title
..

Monthly request stats per article title

Added possibility to query monthly page view stats via an API

Bug: T139934
Change-Id: I0ee23cbddd2c04c5690ca26dc01c43ae649e518a
---
M sys/pageviews.js
M test/features/pageviews/pageviews.js
M v1/pageviews.yaml
3 files changed, 79 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aqs 
refs/changes/45/326545/1

diff --git a/sys/pageviews.js b/sys/pageviews.js
index 9c37a4a..2a9679a 100644
--- a/sys/pageviews.js
+++ b/sys/pageviews.js
@@ -134,6 +134,12 @@
 // which was originally planned at hourly resolution, so we pass "fakeHour"
 aqsUtil.validateStartAndEnd(rp, { fakeHour: true, zeroHour: true });
 
+var dataRequestGranularity = rp.granularity;
+if (dataRequestGranularity === 'monthly') {
+// We will request data for each day of the month
+dataRequestGranularity = 'daily';
+}
+
 var dataRequest = hyper.get({
 uri: tableURI(rp.domain, tables.articleFlat),
 body: {
@@ -141,7 +147,7 @@
 attributes: {
 project: rp.project,
 article: rp.article.replace(/ /g, '_'),
-granularity: rp.granularity,
+granularity: dataRequestGranularity,
 timestamp: { between: [rp.start, rp.end] },
 }
 }
@@ -159,22 +165,66 @@
 });
 }
 
-return dataRequest.then(aqsUtil.normalizeResponse).then(function(res) {
-if (res.body.items) {
-res.body.items.forEach(function(item) {
-item.access = rp.access;
-item.agent = rp.agent;
-item.views = item[viewKey(rp.access, rp.agent)];
-// map null to zero for view counts, we store null in 
cassandra for efficiency
-if (item.views === null) {
-item.views = 0;
-}
-removeDenormalizedColumns(item);
-});
-}
+var normalizedResponse = dataRequest.then(aqsUtil.normalizeResponse);
 
-return res;
-});
+if (rp.granularity === 'monthly') {
+return normalizedResponse.then(function(res) {
+if (res.body.items) {
+var monthViews = {};
+
+res.body.items.forEach(function(item) {
+var yearAndMonth = item.timestamp.substring(0, 6);
+var views = item[viewKey(rp.access, rp.agent)];
+
+// map null to zero for view counts, we store null in 
cassandra for efficiency
+if (views === null) {
+views = 0;
+}
+
+if (!monthViews.hasOwnProperty(yearAndMonth)) {
+var newMonth = {
+project: item.project,
+article: item.article,
+granularity: 'monthly',
+access: rp.access,
+agent: rp.agent,
+views: 0
+};
+
+monthViews[yearAndMonth] = newMonth;
+}
+
+monthViews[yearAndMonth].views += views;
+});
+
+res.body.items = [];
+for (var month in monthViews) {
+res.body.items.push(monthViews[month]);
+}
+res.body.count = res.body.items.length;
+}
+
+return res;
+});
+} else {
+return normalizedResponse.then(function(res) {
+if (res.body.items) {
+res.body.items.forEach(function(item) {
+item.access = rp.access;
+item.agent = rp.agent;
+item.views = item[viewKey(rp.access, rp.agent)];
+// map null to zero for view counts, we store null in 
cassandra for efficiency
+if (item.views === null) {
+item.views = 0;
+}
+removeDenormalizedColumns(item);
+});
+}
+
+return res;
+});
+}
+
 };
 
 PJVS.prototype.pageviewsForProjects = function(hyper, req) {
diff --git a/test/features/pageviews/pageviews.js 
b/test/features/pageviews/pageviews.js
index 72a1f7f..7112dde 100644
--- a/test/features/pageviews/pageviews.js
+++ b/test/features/pageviews/pageviews.js
@@ -16,6 +16,7 @@
 // it doesn't know about the /metrics root like the prod config does
 var articleEndpoint = 
'/pageviews/per-article/en.wikipedia/desktop/spider/one/daily/20150701/20150703';
 var articleEndpointMobile = 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix links problem on Special:Search

2016-12-09 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326176 )

Change subject: Fix links problem on Special:Search
..

Fix links problem on Special:Search

Fix bug that most links on Special:Search did not have text rendered
Also restore some changes from commit f736c3709a54be33f808e8d12f85707b90763165
where Linker::link() usage was replaced by LinkRenderer

This reverts commit 791d5319bff0be23c3ea474a84d42ed788355688

Change-Id: Id25d1b1acd0dcafc47511b2db3782e5d441f3731
---
M includes/specials/SpecialRecentchanges.php
M includes/specials/SpecialRevisiondelete.php
M includes/specials/SpecialSearch.php
M includes/specials/SpecialUncategorizedcategories.php
M includes/specials/SpecialUnwatchedpages.php
M includes/specials/SpecialWhatlinkshere.php
6 files changed, 78 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/76/326176/1

diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index 2a93159..8530eb1 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -665,12 +665,11 @@
}
unset( $value );
 
-   $text = htmlspecialchars( $title );
if ( $active ) {
-   $text = '' . $text . '';
+   $title = new HtmlArmor( '' . htmlspecialchars( 
$title ) . '' );
}
 
-   return Linker::linkKnown( $this->getPageTitle(), $text, [], 
$params );
+   return $this->getLinkRenderer()->makeKnownLink( 
$this->getPageTitle(), $title, [], $params );
}
 
/**
diff --git a/includes/specials/SpecialRevisiondelete.php 
b/includes/specials/SpecialRevisiondelete.php
index 8780c56..4b0fa00 100644
--- a/includes/specials/SpecialRevisiondelete.php
+++ b/includes/specials/SpecialRevisiondelete.php
@@ -466,9 +466,9 @@
Xml::closeElement( 'form' ) . "\n";
// Show link to edit the dropdown reasons
if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
-   $link = Linker::linkKnown(
+   $link = $this->getLinkRenderer()->makeKnownLink(
$this->msg( 'revdelete-reason-dropdown' 
)->inContentLanguage()->getTitle(),
-   $this->msg( 'revdelete-edit-reasonlist' 
)->escaped(),
+   $this->msg( 'revdelete-edit-reasonlist' 
)->text(),
[],
[ 'action' => 'edit' ]
);
diff --git a/includes/specials/SpecialSearch.php 
b/includes/specials/SpecialSearch.php
index 9f83832..727179a 100644
--- a/includes/specials/SpecialSearch.php
+++ b/includes/specials/SpecialSearch.php
@@ -499,9 +499,16 @@
}
$stParams = array_merge( $params, $this->powerSearchOptions() );
 
-   $suggest = Linker::linkKnown(
+   $linkRenderer = $this->getLinkRenderer();
+
+   $snippet = $textMatches->getSuggestionSnippet() ?: null;
+   if ( $snippet !== null ) {
+   $snippet = new HtmlArmor( $snippet );
+   }
+
+   $suggest = $linkRenderer->makeKnownLink(
$this->getPageTitle(),
-   $textMatches->getSuggestionSnippet() ?: null,
+   $snippet,
[ 'id' => 'mw-search-DYM-suggestion' ],
$stParams
);
@@ -535,18 +542,25 @@
}
$stParams = array_merge( $params, $this->powerSearchOptions() );
 
-   $rewritten = Linker::linkKnown(
+   $linkRenderer = $this->getLinkRenderer();
+
+   $snippet = $textMatches->getQueryAfterRewriteSnippet() ?: null;
+   if ( $snippet !== null ) {
+   $snippet = new HtmlArmor( $snippet );
+   }
+
+   $rewritten = $linkRenderer->makeKnownLink(
$this->getPageTitle(),
-   $textMatches->getQueryAfterRewriteSnippet() ?: null,
+   $snippet,
[ 'id' => 'mw-search-DYM-rewritten' ],
$stParams
);
 
$stParams['search'] = $term;
$stParams['runsuggestion'] = 0;
-   $original = Linker::linkKnown(
+   $original = $linkRenderer->makeKnownLink(
$this->getPageTitle(),
-   htmlspecialchars( $term ),
+   $term,
[ 'id' => 'mw-search-DYM-original' ],
$stParams
);
@@ -766,7 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Replace Linker::link() usage with LinkRendedrer

2016-12-05 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/325339

Change subject: Replace Linker::link() usage with LinkRendedrer
..

Replace Linker::link() usage with LinkRendedrer

Linker::link() replaced with LinkRenderer in some pages in includes/specials

Bug: T149346
Change-Id: I937bdc99d1342e73f20b8437a9b55dffb04161c5
---
M includes/specials/SpecialRecentchanges.php
M includes/specials/SpecialRevisiondelete.php
M includes/specials/SpecialSearch.php
M includes/specials/SpecialUncategorizedcategories.php
M includes/specials/SpecialUnwatchedpages.php
M includes/specials/SpecialWhatlinkshere.php
M includes/specials/pagers/AllMessagesTablePager.php
M includes/specials/pagers/BlockListPager.php
M includes/specials/pagers/ContribsPager.php
M includes/specials/pagers/DeletedContribsPager.php
M includes/specials/pagers/ImageListPager.php
11 files changed, 82 insertions(+), 65 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/39/325339/1

diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index cd3299c..a7918a4 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -664,12 +664,13 @@
}
unset( $value );
 
-   $text = htmlspecialchars( $title );
if ( $active ) {
-   $text = '' . $text . '';
+   $text = new HtmlArmor( '' . $title . 
'' );
+   } else {
+   $text = new HtmlArmor( $title );
}
 
-   return Linker::linkKnown( $this->getPageTitle(), $text, [], 
$params );
+   return $this->getLinkRenderer()->makeKnownLink( 
$this->getPageTitle(), $text, [], $params );
}
 
/**
diff --git a/includes/specials/SpecialRevisiondelete.php 
b/includes/specials/SpecialRevisiondelete.php
index 8780c56..4b0fa00 100644
--- a/includes/specials/SpecialRevisiondelete.php
+++ b/includes/specials/SpecialRevisiondelete.php
@@ -466,9 +466,9 @@
Xml::closeElement( 'form' ) . "\n";
// Show link to edit the dropdown reasons
if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
-   $link = Linker::linkKnown(
+   $link = $this->getLinkRenderer()->makeKnownLink(
$this->msg( 'revdelete-reason-dropdown' 
)->inContentLanguage()->getTitle(),
-   $this->msg( 'revdelete-edit-reasonlist' 
)->escaped(),
+   $this->msg( 'revdelete-edit-reasonlist' 
)->text(),
[],
[ 'action' => 'edit' ]
);
diff --git a/includes/specials/SpecialSearch.php 
b/includes/specials/SpecialSearch.php
index 9f83832..abc2342 100644
--- a/includes/specials/SpecialSearch.php
+++ b/includes/specials/SpecialSearch.php
@@ -499,9 +499,11 @@
}
$stParams = array_merge( $params, $this->powerSearchOptions() );
 
-   $suggest = Linker::linkKnown(
+   $linkRenderer = $this->getLinkRenderer();
+
+   $suggest = $linkRenderer->makeKnownLink(
$this->getPageTitle(),
-   $textMatches->getSuggestionSnippet() ?: null,
+   new HtmlArmor( $textMatches->getSuggestionSnippet() ) 
?: null,
[ 'id' => 'mw-search-DYM-suggestion' ],
$stParams
);
@@ -535,18 +537,20 @@
}
$stParams = array_merge( $params, $this->powerSearchOptions() );
 
-   $rewritten = Linker::linkKnown(
+   $linkRenderer = $this->getLinkRenderer();
+
+   $rewritten = $linkRenderer->makeKnownLink(
$this->getPageTitle(),
-   $textMatches->getQueryAfterRewriteSnippet() ?: null,
+   new HtmlArmor( 
$textMatches->getQueryAfterRewriteSnippet() ) ?: null,
[ 'id' => 'mw-search-DYM-rewritten' ],
$stParams
);
 
$stParams['search'] = $term;
$stParams['runsuggestion'] = 0;
-   $original = Linker::linkKnown(
+   $original = $linkRenderer->makeKnownLink(
$this->getPageTitle(),
-   htmlspecialchars( $term ),
+   $term,
[ 'id' => 'mw-search-DYM-original' ],
$stParams
);
@@ -766,9 +770,11 @@
Hooks::run( 'ShowSearchHitTitle',
[ &$link_t, &$titleSnippet, $result, $terms, $this, 
&$query 

[MediaWiki-commits] [Gerrit] mediawiki...MathSearch[master]: Update maintenance scripts to use $this->requireExtension

2016-12-04 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/325168

Change subject: Update maintenance scripts to use $this->requireExtension
..

Update maintenance scripts to use $this->requireExtension

Bug: T152139
Change-Id: I8aa649c6d03eae07d4d4c060c348f616a6a2afa6
---
M maintenance/BatchExport.php
M maintenance/BatchImport.php
M maintenance/CalculateDistances.php
M maintenance/CleanMathTable.php
M maintenance/ExportCache.php
M maintenance/ExtractFeatures.php
M maintenance/GenerateFeatureTable.php
M maintenance/ImportDefinitions.php
M maintenance/IndexBase.php
M maintenance/MathPerformance.php
M maintenance/QueryEval.php
M maintenance/UpdateMath.php
M maintenance/WMCAssessSeeds.php
M maintenance/WmcRefIdentifier.php
14 files changed, 20 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/68/325168/1

diff --git a/maintenance/BatchExport.php b/maintenance/BatchExport.php
index 01c6fc5..bc7a762 100644
--- a/maintenance/BatchExport.php
+++ b/maintenance/BatchExport.php
@@ -35,6 +35,7 @@
"Exports  submissions to a folder. \n Each run is named 
after the following convention: \n \$userName-\$runName-\$runId.csv";
// @codingStandardsIgnoreEnd
$this->addArg( 'dir', 'The output directory', true );
+   $this->requireExtension( 'MathSearch' );
}
 
/**
diff --git a/maintenance/BatchImport.php b/maintenance/BatchImport.php
index d0bcd61..a010d06 100644
--- a/maintenance/BatchImport.php
+++ b/maintenance/BatchImport.php
@@ -41,6 +41,7 @@
$this->addOption(
'overwrite', 'Overwrite existing runs with the same 
name.', false, false, "o"
);
+   $this->requireExtension( 'MathSearch' );
}
 
/**
diff --git a/maintenance/CalculateDistances.php 
b/maintenance/CalculateDistances.php
index b08fe17..b3e4a4d 100644
--- a/maintenance/CalculateDistances.php
+++ b/maintenance/CalculateDistances.php
@@ -45,6 +45,7 @@
'9' );
$this->addArg( 'min', 'If set processing is started at the page 
with curid>min', false );
$this->addArg( 'max', 'If set processing is stopped at the page 
with curid<=max', false );
+   $this->requireExtension( 'MathSearch' );
}
 
/**
diff --git a/maintenance/CleanMathTable.php b/maintenance/CleanMathTable.php
index 33a97e3..94d5c83 100644
--- a/maintenance/CleanMathTable.php
+++ b/maintenance/CleanMathTable.php
@@ -42,6 +42,7 @@
$this->addOption( 'purge',
'If set all formulae are rendered again from strech. 
(Very time consuming!)', false,
false, 'f' );
+   $this->requireExtension( 'MathSearch' );
}
 
// @codingStandardsIgnoreStart
diff --git a/maintenance/ExportCache.php b/maintenance/ExportCache.php
index 979d3cc..109bbd8 100755
--- a/maintenance/ExportCache.php
+++ b/maintenance/ExportCache.php
@@ -48,6 +48,7 @@
$this->addOption(
'sort', 'If set the result is sorted according to the 
input', false, false, 's'
);
+   $this->requireExtension( 'MathSearch' );
}
 
/**
diff --git a/maintenance/ExtractFeatures.php b/maintenance/ExtractFeatures.php
index 226d09f..4ab72fe 100644
--- a/maintenance/ExtractFeatures.php
+++ b/maintenance/ExtractFeatures.php
@@ -48,6 +48,7 @@
false );
$this->addArg( 'max', 'If set processing is stopped at the page 
with rank(pageID)<=max',
false );
+   $this->requireExtension( 'MathSearch' );
}
 
/**
diff --git a/maintenance/GenerateFeatureTable.php 
b/maintenance/GenerateFeatureTable.php
index f06225f..2112b82 100644
--- a/maintenance/GenerateFeatureTable.php
+++ b/maintenance/GenerateFeatureTable.php
@@ -43,6 +43,7 @@
);
$this->addArg( 'min', "If set processing is started at the page 
with rank(pageID)>min", false );
$this->addArg( 'max', "If set processing is stopped at the page 
with rank(pageID)<=max", false );
+   $this->requireExtension( 'MathSearch' );
}
/**
 * Populates the search index with content from all pages
diff --git a/maintenance/ImportDefinitions.php 
b/maintenance/ImportDefinitions.php
index 4b69d4b..80c4dd9 100644
--- a/maintenance/ImportDefinitions.php
+++ b/maintenance/ImportDefinitions.php
@@ -39,6 +39,7 @@
$this->addOption(
'overwrite', 'Overwrite existing definitions with the 
same name.', false, false, "o"
);
+   $this->requireExtension( 'MathSearch' );
}
 
/**
diff --git a/maintenance/IndexBase.php b/maintenance/IndexBase.php

[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Update maintenance scripts to use $this->requireExtension

2016-12-04 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/325165

Change subject: Update maintenance scripts to use $this->requireExtension
..

Update maintenance scripts to use $this->requireExtension

Change-Id: I80671844dc1a22354ad49c1c9fd88017d1a179a4
Task: T152139
---
M maintenance/FlowAddMissingModerationLogs.php
M maintenance/FlowCreateTemplates.php
M maintenance/FlowExternalStoreMoveCluster.php
M maintenance/FlowFixEditCount.php
M maintenance/FlowFixLinks.php
M maintenance/FlowFixLog.php
M maintenance/FlowFixUserIp.php
M maintenance/FlowFixWorkflowLastUpdateTimestamp.php
M maintenance/FlowForceSearchIndex.php
M maintenance/FlowPopulateLinksTables.php
M maintenance/FlowPopulateRefId.php
M maintenance/FlowRemoveOldTopics.php
M maintenance/FlowRestoreLQT.php
M maintenance/FlowSearchConfig.php
M maintenance/FlowSetUserIp.php
M maintenance/FlowUpdateBetaFeaturePreference.php
M maintenance/FlowUpdateRecentChanges.php
M maintenance/FlowUpdateResolvedNotifTitles.php
M maintenance/FlowUpdateRevContentModelFromOccupyPages.php
M maintenance/FlowUpdateRevisionContentLength.php
M maintenance/FlowUpdateRevisionTypeId.php
M maintenance/FlowUpdateUserWiki.php
M maintenance/FlowUpdateWorkflowPageId.php
M maintenance/compileLightncandy.php
M maintenance/convertAllLqtPages.php
M maintenance/convertLqtPageFromRemoteApiForTesting.php
M maintenance/convertLqtPageOnLocalWiki.php
M maintenance/convertNamespaceFromWikitext.php
M maintenance/convertToText.php
M maintenance/dumpBackup.php
30 files changed, 66 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/65/325165/1

diff --git a/maintenance/FlowAddMissingModerationLogs.php 
b/maintenance/FlowAddMissingModerationLogs.php
index bd97ba3..2f84445 100644
--- a/maintenance/FlowAddMissingModerationLogs.php
+++ b/maintenance/FlowAddMissingModerationLogs.php
@@ -23,6 +23,8 @@
$this->addOption( 'stop', 'rev_id of first revision that was 
logged correctly after moderation logging fix.', true, true );
 
$this->setBatchSize( 300 );
+
+   $this->requireExtension( 'Flow' );
}
 
protected function getUpdateKey() {
diff --git a/maintenance/FlowCreateTemplates.php 
b/maintenance/FlowCreateTemplates.php
index 817cd7b..1312390 100644
--- a/maintenance/FlowCreateTemplates.php
+++ b/maintenance/FlowCreateTemplates.php
@@ -61,6 +61,8 @@
parent::__construct();
 
$this->mDescription = "Creates templates required by Flow";
+
+   $this->requireExtension( 'Flow' );
}
 
protected function getUpdateKey() {
diff --git a/maintenance/FlowExternalStoreMoveCluster.php 
b/maintenance/FlowExternalStoreMoveCluster.php
index 4134c99..9989259 100644
--- a/maintenance/FlowExternalStoreMoveCluster.php
+++ b/maintenance/FlowExternalStoreMoveCluster.php
@@ -56,6 +56,8 @@
$this->addOption( 'dry-run', 'Outputs the old user content, 
inserts into new External Store, gives hypothetical new column values for 
flow_revision (but does not actually change flow_revision), and checks that old 
and new ES are the same.' );
 
$this->setBatchSize( 300 );
+
+   $this->requireExtension( 'Flow' );
}
 
public function execute() {
diff --git a/maintenance/FlowFixEditCount.php b/maintenance/FlowFixEditCount.php
index 224b8d6..068ab33 100644
--- a/maintenance/FlowFixEditCount.php
+++ b/maintenance/FlowFixEditCount.php
@@ -30,6 +30,8 @@
$this->addOption( 'stop', 'Timestamp to stop counting revisions 
at', false, true );
 
$this->setBatchSize( 300 );
+
+   $this->requireExtension( 'Flow' );
}
 
protected function getUpdateKey() {
diff --git a/maintenance/FlowFixLinks.php b/maintenance/FlowFixLinks.php
index f292d04..21c206a 100644
--- a/maintenance/FlowFixLinks.php
+++ b/maintenance/FlowFixLinks.php
@@ -25,6 +25,8 @@
$this->mDescription = 'Fixes Flow References & entries in 
categorylinks & related tables';
 
$this->setBatchSize( 300 );
+
+   $this->requireExtension( 'Flow' );
}
 
protected function getUpdateKey() {
diff --git a/maintenance/FlowFixLog.php b/maintenance/FlowFixLog.php
index a67298d..bc6f98b 100644
--- a/maintenance/FlowFixLog.php
+++ b/maintenance/FlowFixLog.php
@@ -27,6 +27,8 @@
$this->mDescription = 'Fixes Flow log entries';
 
$this->setBatchSize( 300 );
+
+   $this->requireExtension( 'Flow' );
}
 
protected function getUpdateKey() {
diff --git a/maintenance/FlowFixUserIp.php b/maintenance/FlowFixUserIp.php
index 1445e38..8733940 100644
--- a/maintenance/FlowFixUserIp.php
+++ b/maintenance/FlowFixUserIp.php
@@ -32,6 +32,12 @@
'post-summary' => 'Flow\Model\PostSummary',
);
 
+   

[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Update maintenance script to use $this->requireExtension

2016-12-04 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/325162

Change subject: Update maintenance script to use $this->requireExtension
..

Update maintenance script to use $this->requireExtension

Update maintenance script deleteInactiveNewsletters.php to use 
$this->requireExtension()

Bug: T152139
Change-Id: I7b0650960c3de55359705b1699612d5f21b8521f
---
M maintenance/deleteInactiveNewsletters.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/62/325162/1

diff --git a/maintenance/deleteInactiveNewsletters.php 
b/maintenance/deleteInactiveNewsletters.php
index 55b2a69..0fa3dba 100644
--- a/maintenance/deleteInactiveNewsletters.php
+++ b/maintenance/deleteInactiveNewsletters.php
@@ -14,6 +14,7 @@
$this->addDescription(
"Deletes all inactive newsletters\nThese newsletters 
will no longer be restorable" );
$this->addOption( 'delete', 'Performs the deletion' );
+   $this->requireExtension( 'Newsletter' );
}
 
public function execute() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b0650960c3de55359705b1699612d5f21b8521f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Phantom42 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


  1   2   >