[MediaWiki-commits] [Gerrit] Initial Debian packaging - change (analytics/dclass)

2013-07-20 Thread Stefan.petrea (Code Review)
Stefan.petrea has submitted this change and it was merged.

Change subject: Initial Debian packaging
..


Initial Debian packaging

Change-Id: I0b4cddb36318e28bb47ca14a2b1b1ae05a4fe514
---
A debian/changelog
A debian/compat
A debian/control
A debian/copyright
A debian/gbp.conf
A debian/libdclass-data.install
A debian/libdclass-java.install
A debian/libdclass-jni.install
A debian/libdclass0-dev.install
A debian/libdclass0.install
A debian/rules
A debian/source/format
12 files changed, 139 insertions(+), 0 deletions(-)

Approvals:
  Stefan.petrea: Verified; Looks good to me, approved
  Faidon: Looks good to me, approved



diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 000..bf95cc4
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+dclass (2.2.2-1) precise-wikimedia; urgency=low
+
+  * Initial release.
+
+ -- Faidon Liambotis fai...@wikimedia.org  Sat, 20 Jul 2013 04:34:31 +0300
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 000..52dff5a
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,73 @@
+Source: dclass
+Section: libs
+Priority: optional
+Maintainer: Wikimedia Operations o...@lists.wikimedia.org
+Uploaders: Diederik van Liere dvanli...@wikimedia.org, Stefan Petrea 
ste...@garage-coding.com, Faidon Liambotis fai...@wikimedia.org
+Build-Depends: debhelper (= 9), dh-autoreconf, dh-exec,
+  default-jdk | openjdk-6-jdk | openjdk-7-jdk
+Standards-Version: 3.9.3.1
+Vcs-Git: https://git.wikimedia.org/git/analytics/dclass.git
+Homepage: https://git.wikimedia.org/summary/analytics%2Fdclass
+
+Package: libdclass0
+Architecture: any
+Pre-Depends: multiarch-support
+Section: libs
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Recommends: libdclass-data
+Description: User-agent device detection library
+ User-agent device detection library written in C to quickly
+ parse a browser's useragent string. The goal of this project
+ is to quickly and accurately match text against a large number
+ of flexable patterns.
+
+Package: libdclass-data
+Section: libs
+Architecture: all
+Multi-Arch: foreign
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: User-agent device detection library (data files)
+ User-agent device detection library written in C to quickly
+ parse a browser's useragent string. The goal of this project
+ is to quickly and accurately match text against a large number
+ of flexable patterns.
+ .
+ This package contains the dTree database data files.
+
+Package: libdclass0-dev
+Section: libdevel
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, libdclass0 (= ${binary:Version})
+Description: User-agent device detection library (development headers)
+ User-agent device detection library written in C to quickly
+ parse a browser's useragent string. The goal of this project
+ is to quickly and accurately match text against a large number
+ of flexable patterns.
+ .
+ This package contains the development headers for libdclass.
+
+Package: libdclass-jni
+Architecture: amd64
+Pre-Depends: multiarch-support
+Section: java
+Depends: ${shlibs:Depends}, ${misc:Depends}, libdclass0 (= ${binary:Version})
+Suggests: libdclass-java
+Description: User-agent device detection library (JNI bindings)
+ User-agent device detection library written in C to quickly
+ parse a browser's useragent string. The goal of this project
+ is to quickly and accurately match text against a large number
+ of flexable patterns.
+ .
+ This package contains the Java JNI bindings.
+
+Package: libdclass-java
+Section: java
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, libdclass-jni (= 
${binary:Version})
+Description: User-agent device detection library (Java bindings)
+ User-agent device detection library written in C to quickly
+ parse a browser's useragent string. The goal of this project
+ is to quickly and accurately match text against a large number
+ of flexable patterns.
+ .
+ This package contains the Java interface to the JNI bindings.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 000..e6dab91
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,28 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: dclass
+Source: https://github.com/TheWeatherChannel/dClass
+
+Files: *
+Copyright: 2012 The Weather Channel
+   2013 Reza Naghibi
+License: Apache-2.0
+
+Files: debian/*
+Copyright: 2013 Wikimedia Foundation Inc.
+License: Apache-2.0
+
+License: Apache-2.0
+  Licensed under the Apache License, Version 2.0 (the License);
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+  .
+  http://www.apache.org/licenses/LICENSE-2.0
+  .
+  Unless required by applicable law or agreed to in writing, software
+  

[MediaWiki-commits] [Gerrit] (bug 42113) remove ability to debureaucrat from enwiktionary... - change (operations/mediawiki-config)

2013-07-20 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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


Change subject: (bug 42113) remove ability to debureaucrat from enwiktionary 
bureaucrats
..

(bug 42113) remove ability to debureaucrat from enwiktionary bureaucrats

Per a community vote, see:
http://en.wiktionary.org/w/index.php?oldid=19278091

Bug: 42113
Change-Id: If9eacccd0c6c426ca3c1940b1ab292029bea1b7f
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/28/74828/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index cdf9f3e..ec72a15 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -8206,7 +8206,7 @@
'bureaucrat' = array( 'autopatrolled', 'patroller', 
'rollbacker' ),
),
'+enwiktionary' = array(
-   'bureaucrat' = array( 'sysop', 'bureaucrat', ),
+   'bureaucrat' = array( 'sysop' ), // bureaucrat removed per bug 
42113
'sysop' = array( 'autopatrolled', 'patroller', 'rollbacker', 
'flood' ),
),
'+fawiki' = array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If9eacccd0c6c426ca3c1940b1ab292029bea1b7f
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: TTO at.li...@live.com.au

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


[MediaWiki-commits] [Gerrit] (bug 50729, bug 51699) handle exception in the langlinkhander - change (mediawiki...Wikibase)

2013-07-20 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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


Change subject: (bug 50729, bug 51699) handle exception in the langlinkhander
..

(bug 50729, bug 51699) handle exception in the langlinkhander

- there are legitimate reasons for the sites table to be empty
or missing the site id!
- in such situations, no wikibase lang links can be found and none
added, with warning

Change-Id: Icb5350f9bd75a522847f82f1215ff5bffcfea4d6
---
M client/WikibaseClient.hooks.php
1 file changed, 11 insertions(+), 5 deletions(-)


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

diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index 1e0577f..38d09cb 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -388,6 +388,8 @@
public static function onParserAfterParse( \Parser $parser, $text, 
\StripState $stripState ) {
wfProfileIn( __METHOD__ );
 
+   // @todo split up the multiple responsibilities here and in 
lang link handler
+
$parserOutput = $parser-getOutput();
 
// only run this once, for the article content and not 
interface stuff
@@ -406,12 +408,16 @@
 
$useRepoLinks = $langLinkHandler-useRepoLinks( 
$parser-getTitle(), $parser-getOutput() );
 
-   if ( $useRepoLinks ) {
-   // add links
-   $langLinkHandler-addLinksFromRepository( 
$parser-getTitle(), $parser-getOutput() );
-   }
+   try {
+   if ( $useRepoLinks ) {
+   // add links
+   $langLinkHandler-addLinksFromRepository( 
$parser-getTitle(), $parser-getOutput() );
+   }
 
-   $langLinkHandler-updateItemIdProperty( $parser-getTitle(), 
$parser-getOutput() );
+   $langLinkHandler-updateItemIdProperty( 
$parser-getTitle(), $parser-getOutput() );
+   } catch ( \Exception $e ) {
+   wfWarn( 'Failed to add repo links: ' . $e-getMessage() 
);
+   }
 
if ( $useRepoLinks || Settings::get( 'alwaysSort' ) ) {
// sort links

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb5350f9bd75a522847f82f1215ff5bffcfea4d6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude aude.w...@gmail.com

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


[MediaWiki-commits] [Gerrit] Fill i18n file - change (mediawiki...Annotator)

2013-07-20 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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


Change subject: Fill i18n file
..

Fill i18n file

Add extension credits

Change-Id: I844acc5d0421bc56be572c6c75a853a2e1ee99be
---
M Annotator.i18n.php
M Annotator.php
2 files changed, 33 insertions(+), 0 deletions(-)


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

diff --git a/Annotator.i18n.php b/Annotator.i18n.php
index e69de29..a4f3c78 100644
--- a/Annotator.i18n.php
+++ b/Annotator.i18n.php
@@ -0,0 +1,23 @@
+?php
+/**
+ * This file is part of the MediaWiki extension Annotator.
+ *
+ * @file
+ * @ingroup extensions
+ */
+
+/**
+ * English
+ * @author Richa Jain
+ */
+$messages['en'] = array(
+   'annotator-desc' = 'Allows inline comments on pages',
+);
+
+/**
+ * Message documentation
+ * @author Raimond Spekking
+ */
+$messages['qqq'] = array(
+   'annotator-desc' = '{{desc}}',
+);
\ No newline at end of file
diff --git a/Annotator.php b/Annotator.php
index 6249a55..d06a8b0 100755
--- a/Annotator.php
+++ b/Annotator.php
@@ -3,6 +3,16 @@
 
 
 */
+
+$wgExtensionCredits['other'][] = array(
+   'path' = __FILE__,
+   'name' = 'Annotator',
+   'descriptionmsg' = 'annotator-desc',
+   'version' = '0.1',
+   'author' = array( 'Richa Jain' ),
+   'url' = 'https://mediawiki.org/wiki/Extension:Annotator',
+);
+
 $dir = dirname( __FILE__ ) . '/';
 $wgExtensionMessagesFiles['Annotator'] = $dir . 'Annotator.i18n.php';
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I844acc5d0421bc56be572c6c75a853a2e1ee99be
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Annotator
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] Initial commit of already written code - change (mediawiki...MassMessage)

2013-07-20 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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


Change subject: Initial commit of already written code
..

Initial commit of already written code

Provides a special page to let users send a message to multiple users at once.
I've already started adding in some global variables, but no actual 
functionality for that yet.

Change-Id: I8566b7c13aca7ffa03cf443debd9a52923d04c69
---
A MassMessage.body.php
A MassMessage.i18n.php
A MassMessage.php
A MassMessageJob.php
A SpecialMassMessage.php
5 files changed, 445 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage 
refs/changes/31/74831/1

diff --git a/MassMessage.body.php b/MassMessage.body.php
new file mode 100644
index 000..96b75f2
--- /dev/null
+++ b/MassMessage.body.php
@@ -0,0 +1,51 @@
+?php
+
+/*
+ * Some core functions needed by the ex.
+ * Based on code from AbuseFilter
+ * https://mediawiki.org/wiki/Extension:AbuseFilter
+ *
+ * @file
+ * @author Kunal Mehta
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
+ */
+
+
+
+class MassMessage {
+
+   /*
+* Sets up the messenger account for our use if it hasn't been already.
+*
+* @return User
+* @fixme This should use the langage for the target site, not 
submission site
+*/
+   public static function getMessengerUser() {
+   // Function kinda copied from the AbuseFilter
+   $user = User::newFromName( wfMessage( 'massmessage-sender' 
)-inContentLanguage()-text() );
+   $user-load();
+   if ( $user-getId()  $user-mPassword == '' ) {
+   // We've already stolen the account
+   return $user;
+   }
+
+   if ( !$user-getId() ) {
+   $user-addToDatabase();
+   $user-saveSettings();
+
+   // Increment site_stats.ss_users
+   $ssu = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
+   $ssu-doUpdate();
+   } else {
+   // Someone already created the account, lets take it 
over.
+   $user-setPassword( null );
+   $user-setEmail( null );
+   $user-saveSettings();
+   }
+
+   // Make the user a bot so it doesn't look weird
+   $user-addGroup( 'sysop' );
+
+   return $user;
+   }
+}
\ No newline at end of file
diff --git a/MassMessage.i18n.php b/MassMessage.i18n.php
new file mode 100644
index 000..ebc7882
--- /dev/null
+++ b/MassMessage.i18n.php
@@ -0,0 +1,59 @@
+?php
+
+/**
+* Translations and stuff.
+*
+* @file
+* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 
or later
+*/
+
+$messages = array();
+
+
+/** English
+ * @author Kunal Mehta
+ */
+
+$messages['en'] = array(
+   'massmessage' = 'Send mass message',
+   'massmessage-desc' = 'Allows users to easily send a message to a list 
of users',
+   'massmessage-sender' = 'MessengerBot',
+   'massmessage-form-spamlist' = 'Page containing list of pages to leave 
a message on.',
+   'massmessage-form-subject' = 'Subject of the message. Will also be 
used as the edit summary.',
+   'massmessage-form-message' = 'The body of the message.',
+   'massmessage-form-global' = 'This is a global message.',
+   'massmessage-form-submit' = 'Send',
+   'massmessage-submitted' = 'Your message has been sent!',
+   'massmessage-account-blocked' = 'The account used to deliver messages 
has been blocked.',
+   'massmessage-spamlist-doesnotexist' = 'The input list of pages does 
not exist.',
+   'right-massmessage' = 'Send a message to multiple users at once',
+   'action-massmessage' = 'send a message to multiple users at once',
+   'right-massmessage-global' = 'Send a message to multiple users on 
different wikis at once',
+   'log-name-massmessage' = 'Mass message log',
+   'log-description-massmessage' = 'These events track users sending 
messages through [[Special:MassMessage]].',
+   'logentry-massmessage-send' = '$1 {{GENDER:$2|sent a message}} to $3'
+);
+
+/** Message documentation
+ * @author Kunal Mehta
+ */
+$messages['qqq'] = array(
+   'massmessage' = '{{doc-special|MassMessage}}',
+   'massmessage-desc' = 
'{{desc|name=MassMessage|url=https://www.mediawiki.org/wiki/Extension:MassMessage}}',
+   'massmessage-sender' = 'Username of the account which sends out 
messages.',
+   'massmessage-form-spamlist' = 'Label for an inputbox on the special 
page.',
+   'massmessage-form-subject' = 'Label for an inputbox on the special 
page.',
+   'massmessage-form-message' = 'Label for an inputbox on the special 
page.',
+   'massmessage-form-global' = 'Label for a 

[MediaWiki-commits] [Gerrit] Initial commit of already written code - change (mediawiki...MassMessage)

2013-07-20 Thread Legoktm (Code Review)
Legoktm has submitted this change and it was merged.

Change subject: Initial commit of already written code
..


Initial commit of already written code

Provides a special page to let users send a message to multiple users at once.
I've already started adding in some global variables, but no actual 
functionality for that yet.

Change-Id: I8566b7c13aca7ffa03cf443debd9a52923d04c69
---
A MassMessage.body.php
A MassMessage.i18n.php
A MassMessage.php
A MassMessageJob.php
A SpecialMassMessage.php
5 files changed, 445 insertions(+), 0 deletions(-)

Approvals:
  Legoktm: Verified; Looks good to me, approved



diff --git a/MassMessage.body.php b/MassMessage.body.php
new file mode 100644
index 000..96b75f2
--- /dev/null
+++ b/MassMessage.body.php
@@ -0,0 +1,51 @@
+?php
+
+/*
+ * Some core functions needed by the ex.
+ * Based on code from AbuseFilter
+ * https://mediawiki.org/wiki/Extension:AbuseFilter
+ *
+ * @file
+ * @author Kunal Mehta
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
+ */
+
+
+
+class MassMessage {
+
+   /*
+* Sets up the messenger account for our use if it hasn't been already.
+*
+* @return User
+* @fixme This should use the langage for the target site, not 
submission site
+*/
+   public static function getMessengerUser() {
+   // Function kinda copied from the AbuseFilter
+   $user = User::newFromName( wfMessage( 'massmessage-sender' 
)-inContentLanguage()-text() );
+   $user-load();
+   if ( $user-getId()  $user-mPassword == '' ) {
+   // We've already stolen the account
+   return $user;
+   }
+
+   if ( !$user-getId() ) {
+   $user-addToDatabase();
+   $user-saveSettings();
+
+   // Increment site_stats.ss_users
+   $ssu = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
+   $ssu-doUpdate();
+   } else {
+   // Someone already created the account, lets take it 
over.
+   $user-setPassword( null );
+   $user-setEmail( null );
+   $user-saveSettings();
+   }
+
+   // Make the user a bot so it doesn't look weird
+   $user-addGroup( 'sysop' );
+
+   return $user;
+   }
+}
\ No newline at end of file
diff --git a/MassMessage.i18n.php b/MassMessage.i18n.php
new file mode 100644
index 000..ebc7882
--- /dev/null
+++ b/MassMessage.i18n.php
@@ -0,0 +1,59 @@
+?php
+
+/**
+* Translations and stuff.
+*
+* @file
+* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 
or later
+*/
+
+$messages = array();
+
+
+/** English
+ * @author Kunal Mehta
+ */
+
+$messages['en'] = array(
+   'massmessage' = 'Send mass message',
+   'massmessage-desc' = 'Allows users to easily send a message to a list 
of users',
+   'massmessage-sender' = 'MessengerBot',
+   'massmessage-form-spamlist' = 'Page containing list of pages to leave 
a message on.',
+   'massmessage-form-subject' = 'Subject of the message. Will also be 
used as the edit summary.',
+   'massmessage-form-message' = 'The body of the message.',
+   'massmessage-form-global' = 'This is a global message.',
+   'massmessage-form-submit' = 'Send',
+   'massmessage-submitted' = 'Your message has been sent!',
+   'massmessage-account-blocked' = 'The account used to deliver messages 
has been blocked.',
+   'massmessage-spamlist-doesnotexist' = 'The input list of pages does 
not exist.',
+   'right-massmessage' = 'Send a message to multiple users at once',
+   'action-massmessage' = 'send a message to multiple users at once',
+   'right-massmessage-global' = 'Send a message to multiple users on 
different wikis at once',
+   'log-name-massmessage' = 'Mass message log',
+   'log-description-massmessage' = 'These events track users sending 
messages through [[Special:MassMessage]].',
+   'logentry-massmessage-send' = '$1 {{GENDER:$2|sent a message}} to $3'
+);
+
+/** Message documentation
+ * @author Kunal Mehta
+ */
+$messages['qqq'] = array(
+   'massmessage' = '{{doc-special|MassMessage}}',
+   'massmessage-desc' = 
'{{desc|name=MassMessage|url=https://www.mediawiki.org/wiki/Extension:MassMessage}}',
+   'massmessage-sender' = 'Username of the account which sends out 
messages.',
+   'massmessage-form-spamlist' = 'Label for an inputbox on the special 
page.',
+   'massmessage-form-subject' = 'Label for an inputbox on the special 
page.',
+   'massmessage-form-message' = 'Label for an inputbox on the special 
page.',
+   'massmessage-form-global' = 'Label for a checkbox on the special 
page.',
+   'massmessage-form-submit' = 'Label for 

[MediaWiki-commits] [Gerrit] Add upload user group - change (mediawiki...WikimediaMessages)

2013-07-20 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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


Change subject: Add upload user group
..

Add upload user group

Bug: 51733
Change-Id: Ic92e18c4ad4aa113f98d738df8714c8243075689
---
M WikimediaMessages.i18n.php
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/WikimediaMessages.i18n.php b/WikimediaMessages.i18n.php
index 64003af..807c3a5 100644
--- a/WikimediaMessages.i18n.php
+++ b/WikimediaMessages.i18n.php
@@ -139,6 +139,10 @@
'group-trusted-member' = '{{GENDER:$1|trusted user}}',
'grouppage-trusted'= '{{ns:project}}:Trusted users',
 
+   'group-uploader'= 'Uploaders',
+   'group-uploader-member' = '{{GENDER:$1|uploader}}',
+   'grouppage-uploader'= '{{ns:project}}:Uploaders',
+
# Global Wikimedia specific usergroups (defined on 
http://meta.wikimedia.org/wiki/Special:GlobalGroupPermissions)
 
'group-Global_bot'= 'Global bots',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic92e18c4ad4aa113f98d738df8714c8243075689
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] [Ads] Register extension - change (translatewiki)

2013-07-20 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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


Change subject: [Ads] Register extension
..

[Ads] Register extension

Change-Id: I6eb021d2bb25930d5fe36850c414be71a4ba1a4d
---
M groups/MediaWiki/mediawiki-defines.txt
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/33/74833/1

diff --git a/groups/MediaWiki/mediawiki-defines.txt 
b/groups/MediaWiki/mediawiki-defines.txt
index 8929648..43f9c87 100644
--- a/groups/MediaWiki/mediawiki-defines.txt
+++ b/groups/MediaWiki/mediawiki-defines.txt
@@ -20,6 +20,9 @@
 Admin Links
 aliasfile = AdminLinks/AdminLinks.alias.php
 
+Ads
+file = Ads/ads.i18n.php
+
 Agora
 
 AJAX Poll

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6eb021d2bb25930d5fe36850c414be71a4ba1a4d
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] [Ads] Register extension - change (translatewiki)

2013-07-20 Thread Raimond Spekking (Code Review)
Raimond Spekking has submitted this change and it was merged.

Change subject: [Ads] Register extension
..


[Ads] Register extension

Change-Id: I6eb021d2bb25930d5fe36850c414be71a4ba1a4d
---
M groups/MediaWiki/mediawiki-defines.txt
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Raimond Spekking: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/groups/MediaWiki/mediawiki-defines.txt 
b/groups/MediaWiki/mediawiki-defines.txt
index 8929648..43f9c87 100644
--- a/groups/MediaWiki/mediawiki-defines.txt
+++ b/groups/MediaWiki/mediawiki-defines.txt
@@ -20,6 +20,9 @@
 Admin Links
 aliasfile = AdminLinks/AdminLinks.alias.php
 
+Ads
+file = Ads/ads.i18n.php
+
 Agora
 
 AJAX Poll

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6eb021d2bb25930d5fe36850c414be71a4ba1a4d
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Fix syntax error - change (mediawiki...Ads)

2013-07-20 Thread Raimond Spekking (Code Review)
Raimond Spekking has submitted this change and it was merged.

Change subject: Fix syntax error
..


Fix syntax error

Change-Id: I46ff6849e5c2b764fabeed2915dcc7a098d61d66
---
M ads.i18n.php
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Raimond Spekking: Verified; Looks good to me, approved



diff --git a/ads.i18n.php b/ads.i18n.php
index 8358231..c76b917 100644
--- a/ads.i18n.php
+++ b/ads.i18n.php
@@ -29,6 +29,7 @@
 'ads' = 'ads',
 'ads-desc' = 'Inserts annonces dans la barre de navigation',
'ads-title' = 'publicité',
+);
 
 $messages['es'] = array(
 'ads' = 'ads',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I46ff6849e5c2b764fabeed2915dcc7a098d61d66
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Ads
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] Fix syntax error - change (mediawiki...Ads)

2013-07-20 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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


Change subject: Fix syntax error
..

Fix syntax error

Change-Id: I46ff6849e5c2b764fabeed2915dcc7a098d61d66
---
M ads.i18n.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/ads.i18n.php b/ads.i18n.php
index 8358231..c76b917 100644
--- a/ads.i18n.php
+++ b/ads.i18n.php
@@ -29,6 +29,7 @@
 'ads' = 'ads',
 'ads-desc' = 'Inserts annonces dans la barre de navigation',
'ads-title' = 'publicité',
+);
 
 $messages['es'] = array(
 'ads' = 'ads',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I46ff6849e5c2b764fabeed2915dcc7a098d61d66
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Ads
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] Add preliminary support for SQLite indexes - change (mediawiki...WikibaseDatabase)

2013-07-20 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add preliminary support for SQLite indexes
..


Add preliminary support for SQLite indexes

Change-Id: I66b319802ec6d5a8002b385d70880c6851b582af
---
M src/MWDB/ExtendedSQLiteAbstraction.php
1 file changed, 14 insertions(+), 1 deletion(-)

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



diff --git a/src/MWDB/ExtendedSQLiteAbstraction.php 
b/src/MWDB/ExtendedSQLiteAbstraction.php
index fda2dbf..df6967c 100644
--- a/src/MWDB/ExtendedSQLiteAbstraction.php
+++ b/src/MWDB/ExtendedSQLiteAbstraction.php
@@ -79,7 +79,9 @@
 
// TODO: add all field stuff relevant here
 
-   $sql .= $field-allowsNull() ? ' NULL' : ' NOT NULL';
+   $sql .= ' ' . $field-allowsNull() ? 'NULL' : 'NOT NULL';
+
+   $sql .= ' ' . $this-getIndexString( $field-getIndex() );
 
return $sql;
}
@@ -107,4 +109,15 @@
}
}
 
+   protected function getIndexString( $indexType ) {
+   switch ( $indexType ) {
+   case FieldDefinition::INDEX_PRIMARY:
+   return 'INTEGER PRIMARY KEY';
+   }
+
+   // TODO: handle other index types
+
+   return '';
+   }
+
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I66b319802ec6d5a8002b385d70880c6851b582af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseDatabase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.de
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] (bug 50729, bug 51699) handle exception in the langlinkhander - change (mediawiki...Wikibase)

2013-07-20 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: (bug 50729, bug 51699) handle exception in the langlinkhander
..


(bug 50729, bug 51699) handle exception in the langlinkhander

- there are legitimate reasons for the sites table to be empty
or missing the site id!
- in such situations, no wikibase lang links can be found and none
added, with warning

Change-Id: Icb5350f9bd75a522847f82f1215ff5bffcfea4d6
---
M client/WikibaseClient.hooks.php
1 file changed, 11 insertions(+), 5 deletions(-)

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



diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index 1e0577f..38d09cb 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -388,6 +388,8 @@
public static function onParserAfterParse( \Parser $parser, $text, 
\StripState $stripState ) {
wfProfileIn( __METHOD__ );
 
+   // @todo split up the multiple responsibilities here and in 
lang link handler
+
$parserOutput = $parser-getOutput();
 
// only run this once, for the article content and not 
interface stuff
@@ -406,12 +408,16 @@
 
$useRepoLinks = $langLinkHandler-useRepoLinks( 
$parser-getTitle(), $parser-getOutput() );
 
-   if ( $useRepoLinks ) {
-   // add links
-   $langLinkHandler-addLinksFromRepository( 
$parser-getTitle(), $parser-getOutput() );
-   }
+   try {
+   if ( $useRepoLinks ) {
+   // add links
+   $langLinkHandler-addLinksFromRepository( 
$parser-getTitle(), $parser-getOutput() );
+   }
 
-   $langLinkHandler-updateItemIdProperty( $parser-getTitle(), 
$parser-getOutput() );
+   $langLinkHandler-updateItemIdProperty( 
$parser-getTitle(), $parser-getOutput() );
+   } catch ( \Exception $e ) {
+   wfWarn( 'Failed to add repo links: ' . $e-getMessage() 
);
+   }
 
if ( $useRepoLinks || Settings::get( 'alwaysSort' ) ) {
// sort links

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icb5350f9bd75a522847f82f1215ff5bffcfea4d6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude aude.w...@gmail.com
Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.de
Gerrit-Reviewer: Hashar has...@free.fr
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] RTL Fix for Category Popup - change (mediawiki...VisualEditor)

2013-07-20 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review.

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


Change subject: RTL Fix for Category Popup
..

RTL Fix for Category Popup

Flipped the generated positions of the MWCategoryPopupWidget in case
the GUI is RTL.

Bug: 51490
Change-Id: I83436d50a4a0596fdae9526c3fc2804cf880a530
---
M modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/35/74835/1

diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js 
b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js
index 911ad37..1ad1944 100644
--- a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js
+++ b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js
@@ -173,6 +173,14 @@
width = this.$menu.outerWidth( true ),
height = this.$menu.outerHeight( true );
 
-   this.$.css( { 'left': left, 'top': top } );
+   if ( this.$container.attr('dir') === 'rtl' ) {
+   //flip me, I'm a mirror:
+   this.$.css( {
+   'right': this.$container.outerWidth( true ) - left,
+   'top': top
+   } );
+   } else {
+   this.$.css( { 'left': left, 'top': top } );
+   }
this.display( left, top, width, height );
 };

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83436d50a4a0596fdae9526c3fc2804cf880a530
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo mor...@gmail.com

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


[MediaWiki-commits] [Gerrit] Ensure ve-ui-panelLayout-scrollable is actually scrollable - change (mediawiki...VisualEditor)

2013-07-20 Thread Matmarex (Code Review)
Matmarex has uploaded a new change for review.

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


Change subject: Ensure ve-ui-panelLayout-scrollable is actually scrollable
..

Ensure ve-ui-panelLayout-scrollable is actually scrollable

Due to CSS specificity rules the styles defined for
.ve-ui-panelLayout-scrollable and .ve-ui-panelLayout-padded in
ve.ui.Layout.css were being overriden by more general rules for
.ve-ui-pagedDialog-pagesPanel .ve-ui-panelLayout in ve.ui.Dialog.css.

Bug: 51739
Change-Id: If2d5ec3168a874eb4f856450583d6c89967513df
---
M modules/ve/ui/styles/ve.ui.Dialog.css
1 file changed, 8 insertions(+), 0 deletions(-)


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

diff --git a/modules/ve/ui/styles/ve.ui.Dialog.css 
b/modules/ve/ui/styles/ve.ui.Dialog.css
index 337999f..68049ce 100644
--- a/modules/ve/ui/styles/ve.ui.Dialog.css
+++ b/modules/ve/ui/styles/ve.ui.Dialog.css
@@ -166,6 +166,14 @@
overflow: hidden;
 }
 
+.ve-ui-pagedDialog-pagesPanel .ve-ui-panelLayout-scrollable {
+   overflow-y: auto;
+}
+
+.ve-ui-pagedDialog-pagesPanel .ve-ui-panelLayout-padded {
+   padding: 2em;
+}
+
 .ve-ui-window-body .ve-ce-documentNode {
padding: 1.875em; /* 1.5/0.8 */
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2d5ec3168a874eb4f856450583d6c89967513df
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Matmarex matma@gmail.com

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


[MediaWiki-commits] [Gerrit] Report MediaWiki exceptions fatals to Ganglia - change (operations/puppet)

2013-07-20 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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


Change subject: Report MediaWiki exceptions  fatals to Ganglia
..

Report MediaWiki exceptions  fatals to Ganglia

This patch re-introduces the Python Ganglia module for MediaWiki exceptions and
fatals which I removed in If035a0ef2 so I could clean up the EventLogging
module. I've modified it to consume the UDP error stream directly rather than
via ZeroMQ forwarding since it was adding an unnecessary layer of complexity to
a piece of code that should be as straightforward as possible. Other than the
slight modification to consume a UDP stream rather than a ZeroMQ stream, the
code is substantially the same as it was when Tim reviewed it.

Change-Id: I874ec534062c2086f2c1ac00bdb9cb4ffbeaf846
---
M manifests/role/logging.pp
M manifests/site.pp
A modules/mediawiki/files/mwerrors.py
A modules/mediawiki/manifests/monitor/errors.pp
A modules/mediawiki/templates/mwerrors.pyconf.erb
5 files changed, 232 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/37/74837/1

diff --git a/manifests/role/logging.pp b/manifests/role/logging.pp
index eee5943..c088be7 100644
--- a/manifests/role/logging.pp
+++ b/manifests/role/logging.pp
@@ -78,6 +78,22 @@
}
 }
 
+# == Class role::logging::mediawiki::ganglia
+# fluorine's udp2log instance forwards MediaWiki exceptions and fatals
+# to vanadium, as configured in templates/udp2log/filters.mw.erb. This
+# role provisions a metric module that reports error counts to Ganglia.
+# Configures a Ganglia metric module that listens on a UDP port for
+# MediaWiki fatal and exception log messages and reports them to Ganglia.
+#
+class role::logging::mediawiki::errors {
+system_role { 'role::logging::mediawiki::errors':
+description = 'Report MediaWiki exceptions and fatals to Ganglia',
+}
+
+class { 'mediawiki::monitor::errors':
+port = 8423,
+}
+}
 
 # == Class role::logging::relay::webrequest-multicast
 # Sets up a multicast relay using socat for
diff --git a/manifests/site.pp b/manifests/site.pp
index 3ee41d0..8ca9ae1 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2800,6 +2800,7 @@
 include standard,
 role::eventlogging,
 role::ipython_notebook,
+role::logging::mediawiki::ganglia,
 nrpe,
 role::solr::ttm
 
diff --git a/modules/mediawiki/files/mwerrors.py 
b/modules/mediawiki/files/mwerrors.py
new file mode 100644
index 000..232af82
--- /dev/null
+++ b/modules/mediawiki/files/mwerrors.py
@@ -0,0 +1,122 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+  mwerrors.py
+  ~~~
+
+  This is a Gmond metric-gathering module; it listens on a UDP port for
+  MediaWiki fatals and exceptions and reports them to Ganglia.
+
+  To use this module, copy this file to /usr/lib/ganglia/python_modules.
+  Then edit mwerrors.pyconf and ensure the UDP port is correct. Finally,
+  copy mwerrors.pyconf to /etc/ganglia/conf.d and run 'service
+  ganglia-monitor restart'.
+
+  You can test this module by invoking it from the command line with the
+  UDP port number as an argument. When invoked from the command line,
+  this script will emit a count of errors every ten seconds.
+
+  Copyright (C) 2013, Ori Livneh o...@wikimedia.org
+  Licensed under the terms of the GNU General Public License, version 2
+  or later.
+
+
+import sys
+reload(sys)
+sys.setdefaultencoding('utf8')
+
+import io
+import socket
+import threading
+import time
+
+
+BLOCK_SIZE = 65536  # Matches Udp2LogConfig::BLOCK_SIZE
+
+patterns = (
+# Substring to match# Metric  # Metric title
+('Fatal error: Out of memory',  'oom','OOM fatals'),
+('Fatal error: Maximum execution',  'timelimit',  'Time limit fatals'),
+('Fatal error:','fatal',  'Misc fatals'),
+('Exception from',  'exception',  'Exceptions'),
+('Catchable fatal error',   'catchable',  'Catchable fatals'),
+('DatabaseBase-reportQueryError',  'query',  'Query errors'),
+)
+
+
+def count_errors(counter, port):
+Count error types in error stream.
+sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+sock.bind(('0.0.0.0', port))
+with io.open(sock.fileno(), buffering=BLOCK_SIZE, encoding='utf8',
+ errors='replace') as f:
+for line in f:
+for pattern, name, description in patterns:
+if pattern in line:
+counter[name] += 1
+break
+
+
+def metric_init(params):
+
+Initialize; part of Gmond interface
+
+`params` is a dictionary of configuration options, generated by
+Ganglia out of values specified in the module's .pyconf file. It
+should contain an 'port' key, specifying 

[MediaWiki-commits] [Gerrit] remove obsolete wgUseDynamicDates variable - change (operations/mediawiki-config)

2013-07-20 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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


Change subject: remove obsolete wgUseDynamicDates variable
..

remove obsolete wgUseDynamicDates variable

The DynamicDates feature was removed in 
I609db8471c14e5e5946916f085d2ee5b96204d81
No bug.

Change-Id: Iea6141d1620f38439ee026759954d6b4e084daa5
---
M wmf-config/InitialiseSettings.php
1 file changed, 0 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/38/74838/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index cdf9f3e..66b3621 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -3684,19 +3684,6 @@
 ),
 # @} end of wgProofreadPageNamespaceIds
 
-# wgUseDynamicDates @{
-'wgUseDynamicDates' = array(
-   'default' = false,
-   'metawiki'  = true,
-   'enwikiquote' = true,
-   'enwiktionary' = true,
-   'enwikibooks' = true,
-   'enwikinews' = true,
-   'commonswiki' = true,
-   'testwiki' = true,
-),
-# @} end of wgUseDynamicDates
-
 'wgRawHtml' = array(
'default' = false,
'donatewiki' = true,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea6141d1620f38439ee026759954d6b4e084daa5
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: TTO at.li...@live.com.au

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


[MediaWiki-commits] [Gerrit] Add Nischay to credits - change (mediawiki...UploadWizard)

2013-07-20 Thread SuchABot (Code Review)
SuchABot has uploaded a new change for review.

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


Change subject: Add Nischay to credits
..

Add Nischay to credits

Change-Id: I8c757cc044658cac876b8d69f613514b1fcabbe1
GitHub: https://github.com/wikimedia/mediawiki-extensions-UploadWizard/pull/8
---
M README
M UploadWizard.php
2 files changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/README b/README
index de15375..8fc1f13 100644
--- a/README
+++ b/README
@@ -11,4 +11,5 @@
 @author Jeroen de Dauw jereoended...@gmail.com
 @author Ryan Kaldari rkald...@wikimedia.org
 @author Ian Baker iba...@wikimedia.org
+@author Nischay Nahata nischay...@gmail.com
 @author Yuvi Panda yuvipa...@gmail.com
diff --git a/UploadWizard.php b/UploadWizard.php
index 417c973..b8b78c6 100644
--- a/UploadWizard.php
+++ b/UploadWizard.php
@@ -28,7 +28,7 @@
 $wgExtensionCredits['other'][] = array(
'path' = __FILE__,
'name' = 'Upload Wizard',
-   'author' = array( 'Neil Kandalgaonkar', 'Jeroen De Dauw', 'Mark 
Holmquist', 'Ryan Kaldari', 'Michael Dale', 'Ankur Anand', 'Yuvi Panda' ),
+   'author' = array( 'Neil Kandalgaonkar', 'Jeroen De Dauw', 'Mark 
Holmquist', 'Ryan Kaldari', 'Michael Dale', 'Ankur Anand', 'Nischay Nahata', 
'Yuvi Panda' ),
'version' = '1.3',
'descriptionmsg' = 'uploadwizard-desc',
'url' = 'https://www.mediawiki.org/wiki/Extension:UploadWizard'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c757cc044658cac876b8d69f613514b1fcabbe1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: SuchABot yuvipanda+sucha...@gmail.com
Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com

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


[MediaWiki-commits] [Gerrit] \SMW\PropertyAnnotationComplementor (eliminate scope creep i... - change (mediawiki...SemanticMediaWiki)

2013-07-20 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: \SMW\PropertyAnnotationComplementor (eliminate scope creep in 
ParserData)
..


\SMW\PropertyAnnotationComplementor (eliminate scope creep in ParserData)

Code coverage: 100%
CRAP: 19

Makes use of the Observer pattern to notfiy about the status change.
More precise it informs the ParserData object that is needs to
carry an Output update without PropertyAnnotationComplementor
depending on the ParserData object.

PropertyAnnotationComplementor is the Publisher
ParserData becomes the Subscriber

Change-Id: Idaa053407fe6f3f77b591c7d3a7feedbbe01ea87
---
M SemanticMediaWiki.hooks.php
M includes/ParserData.php
A includes/PropertyAnnotationComplementor.php
M includes/Setup.php
A includes/utilities/ObserverInterfaceProvider.php
M tests/phpunit/MockObjectBuilder.php
M tests/phpunit/ParserTestCase.php
M tests/phpunit/SemanticMediaWikiTestCase.php
M tests/phpunit/includes/ParserDataTest.php
A tests/phpunit/includes/PropertyAnnotationComplementorTest.php
10 files changed, 1,029 insertions(+), 232 deletions(-)

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



diff --git a/SemanticMediaWiki.hooks.php b/SemanticMediaWiki.hooks.php
index 346cde1..56714fe 100644
--- a/SemanticMediaWiki.hooks.php
+++ b/SemanticMediaWiki.hooks.php
@@ -496,17 +496,14 @@
 */
public static function onParserAfterTidy( $parser, $text ) {
 
-   // Separate globals from local state
-   // FIXME Do a new SMW\Settings( $GLOBALS );
-   $options = array(
-   'smwgUseCategoryHierarchy' = 
$GLOBALS['smwgUseCategoryHierarchy'],
-   'smwgCategoriesAsInstances' = 
$GLOBALS['smwgCategoriesAsInstances'],
-   );
+   $settings   = \SMW\Settings::newFromGlobals();
+   $parserData = new SMW\ParserData( $parser-getTitle(), 
$parser-getOutput() );
 
-   $parserData = new SMW\ParserData( $parser-getTitle(), 
$parser-getOutput(), $options );
-   $parserData-addCategories( 
$parser-getOutput()-getCategoryLinks() );
-   $parserData-addDefaultSort( $parser-getDefaultSort() );
-   $parserData-updateOutput();
+   $complementor = new \SMW\PropertyAnnotationComplementor( 
$parserData-getData(), $settings );
+   $complementor-attach( $parserData );
+
+   $complementor-addCategories( 
$parser-getOutput()-getCategoryLinks() );
+   $complementor-addDefaultSort( $parser-getDefaultSort() );
 
// If an article was was manually purged/moved ensure that the 
store is
// updated as well for all other cases onLinksUpdateConstructed 
will
@@ -649,13 +646,12 @@
return true;
}
 
-   // FIXME Do a new SMW\Settings( $GLOBALS );
-   $options = array(
-   'smwgPageSpecialProperties' = 
$GLOBALS['smwgPageSpecialProperties']
-   );
+   $settings   = \SMW\Settings::newFromGlobals();
+   $parserData = new SMW\ParserData( $wikiPage-getTitle(), 
$parserOutput );
 
-   $parserData = new SMW\ParserData( $wikiPage-getTitle(), 
$parserOutput, $options );
-   $parserData-addSpecialProperties( $wikiPage, $revision, $user 
);
+   $complementor = new \SMW\PropertyAnnotationComplementor( 
$parserData-getData(), $settings );
+   $complementor-attach( $parserData );
+   $complementor-addSpecialProperties( $wikiPage, $revision, 
$user );
 
return true;
}
diff --git a/includes/ParserData.php b/includes/ParserData.php
index be8276c..0acc9c8 100644
--- a/includes/ParserData.php
+++ b/includes/ParserData.php
@@ -126,7 +126,7 @@
  * @author Markus Krötzsch
  * @author mwjames
  */
-class ParserData implements IParserData {
+class ParserData extends Observer implements IParserData {
 
/**
 * Represents Title object
@@ -297,6 +297,7 @@
 * @throws MWException
 */
public function updateOutput(){
+
if ( !( $this-semanticData instanceof SMWSemanticData ) ) {
throw new MWException( 'The semantic data container is 
not available' );
}
@@ -306,6 +307,7 @@
} else {
$this-parserOutput-mSMWData = $this-semanticData;
}
+
}
 
/**
@@ -348,134 +350,6 @@
}
 
Profiler::Out( __METHOD__, true );
-   }
-
-   /**
-* Add category information
-*
-* Part of this code was entangled in SMWParseData::onParserAfterTidy
-* which has now been separated and is called from
-* SMWHooks::onParserAfterTidy
-*
-* @note Fetches category information and other final settings
- 

[MediaWiki-commits] [Gerrit] \SMW\JobBase improve testability and eliminate GLOBALS - change (mediawiki...SemanticMediaWiki)

2013-07-20 Thread Mwjames (Code Review)
Mwjames has uploaded a new change for review.

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


Change subject: \SMW\JobBase improve testability and eliminate GLOBALS
..

\SMW\JobBase improve testability and eliminate GLOBALS

* Use JobBase to access general purpose Setter/Getter
* Move SMWUpdateJob to SMW\UpdateJob (SMWUpdateJob object is still accessible)
* Eliminate global wgParser from UpdateJob

Change-Id: I3b41d4e506a2c425903ec3690f3500dcec939ac4
---
M includes/Setup.php
A includes/jobs/JobBase.php
M includes/jobs/PropertySubjectsUpdateDispatcherJob.php
D includes/jobs/SMW_UpdateJob.php
A includes/jobs/UpdateJob.php
M tests/phpunit/MockObjectBuilder.php
M tests/phpunit/includes/jobs/UpdateJobTest.php
7 files changed, 261 insertions(+), 127 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki 
refs/changes/40/74840/1

diff --git a/includes/Setup.php b/includes/Setup.php
index c49793e..17b4054 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -417,9 +417,10 @@
$wgAutoloadClasses['SMW\Test\CompatibilityTestCase'] = 
$testsDir . 'CompatibilityTestCase.php';
 
// Jobs
-   $wgJobClasses['SMWUpdateJob']   = 'SMWUpdateJob';
-   $wgAutoloadClasses['SMWUpdateJob']  = $smwgIP . 
'includes/jobs/SMW_UpdateJob.php';
-   $wgAutoloadClasses['SMW\UpdateJob']  = $smwgIP . 
'includes/jobs/SMW_UpdateJob.php'; // 1.9
+   $wgAutoloadClasses['SMW\JobBase']   = $smwgIP . 
'includes/jobs/JobBase.php';
+   $wgJobClasses['SMW\UpdateJob']  = 'SMW\UpdateJob';
+   $wgAutoloadClasses['SMWUpdateJob']  = $smwgIP . 
'includes/jobs/UpdateJob.php';
+   $wgAutoloadClasses['SMW\UpdateJob'] = $smwgIP . 
'includes/jobs/UpdateJob.php'; // 1.9
$wgJobClasses['SMWRefreshJob']  = 'SMWRefreshJob';
$wgAutoloadClasses['SMWRefreshJob'] = $smwgIP . 
'includes/jobs/SMW_RefreshJob.php';
 
diff --git a/includes/jobs/JobBase.php b/includes/jobs/JobBase.php
new file mode 100644
index 000..d4cabd8
--- /dev/null
+++ b/includes/jobs/JobBase.php
@@ -0,0 +1,83 @@
+?php
+
+namespace SMW;
+
+use Job;
+
+/**
+ * Job base class
+ *
+ * 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
+ *
+ * @license GNU GPL v2+
+ * @since   1.9
+ *
+ * @author mwjames
+ */
+
+/**
+ * Job base class
+ *
+ * @ingroup Job
+ */
+abstract class JobBase extends Job {
+
+   /** $var Store */
+   protected $store = null;
+
+   /** $var Settings */
+   protected $settings = null;
+
+   /**
+* Sets Store object
+*
+* @since 1.9
+*
+* @param Store $store
+*/
+   public function setStore( Store $store ) {
+   $this-store = $store;
+   }
+
+   /**
+* Sets Settings object
+*
+* @since 1.9
+*
+* @param Store $store
+*/
+   public function setSettings( Settings $settings ) {
+   $this-settings = $settings;
+   }
+
+   /**
+* Returns settings object
+*
+* @since 1.9
+*
+* @return Settings
+*/
+   public function getSettings() {
+
+   if ( $this-settings === null ) {
+   $this-settings = Settings::newFromGlobals();
+   }
+
+   return $this-settings;
+   }
+}
diff --git a/includes/jobs/PropertySubjectsUpdateDispatcherJob.php 
b/includes/jobs/PropertySubjectsUpdateDispatcherJob.php
index e0d4142..284495e 100644
--- a/includes/jobs/PropertySubjectsUpdateDispatcherJob.php
+++ b/includes/jobs/PropertySubjectsUpdateDispatcherJob.php
@@ -39,10 +39,7 @@
  * @ingroup Job
  * @ingroup Dispatcher
  */
-class PropertySubjectsUpdateDispatcherJob extends Job {
-
-   /** $var Store */
-   protected $store = null;
+class PropertySubjectsUpdateDispatcherJob extends JobBase {
 
/** $var Job */
protected $jobs = array();
@@ -60,17 +57,6 @@
public function __construct( Title $title, $params = array(), $id = 0 ) 
{
parent::__construct( 'SMW\PropertySubjectsUpdateDispatcherJob', 
$title, $params, $id );
$this-store = StoreFactory::getStore( isset( $params['store'] 
) ? 

[MediaWiki-commits] [Gerrit] Rename SMWUpdateJob to keep commit history - change (mediawiki...SemanticMediaWiki)

2013-07-20 Thread Mwjames (Code Review)
Mwjames has uploaded a new change for review.

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


Change subject: Rename SMWUpdateJob to keep commit history
..

Rename SMWUpdateJob to keep commit history

Change-Id: I8af0b11336771706f93ee2fe89981e89cf28df68
---
M includes/Setup.php
R includes/jobs/UpdateJob.php
2 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/includes/Setup.php b/includes/Setup.php
index c49793e..9a9ff03 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -418,8 +418,8 @@
 
// Jobs
$wgJobClasses['SMWUpdateJob']   = 'SMWUpdateJob';
-   $wgAutoloadClasses['SMWUpdateJob']  = $smwgIP . 
'includes/jobs/SMW_UpdateJob.php';
-   $wgAutoloadClasses['SMW\UpdateJob']  = $smwgIP . 
'includes/jobs/SMW_UpdateJob.php'; // 1.9
+   $wgAutoloadClasses['SMWUpdateJob']  = $smwgIP . 
'includes/jobs/UpdateJob.php';
+   $wgAutoloadClasses['SMW\UpdateJob']  = $smwgIP . 
'includes/jobs/UpdateJob.php'; // 1.9
$wgJobClasses['SMWRefreshJob']  = 'SMWRefreshJob';
$wgAutoloadClasses['SMWRefreshJob'] = $smwgIP . 
'includes/jobs/SMW_RefreshJob.php';
 
diff --git a/includes/jobs/SMW_UpdateJob.php b/includes/jobs/UpdateJob.php
similarity index 100%
rename from includes/jobs/SMW_UpdateJob.php
rename to includes/jobs/UpdateJob.php

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8af0b11336771706f93ee2fe89981e89cf28df68
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticMediaWiki
Gerrit-Branch: master
Gerrit-Owner: Mwjames jamesin.hongkon...@gmail.com

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


[MediaWiki-commits] [Gerrit] Rename SMWUpdateJob to keep commit history - change (mediawiki...SemanticMediaWiki)

2013-07-20 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Rename SMWUpdateJob to keep commit history
..


Rename SMWUpdateJob to keep commit history

Change-Id: I8af0b11336771706f93ee2fe89981e89cf28df68
---
M includes/Setup.php
R includes/jobs/UpdateJob.php
2 files changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/includes/Setup.php b/includes/Setup.php
index c49793e..9a9ff03 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -418,8 +418,8 @@
 
// Jobs
$wgJobClasses['SMWUpdateJob']   = 'SMWUpdateJob';
-   $wgAutoloadClasses['SMWUpdateJob']  = $smwgIP . 
'includes/jobs/SMW_UpdateJob.php';
-   $wgAutoloadClasses['SMW\UpdateJob']  = $smwgIP . 
'includes/jobs/SMW_UpdateJob.php'; // 1.9
+   $wgAutoloadClasses['SMWUpdateJob']  = $smwgIP . 
'includes/jobs/UpdateJob.php';
+   $wgAutoloadClasses['SMW\UpdateJob']  = $smwgIP . 
'includes/jobs/UpdateJob.php'; // 1.9
$wgJobClasses['SMWRefreshJob']  = 'SMWRefreshJob';
$wgAutoloadClasses['SMWRefreshJob'] = $smwgIP . 
'includes/jobs/SMW_RefreshJob.php';
 
diff --git a/includes/jobs/SMW_UpdateJob.php b/includes/jobs/UpdateJob.php
similarity index 100%
rename from includes/jobs/SMW_UpdateJob.php
rename to includes/jobs/UpdateJob.php

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8af0b11336771706f93ee2fe89981e89cf28df68
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticMediaWiki
Gerrit-Branch: master
Gerrit-Owner: Mwjames jamesin.hongkon...@gmail.com
Gerrit-Reviewer: Mwjames jamesin.hongkon...@gmail.com
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Add newline at end of file otherwise translatewiki.net scrip... - change (mediawiki...MassMessage)

2013-07-20 Thread Raimond Spekking (Code Review)
Raimond Spekking has submitted this change and it was merged.

Change subject: Add newline at end of file otherwise translatewiki.net scripts 
break
..


Add newline at end of file otherwise translatewiki.net scripts break

Change-Id: I4f1550065b09f9f5bdc2afd2a52509d1fdf8074a
---
M MassMessage.i18n.php
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Raimond Spekking: Verified; Looks good to me, approved



diff --git a/MassMessage.i18n.php b/MassMessage.i18n.php
index ebc7882..1c2af65 100644
--- a/MassMessage.i18n.php
+++ b/MassMessage.i18n.php
@@ -55,5 +55,4 @@
'log-name-massmessage' = 'Log page title',
'log-description-massmessage' = 'Log page description',
'logentry-massmessage-send' = '{{logentry}}'
-
-);
\ No newline at end of file
+);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4f1550065b09f9f5bdc2afd2a52509d1fdf8074a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] Add newline at end of file otherwise translatewiki.net scrip... - change (mediawiki...MassMessage)

2013-07-20 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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


Change subject: Add newline at end of file otherwise translatewiki.net scripts 
break
..

Add newline at end of file otherwise translatewiki.net scripts break

Change-Id: I4f1550065b09f9f5bdc2afd2a52509d1fdf8074a
---
M MassMessage.i18n.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage 
refs/changes/42/74842/1

diff --git a/MassMessage.i18n.php b/MassMessage.i18n.php
index ebc7882..1c2af65 100644
--- a/MassMessage.i18n.php
+++ b/MassMessage.i18n.php
@@ -55,5 +55,4 @@
'log-name-massmessage' = 'Log page title',
'log-description-massmessage' = 'Log page description',
'logentry-massmessage-send' = '{{logentry}}'
-
-);
\ No newline at end of file
+);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f1550065b09f9f5bdc2afd2a52509d1fdf8074a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] [MassMessage] Register extension - change (translatewiki)

2013-07-20 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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


Change subject: [MassMessage] Register extension
..

[MassMessage] Register extension

Change-Id: Ib316379207a8e00390f961106132ff9b8d2704fb
---
M groups/MediaWiki/mediawiki-defines.txt
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/43/74843/1

diff --git a/groups/MediaWiki/mediawiki-defines.txt 
b/groups/MediaWiki/mediawiki-defines.txt
index 43f9c87..29a1fd2 100644
--- a/groups/MediaWiki/mediawiki-defines.txt
+++ b/groups/MediaWiki/mediawiki-defines.txt
@@ -805,6 +805,8 @@
 Mass Edit Regex
 aliasfile = MassEditRegex/MassEditRegex.alias.php
 
+Mass Message
+
 Math
 
 Math Search

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib316379207a8e00390f961106132ff9b8d2704fb
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] Add Nischay to credits - change (mediawiki...UploadWizard)

2013-07-20 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add Nischay to credits
..


Add Nischay to credits

Change-Id: I8c757cc044658cac876b8d69f613514b1fcabbe1
GitHub: https://github.com/wikimedia/mediawiki-extensions-UploadWizard/pull/8
---
M README
M UploadWizard.php
2 files changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Alex Monk: Looks good to me, approved
  Jeroen De Dauw: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/README b/README
index de15375..8fc1f13 100644
--- a/README
+++ b/README
@@ -11,4 +11,5 @@
 @author Jeroen de Dauw jereoended...@gmail.com
 @author Ryan Kaldari rkald...@wikimedia.org
 @author Ian Baker iba...@wikimedia.org
+@author Nischay Nahata nischay...@gmail.com
 @author Yuvi Panda yuvipa...@gmail.com
diff --git a/UploadWizard.php b/UploadWizard.php
index 417c973..b8b78c6 100644
--- a/UploadWizard.php
+++ b/UploadWizard.php
@@ -28,7 +28,7 @@
 $wgExtensionCredits['other'][] = array(
'path' = __FILE__,
'name' = 'Upload Wizard',
-   'author' = array( 'Neil Kandalgaonkar', 'Jeroen De Dauw', 'Mark 
Holmquist', 'Ryan Kaldari', 'Michael Dale', 'Ankur Anand', 'Yuvi Panda' ),
+   'author' = array( 'Neil Kandalgaonkar', 'Jeroen De Dauw', 'Mark 
Holmquist', 'Ryan Kaldari', 'Michael Dale', 'Ankur Anand', 'Nischay Nahata', 
'Yuvi Panda' ),
'version' = '1.3',
'descriptionmsg' = 'uploadwizard-desc',
'url' = 'https://www.mediawiki.org/wiki/Extension:UploadWizard'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8c757cc044658cac876b8d69f613514b1fcabbe1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: SuchABot yuvipanda+sucha...@gmail.com
Gerrit-Reviewer: Alex Monk kren...@gmail.com
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Move source files into src directory - change (mediawiki...Diff)

2013-07-20 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Move source files into src directory
..

Move source files into src directory

Change-Id: Ia8b3b733104ec446dabff982102bd83b91380767
---
M Diff.classes.php
R src/Appendable.php
R src/ArrayComparer/ArrayComparer.php
R src/ArrayComparer/NativeArrayComparer.php
R src/ArrayComparer/StrategicArrayComparer.php
R src/ArrayComparer/StrictArrayComparer.php
R src/Comparer/CallbackComparer.php
R src/Comparer/StrictComparer.php
R src/Comparer/ValueComparer.php
R src/DiffOpFactory.php
R src/differ/CallbackListDiffer.php
R src/differ/Differ.php
R src/differ/ListDiffer.php
R src/differ/MapDiffer.php
R src/diffop/AtomicDiffOp.php
R src/diffop/DiffOp.php
R src/diffop/DiffOpAdd.php
R src/diffop/DiffOpChange.php
R src/diffop/DiffOpRemove.php
R src/diffop/diff/Diff.php
R src/diffop/diff/IDiff.php
R src/diffop/diff/ListDiff.php
R src/diffop/diff/MapDiff.php
R src/patcher/ListPatcher.php
R src/patcher/MapPatcher.php
R src/patcher/Patcher.php
R src/patcher/PatcherException.php
R src/patcher/PreviewablePatcher.php
R src/patcher/ThrowingPatcher.php
29 files changed, 29 insertions(+), 29 deletions(-)


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

diff --git a/Diff.classes.php b/Diff.classes.php
index 3152655..9ec55da 100644
--- a/Diff.classes.php
+++ b/Diff.classes.php
@@ -12,41 +12,41 @@
  * @author Jeroen De Dauw  jeroended...@gmail.com 
  */
 return array(
-   'Diff\Appendable' = 'includes/Appendable.php',
-   'Diff\DiffOpFactory' = 'includes/DiffOpFactory.php',
+   'Diff\Appendable' = 'src/Appendable.php',
+   'Diff\DiffOpFactory' = 'src/DiffOpFactory.php',
 
-   'Diff\ArrayComparer\ArrayComparer' = 
'includes/ArrayComparer/ArrayComparer.php',
-   'Diff\ArrayComparer\NativeArrayComparer' = 
'includes/ArrayComparer/NativeArrayComparer.php',
-   'Diff\ArrayComparer\StrategicArrayComparer' = 
'includes/ArrayComparer/StrategicArrayComparer.php',
-   'Diff\ArrayComparer\StrictArrayComparer' = 
'includes/ArrayComparer/StrictArrayComparer.php',
+   'Diff\ArrayComparer\ArrayComparer' = 
'src/ArrayComparer/ArrayComparer.php',
+   'Diff\ArrayComparer\NativeArrayComparer' = 
'src/ArrayComparer/NativeArrayComparer.php',
+   'Diff\ArrayComparer\StrategicArrayComparer' = 
'src/ArrayComparer/StrategicArrayComparer.php',
+   'Diff\ArrayComparer\StrictArrayComparer' = 
'src/ArrayComparer/StrictArrayComparer.php',
 
-   'Diff\Comparer\CallbackComparer' = 
'includes/Comparer/CallbackComparer.php',
-   'Diff\Comparer\StrictComparer' = 
'includes/Comparer/StrictComparer.php',
-   'Diff\Comparer\ValueComparer' = 'includes/Comparer/ValueComparer.php',
+   'Diff\Comparer\CallbackComparer' = 'src/Comparer/CallbackComparer.php',
+   'Diff\Comparer\StrictComparer' = 'src/Comparer/StrictComparer.php',
+   'Diff\Comparer\ValueComparer' = 'src/Comparer/ValueComparer.php',
 
-   'Diff\CallbackListDiffer' = 'includes/differ/CallbackListDiffer.php',
-   'Diff\Differ' = 'includes/differ/Differ.php',
-   'Diff\ListDiffer' = 'includes/differ/ListDiffer.php',
-   'Diff\MapDiffer' = 'includes/differ/MapDiffer.php',
+   'Diff\CallbackListDiffer' = 'src/differ/CallbackListDiffer.php',
+   'Diff\Differ' = 'src/differ/Differ.php',
+   'Diff\ListDiffer' = 'src/differ/ListDiffer.php',
+   'Diff\MapDiffer' = 'src/differ/MapDiffer.php',
 
-   'Diff\AtomicDiffOp' = 'includes/diffop/AtomicDiffOp.php',
-   'Diff\DiffOp' = 'includes/diffop/DiffOp.php',
-   'Diff\IDiffOp' = 'includes/diffop/DiffOp.php',
-   'Diff\DiffOpAdd' = 'includes/diffop/DiffOpAdd.php',
-   'Diff\DiffOpChange' = 'includes/diffop/DiffOpChange.php',
-   'Diff\DiffOpRemove' = 'includes/diffop/DiffOpRemove.php',
+   'Diff\AtomicDiffOp' = 'src/diffop/AtomicDiffOp.php',
+   'Diff\DiffOp' = 'src/diffop/DiffOp.php',
+   'Diff\IDiffOp' = 'src/diffop/DiffOp.php',
+   'Diff\DiffOpAdd' = 'src/diffop/DiffOpAdd.php',
+   'Diff\DiffOpChange' = 'src/diffop/DiffOpChange.php',
+   'Diff\DiffOpRemove' = 'src/diffop/DiffOpRemove.php',
 
-   'Diff\ListPatcher' = 'includes/patcher/ListPatcher.php',
-   'Diff\MapPatcher' = 'includes/patcher/MapPatcher.php',
-   'Diff\Patcher' = 'includes/patcher/Patcher.php',
-   'Diff\PatcherException' = 'includes/patcher/PatcherException.php',
-   'Diff\PreviewablePatcher' = 'includes/patcher/PreviewablePatcher.php',
-   'Diff\ThrowingPatcher' = 'includes/patcher/ThrowingPatcher.php',
+   'Diff\ListPatcher' = 'src/patcher/ListPatcher.php',
+   'Diff\MapPatcher' = 'src/patcher/MapPatcher.php',
+   'Diff\Patcher' = 'src/patcher/Patcher.php',
+   'Diff\PatcherException' = 'src/patcher/PatcherException.php',
+   'Diff\PreviewablePatcher' = 'src/patcher/PreviewablePatcher.php',
+  

[MediaWiki-commits] [Gerrit] Removed obsolete tests/phpunit.php test runner - change (mediawiki...Diff)

2013-07-20 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Removed obsolete tests/phpunit.php test runner
..

Removed obsolete tests/phpunit.php test runner

Change-Id: Ic7cb6e0517b71d988812b50477ef0cdefac51bd9
---
M RELEASE-NOTES
D tests/phpunit.php
2 files changed, 4 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Diff 
refs/changes/45/74845/1

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 157ccfa..655aa51 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -11,6 +11,10 @@
 * MapPatcher will now report conflicts for remove operations that specify a 
value to be removed
 different from the value in the structure being patched.
 
+; Removals
+
+* Removed obsolete tests/phpunit.php test runner
+
 === Version 0.7 ===
 2013-07-16
 
diff --git a/tests/phpunit.php b/tests/phpunit.php
deleted file mode 100755
index e0bfc4f..000
--- a/tests/phpunit.php
+++ /dev/null
@@ -1,28 +0,0 @@
-?php
-
-require_once( 'PHPUnit/Runner/Version.php' );
-
-if ( PHPUnit_Runner_Version::id() !== '@package_version@'
-version_compare( PHPUnit_Runner_Version::id(), '3.7', '' )
-) {
-   die( 'PHPUnit 3.7 or later required, you have ' . 
PHPUnit_Runner_Version::id() . .\n );
-}
-
-require_once( 'PHPUnit/Autoload.php' );
-
-require_once( __DIR__ . '/bootstrap.php' );
-
-echo 'Running tests for Diff version ' . Diff_VERSION . .\n;
-
-$arguments = $_SERVER['argv'];
-array_shift( $arguments );
-
-if ( array_search( '--group', $arguments ) === false ) {
-   $arguments[] = '--group';
-   $arguments[] = 'Diff';
-}
-
-$arguments[] = __DIR__;
-
-$runner = new PHPUnit_TextUI_Command();
-$runner-run( $arguments );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7cb6e0517b71d988812b50477ef0cdefac51bd9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Diff
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com

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


[MediaWiki-commits] [Gerrit] Added usage docs and examples to README file - change (mediawiki...Diff)

2013-07-20 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Added usage docs and examples to README file
..

Added usage docs and examples to README file

Change-Id: I9acee08f0c85e3a34c1f650679e9b6ce19a8c277
---
M README.md
1 file changed, 191 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Diff 
refs/changes/46/74846/1

diff --git a/README.md b/README.md
index 6c65699..db52dba 100644
--- a/README.md
+++ b/README.md
@@ -40,8 +40,197 @@
 
 ## Usage
 
-The [extension page on 
mediawiki.org](https://www.mediawiki.org/wiki/Extension:Diff)
-contains the documentation and examples for this library.
+The Diff library can be subdivided into 3 components.
+
+### DiffOp
+
+First and foremost are the objects to represent diffs. Diffs are represented 
by the Diff class, which
+is an aggregate for diff operations, think add and remove, that all extend 
from DiffOp. Diff
+itself is a DiffOp, since the library supports recursion, and thus has the 
need to be able to
+represent nested diffs.
+
+The available DiffOps are:
+
+* DiffOpAdd - addition of a value (newValue)
+* DiffOpChange - modification of a value (oldValue, newValue)
+* DiffOpRemove - removal of a value (oldValue)
+* Diff - a collection of diff operations
+
+These can all be found in codeincludes/diffop/code.
+
+The Diff class can be set to be either associative or non-assocative. In case 
of the later, only
+DiffOpAdd and DiffOpRemove are allowed in it.
+
+### Differ
+
+Often you need to construct a diff between two arrays, rather then creating it 
manually. To do this,
+the Diff library includes a few classes implementing the Differ interface, 
which contains one very
+simple method.
+
+```php
+/**
+ * Takes two arrays, computes the diff, and returns this diff as an array of 
DiffOp.
+ *
+ * @since 0.1
+ *
+ * @param array $oldValues The first array
+ * @param array $newValues The second array
+ *
+ * @throws Exception
+ * @return DiffOp[]
+ */
+public function doDiff( array $oldValues, array $newValues );
+```
+
+The Differs that come with the library are:
+
+* ListDiffer: Differ that only looks at the values of the arrays (and thus 
ignores key differences).
+* MapDiffer: Differ that does an associative diff between two arrays, with the 
option to do this recursively.
+
+Both Differ objects come with a few options that can be used to change their 
behaviour.
+
+All differ functionality can be found in codeincludes/differ/code.
+
+### Patcher
+
+The third component that comes with the Diff library is a set of classes 
implementing the Patcher
+interface. This interface contains a single simple method:
+
+```php
+/**
+ * Applies the applicable operations from the provided diff to
+ * the provided base value.
+ *
+ * @since 0.1
+ *
+ * @param array $base
+ * @param Diff $diffOps
+ *
+ * @return array
+ */
+public function patch( array $base, Diff $diffOps );
+```
+
+Diff comes with two clases implementing the Patcher interface:
+
+* ListPatcher: Applies non-associative diffs to a base. With default options 
does the reverse of ListDiffer
+* MapPatcher: Applies diff to a base, recursivly if needed. With default 
options does the reverse of MapDiffer
+
+All classes part of the patcher component can be found in 
codeincludes/patcher/code
+
+### Comparer
+
+Added in 0.6
+
+TODO
+
+### Merger
+
+Added in 0.7
+
+TODO
+
+## Examples
+
+; DiffOp:
+
+```php
+// Constructing an empty diff
+$diff = new Diff();
+
+// Adding a single add-operation to the diff
+$diff[] = new DiffOpAdd( 'added value' );
+
+// Adding a single change-operation to the diff for key awesomeness
+$diff['awesomeness'] = new DiffOpChange( 9000, 9001 );
+
+// Getting an array with the change operations from the Diff
+$changeOps = $diff-getChanges();
+
+// Creating a new diff with a set op DiffOps, and specifying that it is an 
associative diff
+$diff = new Diff( $changeOps, true );
+
+// Looping over the diff operations that make up the diff
+foreach ( $diff as $diffOp ) {}
+
+// Removing the awesomeness operation from the diff
+unset( $diff['awesomeness'] );
+
+// Adding a non-associative diff with one add operation to the diff for the 
recursion key
+$diff['recursion'] = new Diff( array( DiffOpAdd( 42 ) ), false );
+
+// Counting the number of diff operations that make up the diff
+count( $diff );
+```
+
+; Differ
+
+```php
+$oldValues = array( 0, 1, 2, 42, 9001, 'foobar' );
+$newValues = array( 0, 0, 23, 'foobar', 1, 2 );
+
+$differ = new ListDiffer();
+
+$diffOps = $differ-doDiff( $oldValues, $newValues );
+
+// This is the result
+$diffOps = array(
+DiffOpRemove( 42 ),
+DiffOpRemove( 9001 )
+DiffOpAdd( 0 ),
+DiffOpAdd( 23 )
+);
+```
+
+```php
+$oldValues = array( 'a' = 0, 'b' = array( 'c' = 0, 'd' = 1 ) );
+$newValues = array( 'a' = 1, 'b' = array( 'c' = 10, 'd' = 1 ), 'e' = 42 );
+
+$differ = new MapDiffer();
+

[MediaWiki-commits] [Gerrit] [MassMessage] Register extension - change (translatewiki)

2013-07-20 Thread Raimond Spekking (Code Review)
Raimond Spekking has submitted this change and it was merged.

Change subject: [MassMessage] Register extension
..


[MassMessage] Register extension

Change-Id: Ib316379207a8e00390f961106132ff9b8d2704fb
---
M groups/MediaWiki/mediawiki-defines.txt
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Raimond Spekking: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/groups/MediaWiki/mediawiki-defines.txt 
b/groups/MediaWiki/mediawiki-defines.txt
index 43f9c87..29a1fd2 100644
--- a/groups/MediaWiki/mediawiki-defines.txt
+++ b/groups/MediaWiki/mediawiki-defines.txt
@@ -805,6 +805,8 @@
 Mass Edit Regex
 aliasfile = MassEditRegex/MassEditRegex.alias.php
 
+Mass Message
+
 Math
 
 Math Search

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib316379207a8e00390f961106132ff9b8d2704fb
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Move source files into src directory - change (mediawiki...Diff)

2013-07-20 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Move source files into src directory
..


Move source files into src directory

Change-Id: Ia8b3b733104ec446dabff982102bd83b91380767
---
M Diff.classes.php
R src/Appendable.php
R src/ArrayComparer/ArrayComparer.php
R src/ArrayComparer/NativeArrayComparer.php
R src/ArrayComparer/StrategicArrayComparer.php
R src/ArrayComparer/StrictArrayComparer.php
R src/Comparer/CallbackComparer.php
R src/Comparer/StrictComparer.php
R src/Comparer/ValueComparer.php
R src/DiffOpFactory.php
R src/differ/CallbackListDiffer.php
R src/differ/Differ.php
R src/differ/ListDiffer.php
R src/differ/MapDiffer.php
R src/diffop/AtomicDiffOp.php
R src/diffop/DiffOp.php
R src/diffop/DiffOpAdd.php
R src/diffop/DiffOpChange.php
R src/diffop/DiffOpRemove.php
R src/diffop/diff/Diff.php
R src/diffop/diff/IDiff.php
R src/diffop/diff/ListDiff.php
R src/diffop/diff/MapDiff.php
R src/patcher/ListPatcher.php
R src/patcher/MapPatcher.php
R src/patcher/Patcher.php
R src/patcher/PatcherException.php
R src/patcher/PreviewablePatcher.php
R src/patcher/ThrowingPatcher.php
29 files changed, 29 insertions(+), 29 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved



diff --git a/Diff.classes.php b/Diff.classes.php
index 3152655..9ec55da 100644
--- a/Diff.classes.php
+++ b/Diff.classes.php
@@ -12,41 +12,41 @@
  * @author Jeroen De Dauw  jeroended...@gmail.com 
  */
 return array(
-   'Diff\Appendable' = 'includes/Appendable.php',
-   'Diff\DiffOpFactory' = 'includes/DiffOpFactory.php',
+   'Diff\Appendable' = 'src/Appendable.php',
+   'Diff\DiffOpFactory' = 'src/DiffOpFactory.php',
 
-   'Diff\ArrayComparer\ArrayComparer' = 
'includes/ArrayComparer/ArrayComparer.php',
-   'Diff\ArrayComparer\NativeArrayComparer' = 
'includes/ArrayComparer/NativeArrayComparer.php',
-   'Diff\ArrayComparer\StrategicArrayComparer' = 
'includes/ArrayComparer/StrategicArrayComparer.php',
-   'Diff\ArrayComparer\StrictArrayComparer' = 
'includes/ArrayComparer/StrictArrayComparer.php',
+   'Diff\ArrayComparer\ArrayComparer' = 
'src/ArrayComparer/ArrayComparer.php',
+   'Diff\ArrayComparer\NativeArrayComparer' = 
'src/ArrayComparer/NativeArrayComparer.php',
+   'Diff\ArrayComparer\StrategicArrayComparer' = 
'src/ArrayComparer/StrategicArrayComparer.php',
+   'Diff\ArrayComparer\StrictArrayComparer' = 
'src/ArrayComparer/StrictArrayComparer.php',
 
-   'Diff\Comparer\CallbackComparer' = 
'includes/Comparer/CallbackComparer.php',
-   'Diff\Comparer\StrictComparer' = 
'includes/Comparer/StrictComparer.php',
-   'Diff\Comparer\ValueComparer' = 'includes/Comparer/ValueComparer.php',
+   'Diff\Comparer\CallbackComparer' = 'src/Comparer/CallbackComparer.php',
+   'Diff\Comparer\StrictComparer' = 'src/Comparer/StrictComparer.php',
+   'Diff\Comparer\ValueComparer' = 'src/Comparer/ValueComparer.php',
 
-   'Diff\CallbackListDiffer' = 'includes/differ/CallbackListDiffer.php',
-   'Diff\Differ' = 'includes/differ/Differ.php',
-   'Diff\ListDiffer' = 'includes/differ/ListDiffer.php',
-   'Diff\MapDiffer' = 'includes/differ/MapDiffer.php',
+   'Diff\CallbackListDiffer' = 'src/differ/CallbackListDiffer.php',
+   'Diff\Differ' = 'src/differ/Differ.php',
+   'Diff\ListDiffer' = 'src/differ/ListDiffer.php',
+   'Diff\MapDiffer' = 'src/differ/MapDiffer.php',
 
-   'Diff\AtomicDiffOp' = 'includes/diffop/AtomicDiffOp.php',
-   'Diff\DiffOp' = 'includes/diffop/DiffOp.php',
-   'Diff\IDiffOp' = 'includes/diffop/DiffOp.php',
-   'Diff\DiffOpAdd' = 'includes/diffop/DiffOpAdd.php',
-   'Diff\DiffOpChange' = 'includes/diffop/DiffOpChange.php',
-   'Diff\DiffOpRemove' = 'includes/diffop/DiffOpRemove.php',
+   'Diff\AtomicDiffOp' = 'src/diffop/AtomicDiffOp.php',
+   'Diff\DiffOp' = 'src/diffop/DiffOp.php',
+   'Diff\IDiffOp' = 'src/diffop/DiffOp.php',
+   'Diff\DiffOpAdd' = 'src/diffop/DiffOpAdd.php',
+   'Diff\DiffOpChange' = 'src/diffop/DiffOpChange.php',
+   'Diff\DiffOpRemove' = 'src/diffop/DiffOpRemove.php',
 
-   'Diff\ListPatcher' = 'includes/patcher/ListPatcher.php',
-   'Diff\MapPatcher' = 'includes/patcher/MapPatcher.php',
-   'Diff\Patcher' = 'includes/patcher/Patcher.php',
-   'Diff\PatcherException' = 'includes/patcher/PatcherException.php',
-   'Diff\PreviewablePatcher' = 'includes/patcher/PreviewablePatcher.php',
-   'Diff\ThrowingPatcher' = 'includes/patcher/ThrowingPatcher.php',
+   'Diff\ListPatcher' = 'src/patcher/ListPatcher.php',
+   'Diff\MapPatcher' = 'src/patcher/MapPatcher.php',
+   'Diff\Patcher' = 'src/patcher/Patcher.php',
+   'Diff\PatcherException' = 'src/patcher/PatcherException.php',
+   'Diff\PreviewablePatcher' = 'src/patcher/PreviewablePatcher.php',
+   'Diff\ThrowingPatcher' = 'src/patcher/ThrowingPatcher.php',
 
-   

[MediaWiki-commits] [Gerrit] Added usage docs and examples to README file - change (mediawiki...Diff)

2013-07-20 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Added usage docs and examples to README file
..


Added usage docs and examples to README file

Change-Id: I9acee08f0c85e3a34c1f650679e9b6ce19a8c277
---
M README.md
1 file changed, 191 insertions(+), 2 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved



diff --git a/README.md b/README.md
index 6c65699..db52dba 100644
--- a/README.md
+++ b/README.md
@@ -40,8 +40,197 @@
 
 ## Usage
 
-The [extension page on 
mediawiki.org](https://www.mediawiki.org/wiki/Extension:Diff)
-contains the documentation and examples for this library.
+The Diff library can be subdivided into 3 components.
+
+### DiffOp
+
+First and foremost are the objects to represent diffs. Diffs are represented 
by the Diff class, which
+is an aggregate for diff operations, think add and remove, that all extend 
from DiffOp. Diff
+itself is a DiffOp, since the library supports recursion, and thus has the 
need to be able to
+represent nested diffs.
+
+The available DiffOps are:
+
+* DiffOpAdd - addition of a value (newValue)
+* DiffOpChange - modification of a value (oldValue, newValue)
+* DiffOpRemove - removal of a value (oldValue)
+* Diff - a collection of diff operations
+
+These can all be found in codeincludes/diffop/code.
+
+The Diff class can be set to be either associative or non-assocative. In case 
of the later, only
+DiffOpAdd and DiffOpRemove are allowed in it.
+
+### Differ
+
+Often you need to construct a diff between two arrays, rather then creating it 
manually. To do this,
+the Diff library includes a few classes implementing the Differ interface, 
which contains one very
+simple method.
+
+```php
+/**
+ * Takes two arrays, computes the diff, and returns this diff as an array of 
DiffOp.
+ *
+ * @since 0.1
+ *
+ * @param array $oldValues The first array
+ * @param array $newValues The second array
+ *
+ * @throws Exception
+ * @return DiffOp[]
+ */
+public function doDiff( array $oldValues, array $newValues );
+```
+
+The Differs that come with the library are:
+
+* ListDiffer: Differ that only looks at the values of the arrays (and thus 
ignores key differences).
+* MapDiffer: Differ that does an associative diff between two arrays, with the 
option to do this recursively.
+
+Both Differ objects come with a few options that can be used to change their 
behaviour.
+
+All differ functionality can be found in codeincludes/differ/code.
+
+### Patcher
+
+The third component that comes with the Diff library is a set of classes 
implementing the Patcher
+interface. This interface contains a single simple method:
+
+```php
+/**
+ * Applies the applicable operations from the provided diff to
+ * the provided base value.
+ *
+ * @since 0.1
+ *
+ * @param array $base
+ * @param Diff $diffOps
+ *
+ * @return array
+ */
+public function patch( array $base, Diff $diffOps );
+```
+
+Diff comes with two clases implementing the Patcher interface:
+
+* ListPatcher: Applies non-associative diffs to a base. With default options 
does the reverse of ListDiffer
+* MapPatcher: Applies diff to a base, recursivly if needed. With default 
options does the reverse of MapDiffer
+
+All classes part of the patcher component can be found in 
codeincludes/patcher/code
+
+### Comparer
+
+Added in 0.6
+
+TODO
+
+### Merger
+
+Added in 0.7
+
+TODO
+
+## Examples
+
+; DiffOp:
+
+```php
+// Constructing an empty diff
+$diff = new Diff();
+
+// Adding a single add-operation to the diff
+$diff[] = new DiffOpAdd( 'added value' );
+
+// Adding a single change-operation to the diff for key awesomeness
+$diff['awesomeness'] = new DiffOpChange( 9000, 9001 );
+
+// Getting an array with the change operations from the Diff
+$changeOps = $diff-getChanges();
+
+// Creating a new diff with a set op DiffOps, and specifying that it is an 
associative diff
+$diff = new Diff( $changeOps, true );
+
+// Looping over the diff operations that make up the diff
+foreach ( $diff as $diffOp ) {}
+
+// Removing the awesomeness operation from the diff
+unset( $diff['awesomeness'] );
+
+// Adding a non-associative diff with one add operation to the diff for the 
recursion key
+$diff['recursion'] = new Diff( array( DiffOpAdd( 42 ) ), false );
+
+// Counting the number of diff operations that make up the diff
+count( $diff );
+```
+
+; Differ
+
+```php
+$oldValues = array( 0, 1, 2, 42, 9001, 'foobar' );
+$newValues = array( 0, 0, 23, 'foobar', 1, 2 );
+
+$differ = new ListDiffer();
+
+$diffOps = $differ-doDiff( $oldValues, $newValues );
+
+// This is the result
+$diffOps = array(
+DiffOpRemove( 42 ),
+DiffOpRemove( 9001 )
+DiffOpAdd( 0 ),
+DiffOpAdd( 23 )
+);
+```
+
+```php
+$oldValues = array( 'a' = 0, 'b' = array( 'c' = 0, 'd' = 1 ) );
+$newValues = array( 'a' = 1, 'b' = array( 'c' = 10, 'd' = 1 ), 'e' = 42 );
+
+$differ = new MapDiffer();
+
+$diffOps = $differ-doDiff( $oldValues, $newValues );
+
+// This is 

[MediaWiki-commits] [Gerrit] Some tweaks. translatewiki.net script still breaks - change (mediawiki...MassMessage)

2013-07-20 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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


Change subject: Some tweaks. translatewiki.net script still breaks
..

Some tweaks. translatewiki.net script still breaks

Change-Id: Ic9f8ee9b9af4fb33f6ebf144cfde7ebec3b00514
---
M MassMessage.i18n.php
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage 
refs/changes/47/74847/1

diff --git a/MassMessage.i18n.php b/MassMessage.i18n.php
index 1c2af65..85a841b 100644
--- a/MassMessage.i18n.php
+++ b/MassMessage.i18n.php
@@ -9,11 +9,9 @@
 
 $messages = array();
 
-
 /** English
  * @author Kunal Mehta
  */
-
 $messages['en'] = array(
'massmessage' = 'Send mass message',
'massmessage-desc' = 'Allows users to easily send a message to a list 
of users',
@@ -31,7 +29,7 @@
'right-massmessage-global' = 'Send a message to multiple users on 
different wikis at once',
'log-name-massmessage' = 'Mass message log',
'log-description-massmessage' = 'These events track users sending 
messages through [[Special:MassMessage]].',
-   'logentry-massmessage-send' = '$1 {{GENDER:$2|sent a message}} to $3'
+   'logentry-massmessage-send' = '$1 {{GENDER:$2|sent a message}} to $3',
 );
 
 /** Message documentation
@@ -54,5 +52,5 @@
'right-massmessage-global' = '{{doc-right|massmessage-global}}',
'log-name-massmessage' = 'Log page title',
'log-description-massmessage' = 'Log page description',
-   'logentry-massmessage-send' = '{{logentry}}'
+   'logentry-massmessage-send' = '{{logentry}}',
 );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9f8ee9b9af4fb33f6ebf144cfde7ebec3b00514
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] Some tweaks. translatewiki.net script still breaks - change (mediawiki...MassMessage)

2013-07-20 Thread Raimond Spekking (Code Review)
Raimond Spekking has submitted this change and it was merged.

Change subject: Some tweaks. translatewiki.net script still breaks
..


Some tweaks. translatewiki.net script still breaks

Change-Id: Ic9f8ee9b9af4fb33f6ebf144cfde7ebec3b00514
---
M MassMessage.i18n.php
1 file changed, 2 insertions(+), 4 deletions(-)

Approvals:
  Raimond Spekking: Verified; Looks good to me, approved



diff --git a/MassMessage.i18n.php b/MassMessage.i18n.php
index 1c2af65..85a841b 100644
--- a/MassMessage.i18n.php
+++ b/MassMessage.i18n.php
@@ -9,11 +9,9 @@
 
 $messages = array();
 
-
 /** English
  * @author Kunal Mehta
  */
-
 $messages['en'] = array(
'massmessage' = 'Send mass message',
'massmessage-desc' = 'Allows users to easily send a message to a list 
of users',
@@ -31,7 +29,7 @@
'right-massmessage-global' = 'Send a message to multiple users on 
different wikis at once',
'log-name-massmessage' = 'Mass message log',
'log-description-massmessage' = 'These events track users sending 
messages through [[Special:MassMessage]].',
-   'logentry-massmessage-send' = '$1 {{GENDER:$2|sent a message}} to $3'
+   'logentry-massmessage-send' = '$1 {{GENDER:$2|sent a message}} to $3',
 );
 
 /** Message documentation
@@ -54,5 +52,5 @@
'right-massmessage-global' = '{{doc-right|massmessage-global}}',
'log-name-massmessage' = 'Log page title',
'log-description-massmessage' = 'Log page description',
-   'logentry-massmessage-send' = '{{logentry}}'
+   'logentry-massmessage-send' = '{{logentry}}',
 );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic9f8ee9b9af4fb33f6ebf144cfde7ebec3b00514
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] Replace generic::sysctl::ipv6-disable-ra - change (operations/puppet)

2013-07-20 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Replace generic::sysctl::ipv6-disable-ra
..


Replace generic::sysctl::ipv6-disable-ra

Now use sysctlfile::ipv6-disable-ra

Change-Id: I831348bba980f85d916eb116a8bdd36c3e300f0e
---
M manifests/generic-definitions.pp
M manifests/openstack.pp
A modules/sysctlfile/manifests/ipv6-disable-ra.pp
3 files changed, 10 insertions(+), 17 deletions(-)

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



diff --git a/manifests/generic-definitions.pp b/manifests/generic-definitions.pp
index fb71c00..1272cd8 100644
--- a/manifests/generic-definitions.pp
+++ b/manifests/generic-definitions.pp
@@ -786,22 +786,6 @@
}
 }
 
-class generic::sysctl::ipv6-disable-ra($ensure=present) {
-   if $::lsbdistid == Ubuntu and versioncmp($::lsbdistrelease, 10.04) 
= 0 {
-   file { ipv6-disable-ra:
-   name = /etc/sysctl.d/50-ipv6-disable-ra.conf,
-   owner = root,
-   group = root,
-   mode = 0444,
-   notify = Exec[/sbin/start procps],
-   source = 
puppet:///files/misc/50-ipv6-disable-ra.conf.sysctl,
-   ensure = $ensure
-   }
-   } else {
-   alert(Distribution on $hostname does not support 
/etc/sysctl.d/ files yet.)
-   }
-}
-
 class generic::sysctl::lvs($ensure=present) {
if $::lsbdistid == Ubuntu and versioncmp($::lsbdistrelease, 10.04) 
= 0 {
file { lvs-sysctl:
diff --git a/manifests/openstack.pp b/manifests/openstack.pp
index 96201f5..d4c28f9 100644
--- a/manifests/openstack.pp
+++ b/manifests/openstack.pp
@@ -588,7 +588,7 @@
 
# Enable IP forwarding
include sysctlfile::advanced-routing,
-   generic::sysctl::ipv6-disable-ra
+   sysctlfile::ipv6-disable-ra
 }
 
 class openstack::api-service($openstack_version=essex, $novaconfig) {
diff --git a/modules/sysctlfile/manifests/ipv6-disable-ra.pp 
b/modules/sysctlfile/manifests/ipv6-disable-ra.pp
new file mode 100644
index 000..9a67345
--- /dev/null
+++ b/modules/sysctlfile/manifests/ipv6-disable-ra.pp
@@ -0,0 +1,9 @@
+# sysctl values for ipv6-disable-ra
+class sysctlfile::ipv6-disable-ra($ensure=present) {
+sysctlfile {'ipv6-disable-ra':
+source = 'puppet:///modules/sysctlfile/50-ipv6-disable-ra.conf',
+number_prefix = '50',
+ensure = $ensure,
+notify = Exec[/sbin/start procps],
+}
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I831348bba980f85d916eb116a8bdd36c3e300f0e
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: Lcarr lc...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Adding role::analytics::kraken for common kraken client classes - change (operations/puppet)

2013-07-20 Thread Ottomata (Code Review)
Ottomata has uploaded a new change for review.

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


Change subject: Adding role::analytics::kraken for common kraken client classes
..

Adding role::analytics::kraken for common kraken client classes

Change-Id: I83cece49561a53c13959738924395d76dcc2bbf2
---
A manifests/role/analytics/kraken.pp
1 file changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/48/74848/1

diff --git a/manifests/role/analytics/kraken.pp 
b/manifests/role/analytics/kraken.pp
new file mode 100644
index 000..73fba6e
--- /dev/null
+++ b/manifests/role/analytics/kraken.pp
@@ -0,0 +1,15 @@
+# == Class role::analytics::kraken
+# Includes common analytics Kraken client classes:
+# - hadoop
+# - hive
+# - oozie
+# - pig
+# - sqoop
+#
+class role::analytics::kraken {
+include role::analytics::hadoop::client,
+role::analytics::hive::client,
+role::analytics::oozie::client,
+role::analytics::pig,
+role::analytics::sqoop
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83cece49561a53c13959738924395d76dcc2bbf2
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding role::analytics::kraken for common kraken client classes - change (operations/puppet)

2013-07-20 Thread Ottomata (Code Review)
Ottomata has submitted this change and it was merged.

Change subject: Adding role::analytics::kraken for common kraken client classes
..


Adding role::analytics::kraken for common kraken client classes

Change-Id: I83cece49561a53c13959738924395d76dcc2bbf2
---
A manifests/role/analytics/kraken.pp
1 file changed, 15 insertions(+), 0 deletions(-)

Approvals:
  Ottomata: Verified; Looks good to me, approved



diff --git a/manifests/role/analytics/kraken.pp 
b/manifests/role/analytics/kraken.pp
new file mode 100644
index 000..73fba6e
--- /dev/null
+++ b/manifests/role/analytics/kraken.pp
@@ -0,0 +1,15 @@
+# == Class role::analytics::kraken
+# Includes common analytics Kraken client classes:
+# - hadoop
+# - hive
+# - oozie
+# - pig
+# - sqoop
+#
+class role::analytics::kraken {
+include role::analytics::hadoop::client,
+role::analytics::hive::client,
+role::analytics::oozie::client,
+role::analytics::pig,
+role::analytics::sqoop
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I83cece49561a53c13959738924395d76dcc2bbf2
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata o...@wikimedia.org
Gerrit-Reviewer: Ottomata o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Renaming role::analytics::kraken to role::analytics::common - change (operations/puppet)

2013-07-20 Thread Ottomata (Code Review)
Ottomata has submitted this change and it was merged.

Change subject: Renaming role::analytics::kraken to role::analytics::common
..


Renaming role::analytics::kraken to role::analytics::common

Change-Id: Ibf164768e019257cdaf7761a284e5d018ba86f63
---
R manifests/role/analytics/common.pp
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Ottomata: Verified; Looks good to me, approved



diff --git a/manifests/role/analytics/kraken.pp 
b/manifests/role/analytics/common.pp
similarity index 66%
rename from manifests/role/analytics/kraken.pp
rename to manifests/role/analytics/common.pp
index 73fba6e..a23c9ab 100644
--- a/manifests/role/analytics/kraken.pp
+++ b/manifests/role/analytics/common.pp
@@ -1,12 +1,12 @@
-# == Class role::analytics::kraken
-# Includes common analytics Kraken client classes:
+# == Class role::analytics::common
+# Includes common analytics client classes:
 # - hadoop
 # - hive
 # - oozie
 # - pig
 # - sqoop
 #
-class role::analytics::kraken {
+class role::analytics::common {
 include role::analytics::hadoop::client,
 role::analytics::hive::client,
 role::analytics::oozie::client,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibf164768e019257cdaf7761a284e5d018ba86f63
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata o...@wikimedia.org
Gerrit-Reviewer: Ottomata o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Renaming role::analytics::kraken to role::analytics::common - change (operations/puppet)

2013-07-20 Thread Ottomata (Code Review)
Ottomata has uploaded a new change for review.

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


Change subject: Renaming role::analytics::kraken to role::analytics::common
..

Renaming role::analytics::kraken to role::analytics::common

Change-Id: Ibf164768e019257cdaf7761a284e5d018ba86f63
---
R manifests/role/analytics/common.pp
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/49/74849/1

diff --git a/manifests/role/analytics/kraken.pp 
b/manifests/role/analytics/common.pp
similarity index 66%
rename from manifests/role/analytics/kraken.pp
rename to manifests/role/analytics/common.pp
index 73fba6e..a23c9ab 100644
--- a/manifests/role/analytics/kraken.pp
+++ b/manifests/role/analytics/common.pp
@@ -1,12 +1,12 @@
-# == Class role::analytics::kraken
-# Includes common analytics Kraken client classes:
+# == Class role::analytics::common
+# Includes common analytics client classes:
 # - hadoop
 # - hive
 # - oozie
 # - pig
 # - sqoop
 #
-class role::analytics::kraken {
+class role::analytics::common {
 include role::analytics::hadoop::client,
 role::analytics::hive::client,
 role::analytics::oozie::client,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf164768e019257cdaf7761a284e5d018ba86f63
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Replace generic::sysctl::lvs - change (operations/puppet)

2013-07-20 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Replace generic::sysctl::lvs
..


Replace generic::sysctl::lvs

Now use sysctlfile::lvs

Change-Id: I60367b818e33571f2bfc0d4969658e5486ad6657
---
M manifests/generic-definitions.pp
M manifests/lvs.pp
A modules/sysctlfile/manifests/lvs.pp
3 files changed, 10 insertions(+), 15 deletions(-)

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



diff --git a/manifests/generic-definitions.pp b/manifests/generic-definitions.pp
index 1272cd8..6e063b1 100644
--- a/manifests/generic-definitions.pp
+++ b/manifests/generic-definitions.pp
@@ -786,20 +786,6 @@
}
 }
 
-class generic::sysctl::lvs($ensure=present) {
-   if $::lsbdistid == Ubuntu and versioncmp($::lsbdistrelease, 10.04) 
= 0 {
-   file { lvs-sysctl:
-   name = /etc/sysctl.d/50-lvs.conf,
-   mode = 0444,
-   notify = Exec[/sbin/start procps],
-   source = puppet:///files/misc/50-lvs.conf.sysctl,
-   ensure = $ensure
-   }
-   } else {
-   alert(Distribution on $hostname does not support 
/etc/sysctl.d/ files yet.)
-   }
-}
-
 class generic::sysfs::enable-rps {
upstart_job { enable-rps: install = true, start = true }
 }
diff --git a/manifests/lvs.pp b/manifests/lvs.pp
index be0011d..b2faaf0 100644
--- a/manifests/lvs.pp
+++ b/manifests/lvs.pp
@@ -830,7 +830,7 @@
 
# Sysctl settings
class { sysctlfile::advanced-routing: ensure = absent }
-   include generic::sysctl::lvs
+   include sysctlfile::lvs
 }
 
 # Supporting the PyBal RunCommand monitor
diff --git a/modules/sysctlfile/manifests/lvs.pp 
b/modules/sysctlfile/manifests/lvs.pp
new file mode 100644
index 000..4f72112
--- /dev/null
+++ b/modules/sysctlfile/manifests/lvs.pp
@@ -0,0 +1,9 @@
+# sysctl values for lvs
+class sysctlfile::lvs($ensure=present) {
+sysctlfile {'lvs':
+source = 'puppet:///modules/sysctlfile/50-lvs.conf',
+number_prefix = '50',
+ensure = $ensure,
+notify = Exec[/sbin/start procps],
+}
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I60367b818e33571f2bfc0d4969658e5486ad6657
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: Lcarr lc...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Moved the whole display of fields to PHP. - change (mediawiki...ProofreadPage)

2013-07-20 Thread Rtdwivedi (Code Review)
Rtdwivedi has uploaded a new change for review.

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


Change subject: Moved the whole display of fields to PHP.
..

Moved the whole display of fields to PHP.

Image is missing right now.

Change-Id: I6d5d75a98e87522d067fb09439befcb4cb83b7c6
---
M includes/page/EditProofreadPagePage.php
M modules/ext.proofreadpage.page/ext.proofreadpage.page.js
2 files changed, 58 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage 
refs/changes/50/74850/1

diff --git a/includes/page/EditProofreadPagePage.php 
b/includes/page/EditProofreadPagePage.php
index c021d95..d37d4b2 100644
--- a/includes/page/EditProofreadPagePage.php
+++ b/includes/page/EditProofreadPagePage.php
@@ -38,7 +38,6 @@
$value-setFooter( $this-safeUnicodeInput( $request, 
'wpFooterTextbox' ) );
$value-setLevel( $request-getInt( 'wpQuality' ) );
$value-setProofreaderFromName( $this-safeUnicodeInput( 
$request, 'wpProofreader' ) );
-
$this-textbox1 = $value-serialize();
}
 
@@ -62,7 +61,18 @@
 
'style' ='' );
$textareaAttributes += $inputAttributes;
$imageAttributes = array( 'id' = 'ProofReadImage' );
+   $summaryAttributes = array(
+   'class' 
= 'mw-summary',
+   'id' = 
'wpSummary',
+   
'maxlength' = '255',
+   
'tabindex' = '1',
+   'size' 
= '60',
+   
'spellcheck' = 'true',
+   'title' 
= 'Enter a short summary[alt-shift-b]',
+   
'accesskey' = 'b',
+   );
 
+   $page = ProofreadPagePage::newFromTitle( $this-mTitle );
if( $this-textbox1 ) {
$content = ProofreadPageContent::newFromWikitext( 
$this-textbox1 );
} else {
@@ -71,8 +81,50 @@
}
 
$text = $content-getBody();
+   $image = null;
+   $index = $page-getIndex();
+   if( $index ) {
+   $image = $index-getImage();
+   }
+   $url = $image-getUrl();
 
+   $wgOut-addHTML(
+   Html::element( 'label', array( 'for' = 
'wpHeaderTextbox'), wfMessage( 'proofreadpage_header' ) ) .
+   Html::textarea( 'wpHeaderTextbox', 
$content-getHeader(), array( 'id' = 'wpHeaderTextbox', 'rows' = '2', 'cols' 
= '80', 'tabindex' = '1') ) .
+   Html::element( 'label', array( 'for' = 'wpTextbox1'), 
wfMessage( 'proofreadpage_body' ) )
+   );
$wgOut-addHTML( Html::textarea( 'wpTextbox1', $text, 
$textareaAttributes ) );
+   $wgOut-addHTML(
+   Html::element( 'label', array( 'for' = 
'wpFooterTextbox'), wfMessage( 'proofreadpage_footer' ) ) .
+   Html::textarea( 'wpFooterTextbox', 
$content-getFooter(), array( 'id' = 'wpFooterTextbox', 'rows' = '2', 'cols' 
= '80', 'tabindex' = '1') )
+   );
+   $wgOut-addHTML( Html::element( 'img', array( 'id' = 
'ProofReadImage', 'src' = $url ) ) );
+   $wgOut-addHTML(
+   Html::openElement( 'span', array( 'class' = 
'mw-summary', 'id' = 'wpSummaryLabel') ) .
+   Html::element( 'label', array( 'for' = 'wpSummary'), 
'Summary:' ) .
+   Html::closeElement( 'span' ) .
+   Html::input( 'wpSummary', '/*Not Proofread */', '', 
$summaryAttributes ) .
+   Html::input( 'wpProofreader', '', 'hidden', array() ) .
+   Html::openElement( 'span', array( 'id' = 
'wpQuality-container') ) .
+   Html::openElement( 'span', array( 'class' = 
'quality0') ) .
+   Html::input( 'wpQuality', '0', 'radio', array( 
'tabindex' = '4', 'title' = 'Without text') ) .
+   Html::closeElement( 'span' ) .
+   Html::openElement( 'span', array( 'class' = 
'quality2') ) .
+   Html::input( 'wpQuality', '2', 'radio', array( 
'tabindex' = '4', 'title' = 'Problematic') ) .
+   Html::closeElement( 'span' ) .
+   Html::openElement( 'span', array( 'class' = 
'quality1') ) .
+   Html::input( 'wpQuality', 

[MediaWiki-commits] [Gerrit] Avoid Transaction already in progress errors in SiteStatsU... - change (mediawiki/core)

2013-07-20 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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


Change subject: Avoid Transaction already in progress errors in 
SiteStatsUpdate::doUpdate
..

Avoid Transaction already in progress errors in SiteStatsUpdate::doUpdate

Change-Id: I8c4ea7412e9f96912939c441c68090eacc42b3d4
---
M includes/SiteStats.php
1 file changed, 6 insertions(+), 8 deletions(-)


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

diff --git a/includes/SiteStats.php b/includes/SiteStats.php
index 199c64f..30dfc52 100644
--- a/includes/SiteStats.php
+++ b/includes/SiteStats.php
@@ -296,9 +296,12 @@
// The other times, just update pending delta values in 
memcached.
if ( $rate  ( $rate  0 || mt_rand( 0, $rate - 1 ) != 0 ) ) {
$this-doUpdatePendingDeltas();
-   } else {
-   $dbw = wfGetDB( DB_MASTER );
+   return;
+   }
 
+   $dbw = wfGetDB( DB_MASTER );
+   // Need a separate transaction because this a global lock
+   $dbw-onTransactionIdle( function() use ( $dbw, $rate ) {
$lockKey = wfMemcKey( 'site_stats' ); // prepend wiki ID
if ( $rate ) {
// Lock the table so we don't have double 
DB/memcached updates
@@ -318,9 +321,6 @@
$this-images += ( $pd['ss_images']['+'] - 
$pd['ss_images']['-'] );
}
 
-   // Need a separate transaction because this a global 
lock
-   $dbw-begin( __METHOD__ );
-
// Build up an SQL query of deltas and apply them...
$updates = '';
$this-appendUpdate( $updates, 'ss_total_views', 
$this-views );
@@ -339,9 +339,7 @@
// Commit the updates and unlock the table
$dbw-unlock( $lockKey, __METHOD__ );
}
-
-   $dbw-commit( __METHOD__ );
-   }
+   } );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c4ea7412e9f96912939c441c68090eacc42b3d4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz asch...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Replace uses of generic::sysctl with sysctlfile module - change (operations/puppet)

2013-07-20 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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


Change subject: Replace uses of generic::sysctl with sysctlfile module
..

Replace uses of generic::sysctl with sysctlfile module

Also, remove generic::sysctl.

Change-Id: I80594fd7932987d4c2380d14e89e341c48a30dad
---
M manifests/generic-definitions.pp
M manifests/role/ceph.pp
M modules/toollabs/manifests/exec_environ.pp
3 files changed, 4 insertions(+), 82 deletions(-)


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

diff --git a/manifests/generic-definitions.pp b/manifests/generic-definitions.pp
index 6e063b1..09ed452 100644
--- a/manifests/generic-definitions.pp
+++ b/manifests/generic-definitions.pp
@@ -708,84 +708,6 @@
}
 }
 
-# Sysctl settings
-
-# Define: sysctl
-#
-# Creates a file in /etc/sysctl.d to set sysctl settings, and reloads
-# sysctl with the new settings.
-#
-# There are three ways to use this define.  You must specify one of
-# $value, $content, or $source.  Not specifying one of these results
-# in a parse failure.
-#
-# Usage 1: $value
-#sysctl { net.core.rmem_max: value = 16777218 }
-#
-# Usage 2: $content
-#$rmem_max = 536870912
-#sysctl { custom_rmem_max: content = 
template(sysctl/sysctl_rmemmax.erb) }
-#
-# Usage 3: $source
-#sysctl { custom_rmem_max: source = 
puppet:///files/misc/rmem_max.sysctl.conf }
-#
-# Parameters:
-#$value - Puts $title = $value in the sysctl.d file.
-#$content   - Puts this exact content in the sysctl.d file.
-#$source- Puts the $source file at the sysctl.d file.
-#$ensure- Either 'present' or 'absent'.  Default: 'present'.
-#$number_prefix - The load order prefix number in the sysctl.d filename.  
Default '60'.  You probably don't need to change this.
-#
-define sysctl(
-   $value = undef,
-   $content   = undef,
-   $source= undef,
-   $ensure= present,
-   $number_prefix = 60)
-{
-   $sysctl_file = /etc/sysctl.d/${number_prefix}-${title}.conf
-
-   file { $sysctl_file:
-   mode   = 0444,
-   owner  = root,
-   group  = root,
-   ensure = $ensure,
-   }
-
-   # if using $value, then set $title = $value in the sysctl.d file
-   if $value {
-   File[$sysctl_file] { content = ${title} = ${value} }
-   }
-   # else just set the content
-   elsif $content {
-   File[$sysctl_file] { content = $content }
-   }
-   # else put the file in place from a source file.
-   elsif $source {
-   File[$sysctl_file] { source  = $source }
-   }
-   # if none of the above are defined, then throw a parse failure.
-   else {
-   alert(sysctl '${title}' must specify one of \$content, 
\$source or \$value.)
-   }
-
-   # Refresh sysctl if we are ensuring the sysctl.d file
-   # exists.  NOTE:  I'm not sure how to reset the sysctl
-   # value to its original if we ensure = absent.  For now,
-   # that will have to wait until a reboot happens.  This
-   # probably won't be a real problem anyway.  Anyone
-   # using this define can just explicitly set the value
-   # back to what it should be, rather than using ensure = 'absent'.
-   if $ensure == 'present' {
-   # refresh sysctl when the sysctl file changes
-   exec { sysctl_reload_${title}:
-   command = /sbin/sysctl -p $sysctl_file,
-   subscribe   = File[$sysctl_file],
-   refreshonly = true,
-   }
-   }
-}
-
 class generic::sysfs::enable-rps {
upstart_job { enable-rps: install = true, start = true }
 }
diff --git a/manifests/role/ceph.pp b/manifests/role/ceph.pp
index bf79d54..891a541 100644
--- a/manifests/role/ceph.pp
+++ b/manifests/role/ceph.pp
@@ -67,10 +67,10 @@
 include ceph::osd
 
 # I/O busy systems, tune a few knobs to avoid page alloc failures
-sysctl { 'sys.vm.min_free_kbytes':
+sysctlfile { 'sys.vm.min_free_kbytes':
 value = '512000',
 }
-sysctl { 'sys.vm.vfs_cache_pressure':
+sysctlfile { 'sys.vm.vfs_cache_pressure':
 value = '120',
 }
 }
diff --git a/modules/toollabs/manifests/exec_environ.pp 
b/modules/toollabs/manifests/exec_environ.pp
index b851184..86a0058 100644
--- a/modules/toollabs/manifests/exec_environ.pp
+++ b/modules/toollabs/manifests/exec_environ.pp
@@ -150,8 +150,8 @@
 ensure = present
   }
 
-  sysctl { vm.overcommit_memory: value = 2 }
-  sysctl { vm.overcommit_ratio: value = 95 }
+  sysctlfile { vm.overcommit_memory: value = 2 }
+  sysctlfile { vm.overcommit_ratio: value = 95 }
 
   # TODO: quotas
 }

-- 
To view, visit 

[MediaWiki-commits] [Gerrit] (Bug 50861) Debug Yandex translation service failures - change (mediawiki...Translate)

2013-07-20 Thread Lockal (Code Review)
Lockal has uploaded a new change for review.

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


Change subject: (Bug 50861) Debug Yandex translation service failures
..

(Bug 50861) Debug Yandex translation service failures

Migrate to Yandex Translate API v1.5.
The previous version 1.0  was deprecated on July 1, 2013.
Starting from version 1.5, all API methods must be accessed using a key.
Also all API methods must be accessed only via HTTPS protocol.

Change-Id: Id5377b9a189be17e182c54df9e8138e9b44fbccc
---
M Translate.php
M webservices/YandexWebService.php
2 files changed, 23 insertions(+), 7 deletions(-)


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

diff --git a/Translate.php b/Translate.php
index b186e70..41f5d7c 100644
--- a/Translate.php
+++ b/Translate.php
@@ -291,8 +291,9 @@
'type' = 'apertium',
 );
 $wgTranslateTranslationServices['Yandex'] = array(
-   'url' = 'http://translate.yandex.net/api/v1/tr.json/translate',
-   'pairs' = 'http://translate.yandex.net/api/v1/tr.json/getLangs',
+   'url' = 'https://translate.yandex.net/api/v1.5/tr.json/translate',
+   'key' = null,
+   'pairs' = 'https://translate.yandex.net/api/v1.5/tr.json/getLangs',
'timeout' = 3,
'langorder' = array( 'en', 'ru', 'uk', 'de', 'fr', 'pl', 'it', 'es', 
'tr' ),
'langlimit' = 1,
diff --git a/webservices/YandexWebService.php b/webservices/YandexWebService.php
index 58e8c65..ea24348 100644
--- a/webservices/YandexWebService.php
+++ b/webservices/YandexWebService.php
@@ -20,8 +20,19 @@
}
 
protected function doPairs() {
+   if ( !isset( $this-config['key'] ) ) {
+   throw new TranslationWebServiceException( 'API key is 
not set' );
+   }
+
+   $service = $this-service;
$pairs = array();
-   $json = Http::get( $this-config['pairs'], 
$this-config['timeout'] );
+
+   $params = array(
+   'key' = $this-config['key'],
+   );
+
+   $url = $this-config['pairs'] . '?' . wfArrayToCgi( $params );
+   $json = Http::get( $url, $this-config['timeout'] );
$response = FormatJson::decode( $json );
 
if ( !is_object( $response ) ) {
@@ -38,6 +49,10 @@
}
 
protected function doRequest( $text, $from, $to ) {
+   if ( !isset( $this-config['key'] ) ) {
+   throw new TranslationWebServiceException( 'API key is 
not set' );
+   }
+
$service = $this-service;
 
$text = trim( $text );
@@ -47,16 +62,16 @@
$options['timeout'] = $this-config['timeout'];
$options['method'] = 'POST';
$options['postData'] = array(
+   'key' = $this-config['key'],
'text' = $text,
'lang' = $from-$to,
-   'x-application' = Translate  . TRANSLATE_VERSION . 
),
);
 
$url = $this-config['url'];
$req = MWHttpRequest::factory( $url, $options );
-   wfProfileIn( 'TranslateWebServiceRequest-' . $this-service );
+   wfProfileIn( 'TranslateWebServiceRequest-' . $service );
$status = $req-execute();
-   wfProfileOut( 'TranslateWebServiceRequest-' . $this-service );
+   wfProfileOut( 'TranslateWebServiceRequest-' . $service );
 
if ( !$status-isOK() ) {
$error = $req-getContent();
@@ -72,7 +87,7 @@
throw new TranslationWebServiceException( serialize( 
$req-getContent() ) );
} elseif ( $response-code !== 200 ) {
$exception = (HTTP {$response-code}) with ($service 
($from|$to)):  .
-   $req-getContent();
+   $response-message;
throw new TranslationWebServiceException( $exception );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5377b9a189be17e182c54df9e8138e9b44fbccc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Lockal lockals...@gmail.com

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


[MediaWiki-commits] [Gerrit] suggest combobox, removed some bugs - change (mediawiki...WikiLexicalData)

2013-07-20 Thread Kipcool (Code Review)
Kipcool has uploaded a new change for review.

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


Change subject: suggest combobox, removed some bugs
..

suggest combobox, removed some bugs

* prev/next buttons not working

* cannot add two attribute option attributes, coz they were mixed up

* onUpdate function is now ajaxified

* in specialSelect sql query rewritten to solve php warning

Change-Id: Id77efe3c3238a62add5d528c9406ae0212c1afd0
---
M OmegaWiki/Editor.php
M OmegaWiki/SpecialSelect.php
M resources/suggest.js
3 files changed, 38 insertions(+), 23 deletions(-)


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

diff --git a/OmegaWiki/Editor.php b/OmegaWiki/Editor.php
index 9917341..94c8140 100644
--- a/OmegaWiki/Editor.php
+++ b/OmegaWiki/Editor.php
@@ -1690,12 +1690,10 @@
 
public function add( IdStack $idPath ) {
if ( $this-isAddField ) {
-   // note: it is normal that the updateSelectOptions( 
has no closing parenthesis. An additional parameter and ')' is added by the 
function updateSuggestValue (suggest.js)
$parameters = array(
level = $this-attributesLevelName,
definedMeaningId = 
$idPath-getDefinedMeaningId(),
-   annotationAttributeId = 
$idPath-getAnnotationAttribute()-getId(),
-   onUpdate = updateSelectOptions(' . 
$this-addId( $idPath-getId() ) . WLD_OPTION_SUFFIX . ',0
+   annotationAttributeId = 
$idPath-getAnnotationAttribute()-getId()
);
 
if ( $this-attributesLevelName == 
WLD_SYNTRANS_MEANING_NAME ) {
@@ -1707,7 +1705,6 @@
}
if ( $syntransId !=  ) {
$parameters[syntransId] = $syntransId;
-   $parameters[onUpdate] = 
'updateSelectOptions(\'' . $this-addId( $idPath-getId() ) . WLD_OPTION_SUFFIX 
. '\',' . $syntransId ;
}
}
 
@@ -1717,10 +1714,8 @@
}
 
public function getEditHTML( IdStack $idPath, $value ) {
-   // note: it is normal that the updateSelectOptions( has no 
closing parenthesis. An additional parameter and ')' is added by the function 
updateSuggestValue (suggest.js)
$parameters = array(
-   level = $this-attributesLevelName,
-   onUpdate = 'updateSelectOptions(\'' . 
$this-updateId( $idPath-getId() ) . WLD_OPTION_SUFFIX . '\''
+   level = $this-attributesLevelName
);
 
return getSuggest( $this-updateId( $idPath-getId() ), 
$this-suggestType(), $parameters );
diff --git a/OmegaWiki/SpecialSelect.php b/OmegaWiki/SpecialSelect.php
index b8bf5fd..95f1032 100644
--- a/OmegaWiki/SpecialSelect.php
+++ b/OmegaWiki/SpecialSelect.php
@@ -26,14 +26,22 @@
 
$objectLanguage = 0 ;
if ( $attributeObject != 0 ) {
-   $sql = 'SELECT language_id' .
-FROM {$dc}_syntrans .
-JOIN {$dc}_expression ON 
{$dc}_expression.expression_id = {$dc}_syntrans.expression_id .
-WHERE {$dc}_syntrans.syntrans_sid =  
. $attributeObject .
-   ' AND ' . 
getLatestTransactionRestriction( {$dc}_syntrans ) .
-   ' AND ' . 
getLatestTransactionRestriction( {$dc}_expression );
-   $lang_res = $dbr-query( $sql );
-   $objectLanguage = $dbr-fetchObject( $lang_res 
)-language_id;
+   $objectLanguage = $dbr-selectField(
+   array(
+   'synt' = {$dc}_syntrans,
+   'exp' = {$dc}_expression
+   ),
+   'language_id',
+   array(
+   'synt.syntrans_sid' = $attributeObject,
+   'synt.remove_transaction_id' = null
+   ), __METHOD__,
+   array(),
+   array( 'exp' = array( 'JOIN', array(
+   'exp.expression_id = 
synt.expression_id',
+   'exp.remove_transaction_id' = null
+   )))
+   );
// language is not always defined, for example for a DM 
Option Attribute
if ( ! $objectLanguage ) $objectLanguage = 0 ;
}
diff 

[MediaWiki-commits] [Gerrit] Don't ask users to mark own page creations as patrolled - change (mediawiki/core)

2013-07-20 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

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


Change subject: Don't ask users to mark own page creations as patrolled
..

Don't ask users to mark own page creations as patrolled

Bug: 51224
Change-Id: I2d38c25b547a8735da135955854584aa02b4394d
---
M includes/Article.php
M includes/diff/DifferenceEngine.php
2 files changed, 14 insertions(+), 5 deletions(-)


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

diff --git a/includes/Article.php b/includes/Article.php
index 732b1c2..0b18221 100644
--- a/includes/Article.php
+++ b/includes/Article.php
@@ -1121,6 +1121,13 @@
return false;
}
 
+   if ( $rc-getPerformer()-getName() == $user-getName() ) {
+   // Don't show a patrol link for own creations. If the 
user could
+   // patrol them, they already would be patrolled
+   wfProfileOut( __METHOD__ );
+   return false;
+   }
+
$rcid = $rc-getAttribute( 'rc_id' );
 
$token = $user-getEditToken( $rcid );
diff --git a/includes/diff/DifferenceEngine.php 
b/includes/diff/DifferenceEngine.php
index 6657667..b742873 100644
--- a/includes/diff/DifferenceEngine.php
+++ b/includes/diff/DifferenceEngine.php
@@ -416,12 +416,13 @@
 */
protected function markPatrolledLink() {
global $wgUseRCPatrol, $wgEnableAPI, $wgEnableWriteAPI;
+   $user = $this-getUser();
 
if ( $this-mMarkPatrolledLink === null ) {
// Prepare a change patrol link, if applicable
if (
// Is patrolling enabled and the user allowed 
to?
-   $wgUseRCPatrol  
$this-mNewPage-quickUserCan( 'patrol', $this-getUser() ) 
+   $wgUseRCPatrol  
$this-mNewPage-quickUserCan( 'patrol', $user ) 
// Only do this if the revision isn't more than 
6 hours older
// than the Max RC age (6h because the RC might 
not be cleaned out regularly)
RecentChange::isInRCLifespan( 
$this-mNewRev-getTimestamp(), 21600 )
@@ -439,22 +440,23 @@
array( 'USE INDEX' = 'rc_timestamp' )
);
 
-   if ( $change ) {
+   if ( $change  
$change-getPerformer()-getName() !== $user-getName() ) {
$rcid = $change-getAttribute( 'rc_id' 
);
} else {
-   // None found
+   // None found or the page has been 
created by the current user.
+   // If the user could patrol this it 
already would be patrolled
$rcid = 0;
}
// Build the link
if ( $rcid ) {

$this-getOutput()-preventClickjacking();
if ( $wgEnableAPI  $wgEnableWriteAPI
-$this-getUser()-isAllowed( 
'writeapi' )
+$user-isAllowed( 'writeapi' 
)
) {
$this-getOutput()-addModules( 
'mediawiki.page.patrol.ajax' );
}
 
-   $token = 
$this-getUser()-getEditToken( $rcid );
+   $token = $user-getEditToken( $rcid );
$this-mMarkPatrolledLink = ' span 
class=patrollink[' . Linker::linkKnown(
$this-mNewPage,
$this-msg( 
'markaspatrolleddiff' )-escaped(),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d38c25b547a8735da135955854584aa02b4394d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Hoo man h...@online.de

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


[MediaWiki-commits] [Gerrit] suggest combobox, removed some bugs - change (mediawiki...WikiLexicalData)

2013-07-20 Thread Kipcool (Code Review)
Kipcool has submitted this change and it was merged.

Change subject: suggest combobox, removed some bugs
..


suggest combobox, removed some bugs

* prev/next buttons not working

* cannot add two attribute option attributes, coz they were mixed up

* onUpdate function is now ajaxified

* in specialSelect sql query rewritten to solve php warning

Change-Id: Id77efe3c3238a62add5d528c9406ae0212c1afd0
---
M OmegaWiki/Editor.php
M OmegaWiki/SpecialSelect.php
M resources/suggest.js
3 files changed, 38 insertions(+), 23 deletions(-)

Approvals:
  Kipcool: Verified; Looks good to me, approved



diff --git a/OmegaWiki/Editor.php b/OmegaWiki/Editor.php
index 9917341..94c8140 100644
--- a/OmegaWiki/Editor.php
+++ b/OmegaWiki/Editor.php
@@ -1690,12 +1690,10 @@
 
public function add( IdStack $idPath ) {
if ( $this-isAddField ) {
-   // note: it is normal that the updateSelectOptions( 
has no closing parenthesis. An additional parameter and ')' is added by the 
function updateSuggestValue (suggest.js)
$parameters = array(
level = $this-attributesLevelName,
definedMeaningId = 
$idPath-getDefinedMeaningId(),
-   annotationAttributeId = 
$idPath-getAnnotationAttribute()-getId(),
-   onUpdate = updateSelectOptions(' . 
$this-addId( $idPath-getId() ) . WLD_OPTION_SUFFIX . ',0
+   annotationAttributeId = 
$idPath-getAnnotationAttribute()-getId()
);
 
if ( $this-attributesLevelName == 
WLD_SYNTRANS_MEANING_NAME ) {
@@ -1707,7 +1705,6 @@
}
if ( $syntransId !=  ) {
$parameters[syntransId] = $syntransId;
-   $parameters[onUpdate] = 
'updateSelectOptions(\'' . $this-addId( $idPath-getId() ) . WLD_OPTION_SUFFIX 
. '\',' . $syntransId ;
}
}
 
@@ -1717,10 +1714,8 @@
}
 
public function getEditHTML( IdStack $idPath, $value ) {
-   // note: it is normal that the updateSelectOptions( has no 
closing parenthesis. An additional parameter and ')' is added by the function 
updateSuggestValue (suggest.js)
$parameters = array(
-   level = $this-attributesLevelName,
-   onUpdate = 'updateSelectOptions(\'' . 
$this-updateId( $idPath-getId() ) . WLD_OPTION_SUFFIX . '\''
+   level = $this-attributesLevelName
);
 
return getSuggest( $this-updateId( $idPath-getId() ), 
$this-suggestType(), $parameters );
diff --git a/OmegaWiki/SpecialSelect.php b/OmegaWiki/SpecialSelect.php
index b8bf5fd..95f1032 100644
--- a/OmegaWiki/SpecialSelect.php
+++ b/OmegaWiki/SpecialSelect.php
@@ -26,14 +26,22 @@
 
$objectLanguage = 0 ;
if ( $attributeObject != 0 ) {
-   $sql = 'SELECT language_id' .
-FROM {$dc}_syntrans .
-JOIN {$dc}_expression ON 
{$dc}_expression.expression_id = {$dc}_syntrans.expression_id .
-WHERE {$dc}_syntrans.syntrans_sid =  
. $attributeObject .
-   ' AND ' . 
getLatestTransactionRestriction( {$dc}_syntrans ) .
-   ' AND ' . 
getLatestTransactionRestriction( {$dc}_expression );
-   $lang_res = $dbr-query( $sql );
-   $objectLanguage = $dbr-fetchObject( $lang_res 
)-language_id;
+   $objectLanguage = $dbr-selectField(
+   array(
+   'synt' = {$dc}_syntrans,
+   'exp' = {$dc}_expression
+   ),
+   'language_id',
+   array(
+   'synt.syntrans_sid' = $attributeObject,
+   'synt.remove_transaction_id' = null
+   ), __METHOD__,
+   array(),
+   array( 'exp' = array( 'JOIN', array(
+   'exp.expression_id = 
synt.expression_id',
+   'exp.remove_transaction_id' = null
+   )))
+   );
// language is not always defined, for example for a DM 
Option Attribute
if ( ! $objectLanguage ) $objectLanguage = 0 ;
}
diff --git a/resources/suggest.js b/resources/suggest.js
index 22406d4..abfa7d1 100644

[MediaWiki-commits] [Gerrit] Add (and re-organize) TCL packages for giftpflanze - change (operations/puppet)

2013-07-20 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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


Change subject: Add (and re-organize) TCL packages for giftpflanze
..

Add (and re-organize) TCL packages for giftpflanze

Note: There are several other packages for tcl that have been
installed but not in puppt. git checkout -b takes 5 hours to do.

Change-Id: Ied6ed1260c763c03a3a4ee9cc4c894e66421505a
---
M modules/toollabs/manifests/exec_environ.pp
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/56/74856/1

diff --git a/modules/toollabs/manifests/exec_environ.pp 
b/modules/toollabs/manifests/exec_environ.pp
index b851184..1f8e02f 100644
--- a/modules/toollabs/manifests/exec_environ.pp
+++ b/modules/toollabs/manifests/exec_environ.pp
@@ -122,6 +122,11 @@
   'php5-redis',
   'php5-xsl',
 
+  # tcl packages
+  'tclcurl',
+  'tcllib',
+  'tclthread',
+
   # Other packages
   'adminbot',
   'dc',
@@ -143,8 +148,6 @@
   'mdbtools',# Bug #48805.
   'p7zip',
   'phpunit',
-  'tclcurl',
-  'tcllib',
   'tree' # Bug #48862.
   ]:
 ensure = present

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied6ed1260c763c03a3a4ee9cc4c894e66421505a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com

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


[MediaWiki-commits] [Gerrit] Add (and re-organize) TCL packages for giftpflanze - change (operations/puppet)

2013-07-20 Thread coren (Code Review)
coren has submitted this change and it was merged.

Change subject: Add (and re-organize) TCL packages for giftpflanze
..


Add (and re-organize) TCL packages for giftpflanze

Change-Id: Ied6ed1260c763c03a3a4ee9cc4c894e66421505a
---
M modules/toollabs/manifests/exec_environ.pp
1 file changed, 6 insertions(+), 2 deletions(-)

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



diff --git a/modules/toollabs/manifests/exec_environ.pp 
b/modules/toollabs/manifests/exec_environ.pp
index b851184..d6855cd 100644
--- a/modules/toollabs/manifests/exec_environ.pp
+++ b/modules/toollabs/manifests/exec_environ.pp
@@ -122,6 +122,12 @@
   'php5-redis',
   'php5-xsl',
 
+  # tcl packages
+  'mysqltcl',
+  'tclcurl',
+  'tcllib',
+  'tclthread',
+
   # Other packages
   'adminbot',
   'dc',
@@ -143,8 +149,6 @@
   'mdbtools',# Bug #48805.
   'p7zip',
   'phpunit',
-  'tclcurl',
-  'tcllib',
   'tree' # Bug #48862.
   ]:
 ensure = present

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ied6ed1260c763c03a3a4ee9cc4c894e66421505a
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: coren mpellet...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Adding re-authorize flow - change (mediawiki...OAuth)

2013-07-20 Thread Aaron Schulz (Code Review)
Aaron Schulz has submitted this change and it was merged.

Change subject: Adding re-authorize flow
..


Adding re-authorize flow

Re-authorization form is ugly, and probably needs some UX help, but
the basic functionality is there.

Change-Id: Ia40cea2ad2346c514e6bf661d4ba6efc07caebe9
---
M backend/MWOAuthConsumerAcceptance.php
M backend/MWOAuthServer.php
M frontend/language/MWOAuth.i18n.php
M frontend/specialpages/SpecialMWOAuth.php
4 files changed, 140 insertions(+), 25 deletions(-)

Approvals:
  Aaron Schulz: Verified; Looks good to me, approved



diff --git a/backend/MWOAuthConsumerAcceptance.php 
b/backend/MWOAuthConsumerAcceptance.php
index f0d231b..2cd107b 100644
--- a/backend/MWOAuthConsumerAcceptance.php
+++ b/backend/MWOAuthConsumerAcceptance.php
@@ -86,6 +86,34 @@
}
}
 
+   /**
+* @param DBConnRef $db
+* @param String $userId of user who authorized (central wiki's id)
+* @param MWOAuthConsumer $consumer
+* @param String $wiki wiki associated with the acceptance
+* @param integer $flags MWOAuthConsumerAcceptance::READ_* bitfield
+* @return MWOAuthConsumerAcceptance|bool
+*/
+   public static function newFromUserConsumerWiki( DBConnRef $db, $userId, 
$consumer, $wiki, $flags = 0 ) {
+   $row = $db-selectRow( static::getTable(),
+   array_values( static::getFieldColumnMap() ),
+   array( 'oaac_user_id' = $userId,
+   'oaac_consumer_id' = $consumer-get( 'id' ),
+   'oaac_wiki' = $wiki
+   ),
+   __METHOD__,
+   ( $flags  self::READ_LOCKING ) ? array( 'FOR UPDATE' ) 
: array()
+   );
+
+   if ( $row ) {
+   $consumer = new self();
+   $consumer-loadFromRow( $db, $row );
+   return $consumer;
+   } else {
+   return false;
+   }
+   }
+
protected function normalizeValues() {
$this-userId = (int)$this-userId;
$this-consumerId = (int)$this-consumerId;
diff --git a/backend/MWOAuthServer.php b/backend/MWOAuthServer.php
index 9b7fd7e..28d9996 100644
--- a/backend/MWOAuthServer.php
+++ b/backend/MWOAuthServer.php
@@ -82,11 +82,12 @@
 * generate the callback URL where we will redirect our user back to 
the consumer.
 * @param String $consumerKey
 * @param String $requestTokenKey
-* @param User $mwUser user authorizing the request
+* @param User $mwUser user authorizing the request (local user)
+* @param bool $update update the grants/wiki to those requested by 
consumer
 * @return String the callback URL to redirect the user
 * @throws MWOAuthException
 */
-   public function authorize( $consumerKey, $requestTokenKey, User $mwUser 
) {
+   public function authorize( $consumerKey, $requestTokenKey, User 
$mwUser, $update ) {
// Check that user and consumer are in good standing
if ( $mwUser-isBlocked() ) {
throw new MWOAuthException( 
'mwoauthserver-insufficient-rights' );
@@ -101,18 +102,17 @@
}
 
// Generate and Update the tokens:
-   // * Generate Access token, and add a pointer to it in the 
request token
// * Generate a new Verification code, and add it to the 
request token
-   // * Resave Request token with
-   $accessToken = MWOAuthDataStore::newToken();
+   // * Either add or update the authorization
+   // ** Generate a new access token if this is a new authorization
+   // * Resave request token with the access token
+
$verifyCode = MWCryptRand::generateHex( 32, true);
$requestToken = $this-data_store-lookup_token( $consumer, 
'request', $requestTokenKey );
if ( !$requestToken || !( $requestToken instanceof MWOAuthToken 
) ) {
throw new MWOAuthException( 
'mwoauthserver-invalid-request-token' );
}
$requestToken-addVerifyCode( $verifyCode );
-   $requestToken-addAccessKey( $accessToken-key );
-   $this-data_store-updateRequestToken( $requestToken, $consumer 
);
 
// CentralAuth may abort here if there is no global account for 
this user
$userId = MWOAuthUtils::getCentralIdFromLocalUser( $mwUser );
@@ -120,23 +120,81 @@
throw new MWOAuthException( 
'mwoauthserver-invalid-user' );
}
 
-   // Add the Authorization to the database
+   // Authorization Token
$dbw = MWOAuthUtils::getCentralDB( DB_MASTER );
-   $cmra = 

[MediaWiki-commits] [Gerrit] Prevent empty secrets - change (mediawiki...OAuth)

2013-07-20 Thread Aaron Schulz (Code Review)
Aaron Schulz has submitted this change and it was merged.

Change subject: Prevent empty secrets
..


Prevent empty secrets

Add sanity checks to make sure secrets exist before checking the
signatures.

Also some whitespace and formatting cleanup.

Change-Id: Ib821c9baefa5a51e6809285f47a88cbf8b843e23
---
M backend/MWOAuthServer.php
M frontend/specialpages/SpecialMWOAuth.php
M lib/OAuth.php
3 files changed, 29 insertions(+), 7 deletions(-)

Approvals:
  Aaron Schulz: Verified; Looks good to me, approved



diff --git a/backend/MWOAuthServer.php b/backend/MWOAuthServer.php
index 9b7fd7e..b43e998 100644
--- a/backend/MWOAuthServer.php
+++ b/backend/MWOAuthServer.php
@@ -14,6 +14,11 @@
 
$consumer = $this-get_consumer( $request );
 
+   // Consumer must have a key for us to verify
+   if ( !$consumer-get( 'secretKey' )  !$consumer-get( 
'rsaKey' ) ) {
+   throw new MWOAuthException( 'invalid-consumer' );
+   }
+
$this-checkSourceIP( $consumer, $request );
 
// no token required for the initial token request
@@ -41,10 +46,20 @@
 
$consumer = $this-get_consumer( $request );
 
+   // Consumer must have a key for us to verify
+   if ( !$consumer-get( 'secretKey' )  !$consumer-get( 
'rsaKey' ) ) {
+   throw new MWOAuthException( 'invalid-consumer' );
+   }
+
$this-checkSourceIP( $consumer, $request );
 
// requires authorized request token
-   $token = $this-get_token( $request, $consumer, request );
+   $token = $this-get_token( $request, $consumer, 'request' );
+
+   if ( !$token-secret ) {
+   // This token has a blank secret.. something is wrong
+   throw new MWOAuthException( 'bad-token' );
+   }
 
$this-check_signature( $request, $consumer, $token );
 
@@ -67,6 +82,10 @@
$restrictions = $consumer-get( 'restrictions' );
$requestIP = $request-getSourceIP();
 
+   if ( !isset( $restrictions['IPAddresses'] ) ) {
+   return true; // sanity; should not happen
+   }
+
foreach ( $restrictions['IPAddresses'] as $range ) {
if ( IP::isInRange( $requestIP, $range ) ) {
return true;
diff --git a/frontend/specialpages/SpecialMWOAuth.php 
b/frontend/specialpages/SpecialMWOAuth.php
index 523277b..6809a5d 100644
--- a/frontend/specialpages/SpecialMWOAuth.php
+++ b/frontend/specialpages/SpecialMWOAuth.php
@@ -36,6 +36,7 @@
if ( !$requestToken || !$consumerKey ) {
throw new MWOAuthException( 
'mwoauth-bad-request' );
}
+   // TODO? Test that $requestToken exists 
in memcache
 
if ( $mwUser-isAnon() ) {
//redirect to login
@@ -94,7 +95,7 @@
break;
case 'token':
$OAuthRequest = 
MWOAuthRequest::fromRequest( $request );
-   wfDebugLog( 'OAuth', /token: 
'{$OAuthRequest-getConsumerKey()}' getting temporary credentials );
+   wfDebugLog( 'OAuth', /token: 
'{$OAuthRequest-get_parameter( 'oauth_consumer_key' )}' getting temporary 
credentials );
$token = 
$oauthServer-fetch_access_token( $OAuthRequest );
$this-returnToken( $token, $format );
 
diff --git a/lib/OAuth.php b/lib/OAuth.php
index f281597..3e794ee 100644
--- a/lib/OAuth.php
+++ b/lib/OAuth.php
@@ -662,9 +662,9 @@
 ? $request-get_parameter( 'oauth_token' )
 : NULL;
 
-   $token = $this-data_store-lookup_token( 
+   $token = $this-data_store-lookup_token(
$consumer, $token_type, $token_field
-);
+   );
if ( !$token ) {
throw new OAuthException( Invalid $token_type token: 
$token_field );
}
@@ -706,10 +706,11 @@
 * check that the timestamp is new enough
 */
private function check_timestamp( $timestamp ) {
-   if( ! $timestamp )
+   if( !$timestamp ) {
throw new OAuthException(
'Missing timestamp parameter. The parameter is 
required'
 );
+   }
 
// verify that timestamp is recentish
$now = 

[MediaWiki-commits] [Gerrit] Add an expand all sections option - change (mediawiki...MobileFrontend)

2013-07-20 Thread Pcc (Code Review)
Pcc has uploaded a new change for review.

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


Change subject: Add an expand all sections option
..

Add an expand all sections option

Change-Id: Ib5ab3af79e4cdd53c110ed1fbd0d91f5be5cc094
---
M MobileFrontend.i18n.php
M includes/MobileContext.php
M includes/formatters/MobileFormatter.php
M includes/formatters/MobileFormatterHTML.php
M includes/specials/SpecialMobileOptions.php
5 files changed, 42 insertions(+), 2 deletions(-)


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

diff --git a/MobileFrontend.i18n.php b/MobileFrontend.i18n.php
index 81ade0d..23e000f 100644
--- a/MobileFrontend.i18n.php
+++ b/MobileFrontend.i18n.php
@@ -49,6 +49,7 @@
'mobile-frontend-images-status' = 'Images',
'mobile-frontend-disable-images' = 'Disable images on mobile site',
'mobile-frontend-enable-images' = 'Enable images on mobile site',
+   'mobile-frontend-expand-sections-status' = 'Expand all sections',
'mobile-frontend-missing-image' = 'Image',
'mobile-frontend-off' = 'OFF',
'mobile-frontend-on' = 'ON',
@@ -360,6 +361,7 @@
'mobile-frontend-opt-in-explain' = 'Used as description for the Beta 
in [[Special:MobileOptions]], if the beta is not enabled.',
'mobile-frontend-images-status' = 'On settings page label for turning 
on/off images.
 {{Identical|Images}}',
+   'mobile-frontend-expand-sections-status' = 'On settings page label for 
turning on/off expansion of all sections on page load.',
'mobile-frontend-disable-images' = 'Unused at this time.
 
 See also:
diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index 934a957..917192b 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -120,6 +120,14 @@
return $this-disableImages;
}
 
+   public function expandSections() {
+   if ( is_null( $this-expandSections ) ) {
+   $this-expandSections = 
(bool)$this-getRequest()-getCookie( 'expandSections' );
+   }
+
+   return $this-expandSections;
+   }
+
public function isMobileDevice() {
global $wgMFAutodetectMobileView;
 
@@ -525,6 +533,13 @@
}
 
/**
+* @param $expand bool
+*/
+   public function setExpandSectionsCookie( $expand ) {
+   $this-getRequest()-response()-setcookie( 'expandSections', 
$expand ? '1' : '' );
+   }
+
+   /**
 * @return string
 */
public function getBaseDomain() {
diff --git a/includes/formatters/MobileFormatter.php 
b/includes/formatters/MobileFormatter.php
index d44b17d..467519b 100644
--- a/includes/formatters/MobileFormatter.php
+++ b/includes/formatters/MobileFormatter.php
@@ -58,6 +58,7 @@
} else {
$formatter = new MobileFormatterHTML( $html, $title );
$formatter-enableExpandableSections( !$isMainPage );
+   $formatter-setExpandSections( 
$context-expandSections() );
}
 
if ( $context-isBetaGroupMember() ) {
diff --git a/includes/formatters/MobileFormatterHTML.php 
b/includes/formatters/MobileFormatterHTML.php
index 6e43c02..cae3c0c 100644
--- a/includes/formatters/MobileFormatterHTML.php
+++ b/includes/formatters/MobileFormatterHTML.php
@@ -9,10 +9,15 @@
 */
public function __construct( $html, $title ) {
parent::__construct( $html, $title );
+   $this-expandSections = false;
}
 
public function getFormat() {
return 'HTML';
+   }
+
+   public function setExpandSections( $expand ) {
+   $this-expandSections = $expand;
}
 
protected function onHtmlReady( $html ) {
@@ -46,9 +51,15 @@
} else {
$base = '';
}
+
+   $expandClass = '';
+   if ( $this-expandSections ) {
+   $expandClass = ' openSection';
+   }
+
$base .= Html::openElement( 'div', array( 'class' = 'section' 
) );
$base .= Html::openElement( 'h2',
-   array( 'class' = 'section_heading', 'id' = 'section_' 
. $this-headings )
+   array( 'class' = 'section_heading' . $expandClass, 
'id' = 'section_' . $this-headings )
);
$base .=
Html::rawElement( 'span',
@@ -57,7 +68,7 @@
)
. Html::closeElement( 'h2' )
. Html::openElement( 'div',
-   array( 'class' = 'content_block', 'id' = 
'content_' . $this-headings )
+   array( 'class' = 'content_block' . 
$expandClass, 'id' = 'content_' . $this-headings )
  

[MediaWiki-commits] [Gerrit] Changed token updates to reset-only checkbox - change (mediawiki...OAuth)

2013-07-20 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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


Change subject: Changed token updates to reset-only checkbox
..

Changed token updates to reset-only checkbox

* This will be needed for using HMAC values (db token + config secret) as the 
final secrets

Change-Id: I2f82104a74a003f8b4d6e878f3a66d93e9fbed3c
---
M control/MWOAuthConsumerSubmitControl.php
M frontend/language/MWOAuth.i18n.php
M frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
3 files changed, 23 insertions(+), 8 deletions(-)


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

diff --git a/control/MWOAuthConsumerSubmitControl.php 
b/control/MWOAuthConsumerSubmitControl.php
index e0298e0..cfe212a 100644
--- a/control/MWOAuthConsumerSubmitControl.php
+++ b/control/MWOAuthConsumerSubmitControl.php
@@ -67,8 +67,8 @@
$res = FormatJSON::decode( $s, true );
return is_array( $res )  
MWOAuthUtils::restrictionsAreValid( $res );
},
-   'secretKey'= '/^([0-9a-f]{32})?$/',
'rsaKey'   = '/^.*$/', // @TODO: beef up
+   'resetSecret'  = function( $s ) { return 
is_bool( $s ); },
'reason'   = '/^.{0,255}$/',
'changeToken'  = '/^[0-9a-f]{40}$/'
),
@@ -188,7 +188,10 @@
$cmr-setFields( array(
'rsaKey'   = $this-vals['rsaKey'],
'restrictions' = FormatJSON::decode( 
$this-vals['restrictions'], true ),
-   'secretKey'= $this-vals['secretKey'] ) );
+   'secretKey'= $this-vals['resetSecret']
+   ? MWCryptRand::generateHex( 32 )
+   : $cmr-get( 'secretKey' )
+   ) );
 
// Log if something actually changed
if ( $cmr-save( $dbw ) ) {
diff --git a/frontend/language/MWOAuth.i18n.php 
b/frontend/language/MWOAuth.i18n.php
index 044b8ce..5ed1d62 100644
--- a/frontend/language/MWOAuth.i18n.php
+++ b/frontend/language/MWOAuth.i18n.php
@@ -86,10 +86,12 @@
'mwoauthconsumerregistration-stage' = 'Status',
'mwoauthconsumerregistration-lastchange' = 'Last change',
'mwoauthconsumerregistration-manage' = 'manage',
+   'mwoauthconsumerregistration-resetsecretkey' = 'Reset the secret key 
to a new value',
'mwoauthconsumerregistration-proposed' = 'Your OAuth consumer request 
has been received.
 
 You have been assigned a consumer token of \'\'\'$1\'\'\' and a secret token 
of \'\'\'$2\'\'\'. \'\'Please record these for future reference.\'\'',
'mwoauthconsumerregistration-updated' = 'Your OAuth consumer registry 
was successfully updated.',
+   'mwoauthconsumerregistration-secretreset' = 'You have been assigned a 
consumer secret token of \'\'\'$1\'\'\'. \'\'Please record this for future 
reference.\'\'',
 
'mwoauthmanageconsumers' = 'Manage OAuth consumers',
'mwoauthmanageconsumers-type' = 'Queues:',
@@ -270,11 +272,13 @@
'mwoauthconsumerregistration-propose-submit' = 'Used as label for the 
Submit button.',
'mwoauthconsumerregistration-update-submit' = 'Used as label for the 
Submit button.',
'mwoauthconsumerregistration-stage' = '{{Identical|Status}}',
+   'mwoauthconsumerregistration-resetsecretkey' = 'Used a label for a 
checkbox',
'mwoauthconsumerregistration-proposed' = 'Used as success message.
 
 Parameters:
 * $1 - consumer key
 * $2 - secret key',
+
'mwoauthmanageconsumers' = '{{doc-special|MWOAuthManageConsumers}}
 {{Identical|Manage OAuth consumer}}',
'mwoauthmanageconsumers-type' = 'Used as subtitle.
@@ -407,6 +411,10 @@
'mwoauth-grants-createpages' = '{{Identical|Create page}}',
'mwoauth-grants-deletepages' = '{{Identical|Delete page}}',
'mwoauth-grants-upload' = '{{Identical|Upload file}}',
+
+   'mwoauthconsumerregistration-updated' = 'Shown as success message',
+   'mwoauthconsumerregistration-secretreset' = 'Shown on success message. 
Parameters:
+* $1 - new secret token',
 );
 
 /** Asturian (asturianu)
diff --git a/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php 
b/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
index 99a55f0..fbd1b88 100644
--- a/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
+++ b/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
@@ -167,6 +167,7 @@
$this-getOutput()-addWikiMsg( 
'mwoauth-invalid-consumer-key' );
break;

[MediaWiki-commits] [Gerrit] Fix error in handling of '?' in URLs - change (mediawiki...EventLogging)

2013-07-20 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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


Change subject: Fix error in handling of '?' in URLs
..

Fix error in handling of '?' in URLs

When there is no '?' in the URI, zmq_subscriber would truncate the last letter.
This patch also adds some missing docblocks to methods in handlers.py and
provides a helper function, 'iter_text', for iteratively reading UTF-8-encoded
lines of text from a file-like object.

Change-Id: I4150bc7316c70fac661fe871b0123b28a8cb0642
---
M server/eventlogging/handlers.py
1 file changed, 32 insertions(+), 15 deletions(-)


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

diff --git a/server/eventlogging/handlers.py b/server/eventlogging/handlers.py
index 8af8f28..9d867b1 100644
--- a/server/eventlogging/handlers.py
+++ b/server/eventlogging/handlers.py
@@ -37,6 +37,14 @@
 #: not defined, EventLogging will default to the value specified below.
 DEFAULT_PLUGIN_DIR = '/usr/local/lib/eventlogging'
 
+UDP_BLOCK_SIZE = 65536  # Corresponds to Udp2LogConfig::BLOCK_SIZE
+
+
+def iter_text(f, encoding='utf8', errors='replace', **kwargs):
+Returns an iterator that decodes data from a file-like object opened in
+binary mode into lines of unicode text.
+return io.open(f.fileno(), encoding=encoding, errors=errors, **kwargs)
+
 
 def load_plugins(path=None):
 Load EventLogging plug-ins from `path`. Plug-in module names are mangled
@@ -47,7 +55,9 @@
 imp.load_source('__eventlogging_plugin_%x__' % hash(plugin), plugin)
 
 
+#
 # Mappers
+#
 
 @mapper
 def decode_json(stream):
@@ -89,6 +99,7 @@
 
 @writes('file')
 def log_writer(uri):
+Write events to a file on disk.
 parsed = urlparse(uri)
 filename = parsed.path
 handler = logging.handlers.WatchedFileHandler(filename)
@@ -103,6 +114,7 @@
 
 @writes('tcp')
 def zmq_publisher(uri):
+Publish events on a ZeroMQ publisher socket.
 context = zmq.Context.instance()
 pub = context.socket(zmq.PUB)
 pub.bind(uri)
@@ -113,41 +125,46 @@
 
 
 @writes('stdout')
-def stdout_writer():
-kwargs = {}
+def stdout_writer(uri, **kwargs):
+Writes events to stdout. Pretty-prints if stdout is a terminal.
 if sys.stdout.isatty():
-kwargs.update(sort_keys=True, indent=2)
+kwargs.setdefault('indent', 2)
 while 1:
-print(json.dumps((yield), **kwargs))
+print(json.dumps((yield), sort_keys=True, **kwargs))
+
+
+#
+# Readers
+#
 
 
 @reads('stdin')
-def stdin_reader(encoding='utf8', errors='ignore'):
-return io.open(sys.stdin.fileno(), encoding=encoding, errors=errors)
+def stdin_reader(uri, **kwargs):
+Reads data from standard input.
+return iter_text(sys.stdin, **kwargs)
 
-
-# Readers
 
 @reads('tcp')
 def zmq_subscriber(uri, socket_id=None, topic=''):
+Reads data from a ZeroMQ publisher.
+if '?' in uri:
+uri = uri[:uri.index('?')]
 context = zmq.Context.instance()
 sub = context.socket(zmq.SUB)
 if socket_id is not None:
 sub.setsockopt(zmq.IDENTITY, socket_id.encode('utf8'))
-sub.connect(uri[:uri.find('?')])
+sub.connect(uri)
 sub.setsockopt(zmq.SUBSCRIBE, topic.encode('utf8'))
 
 while 1:
 yield json.loads(sub.recv_unicode())
 
 
-UDP_BUFSIZE = 65536  # Udp2LogConfig::BLOCK_SIZE
-
-
 @reads('udp')
 def udp_reader(uri):
-parsed = urlparse(uri)
+Reads data from a UDP socket.
+ip, port = urlparse(uri).netloc.split(':')
 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
 sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-sock.bind(parsed.netloc.split(':'))
-return io.open(sock.fileno(), buffering=UDP_BUFSIZE, encoding='utf8')
+sock.bind((ip, int(port)))
+return iter_text(sock, buffering=UDP_BLOCK_SIZE)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4150bc7316c70fac661fe871b0123b28a8cb0642
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fix error in handling of '?' in URLs - change (mediawiki...EventLogging)

2013-07-20 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix error in handling of '?' in URLs
..


Fix error in handling of '?' in URLs

When there is no '?' in the URI, zmq_subscriber would truncate the last letter.
This patch also adds some missing docblocks to methods in handlers.py and
provides a helper function, 'iter_text', for iteratively reading UTF-8-encoded
lines of text from a file-like object.

Change-Id: I4150bc7316c70fac661fe871b0123b28a8cb0642
---
M server/eventlogging/handlers.py
1 file changed, 32 insertions(+), 15 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/server/eventlogging/handlers.py b/server/eventlogging/handlers.py
index 8af8f28..9d867b1 100644
--- a/server/eventlogging/handlers.py
+++ b/server/eventlogging/handlers.py
@@ -37,6 +37,14 @@
 #: not defined, EventLogging will default to the value specified below.
 DEFAULT_PLUGIN_DIR = '/usr/local/lib/eventlogging'
 
+UDP_BLOCK_SIZE = 65536  # Corresponds to Udp2LogConfig::BLOCK_SIZE
+
+
+def iter_text(f, encoding='utf8', errors='replace', **kwargs):
+Returns an iterator that decodes data from a file-like object opened in
+binary mode into lines of unicode text.
+return io.open(f.fileno(), encoding=encoding, errors=errors, **kwargs)
+
 
 def load_plugins(path=None):
 Load EventLogging plug-ins from `path`. Plug-in module names are mangled
@@ -47,7 +55,9 @@
 imp.load_source('__eventlogging_plugin_%x__' % hash(plugin), plugin)
 
 
+#
 # Mappers
+#
 
 @mapper
 def decode_json(stream):
@@ -89,6 +99,7 @@
 
 @writes('file')
 def log_writer(uri):
+Write events to a file on disk.
 parsed = urlparse(uri)
 filename = parsed.path
 handler = logging.handlers.WatchedFileHandler(filename)
@@ -103,6 +114,7 @@
 
 @writes('tcp')
 def zmq_publisher(uri):
+Publish events on a ZeroMQ publisher socket.
 context = zmq.Context.instance()
 pub = context.socket(zmq.PUB)
 pub.bind(uri)
@@ -113,41 +125,46 @@
 
 
 @writes('stdout')
-def stdout_writer():
-kwargs = {}
+def stdout_writer(uri, **kwargs):
+Writes events to stdout. Pretty-prints if stdout is a terminal.
 if sys.stdout.isatty():
-kwargs.update(sort_keys=True, indent=2)
+kwargs.setdefault('indent', 2)
 while 1:
-print(json.dumps((yield), **kwargs))
+print(json.dumps((yield), sort_keys=True, **kwargs))
+
+
+#
+# Readers
+#
 
 
 @reads('stdin')
-def stdin_reader(encoding='utf8', errors='ignore'):
-return io.open(sys.stdin.fileno(), encoding=encoding, errors=errors)
+def stdin_reader(uri, **kwargs):
+Reads data from standard input.
+return iter_text(sys.stdin, **kwargs)
 
-
-# Readers
 
 @reads('tcp')
 def zmq_subscriber(uri, socket_id=None, topic=''):
+Reads data from a ZeroMQ publisher.
+if '?' in uri:
+uri = uri[:uri.index('?')]
 context = zmq.Context.instance()
 sub = context.socket(zmq.SUB)
 if socket_id is not None:
 sub.setsockopt(zmq.IDENTITY, socket_id.encode('utf8'))
-sub.connect(uri[:uri.find('?')])
+sub.connect(uri)
 sub.setsockopt(zmq.SUBSCRIBE, topic.encode('utf8'))
 
 while 1:
 yield json.loads(sub.recv_unicode())
 
 
-UDP_BUFSIZE = 65536  # Udp2LogConfig::BLOCK_SIZE
-
-
 @reads('udp')
 def udp_reader(uri):
-parsed = urlparse(uri)
+Reads data from a UDP socket.
+ip, port = urlparse(uri).netloc.split(':')
 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
 sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-sock.bind(parsed.netloc.split(':'))
-return io.open(sock.fileno(), buffering=UDP_BUFSIZE, encoding='utf8')
+sock.bind((ip, int(port)))
+return iter_text(sock, buffering=UDP_BLOCK_SIZE)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4150bc7316c70fac661fe871b0123b28a8cb0642
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Work around circular ref in Python stdlib's 'urlopen' - change (mediawiki...EventLogging)

2013-07-20 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Work around circular ref in Python stdlib's 'urlopen'
..


Work around circular ref in Python stdlib's 'urlopen'

The Python standard library's `urlopen` function (`urllib2.urlopen` in Python
2, and `urllib.request.urlopen` in Python 3) has a circular reference problem.
This patch provides a simple helper method, 'http_get', which fetches text from
a URI and which works around this issue. Verified with gc.DEBUG_LEAK.

The leak and some workarounds are documented in 
http://bugs.python.org/issue1208304.

Change-Id: I9961c7a3769e0827ad5d83eaa10b1911182b2904
---
M server/eventlogging/compat.py
M server/eventlogging/schema.py
2 files changed, 17 insertions(+), 3 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/server/eventlogging/compat.py b/server/eventlogging/compat.py
index a0b772d..84ee6ed 100644
--- a/server/eventlogging/compat.py
+++ b/server/eventlogging/compat.py
@@ -49,6 +49,21 @@
 return unquote(bytes).decode('utf-8')
 
 
+def http_get(url):
+Simple wrapper around the standard library's `urlopen` function which
+works around a circular ref. See http://bugs.python.org/issue1208304.
+
+req = None
+try:
+req = urlopen(url)
+return req.read().decode('utf-8')
+finally:
+if req is not None:
+if hasattr(req, 'fp') and hasattr(req.fp, '_sock'):
+req.fp._sock.recv = None
+req.close()
+
+
 @functools.wraps(uuid.uuid5)
 def uuid5(namespace, name):
 Generate UUID5 for `name` in `namespace`.
diff --git a/server/eventlogging/schema.py b/server/eventlogging/schema.py
index 8436fb5..7b414c4 100644
--- a/server/eventlogging/schema.py
+++ b/server/eventlogging/schema.py
@@ -13,7 +13,7 @@
 
 import jsonschema
 
-from .compat import json, urlopen
+from .compat import json, http_get
 
 __all__ = ('CAPSULE_SCID', 'get_schema', 'SCHEMA_URL_FORMAT', 'validate')
 
@@ -53,8 +53,7 @@
 Retrieve schema via HTTP.
 url = SCHEMA_URL_FORMAT % scid
 try:
-content = urlopen(url).read().decode('utf-8')
-schema = json.loads(content)
+schema = json.loads(http_get(url))
 except (ValueError, EnvironmentError) as ex:
 raise jsonschema.SchemaError('Schema fetch failure: %s' % ex)
 jsonschema.Draft3Validator.check_schema(schema)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9961c7a3769e0827ad5d83eaa10b1911182b2904
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Work around circular ref in Python stdlib's 'urlopen' - change (mediawiki...EventLogging)

2013-07-20 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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


Change subject: Work around circular ref in Python stdlib's 'urlopen'
..

Work around circular ref in Python stdlib's 'urlopen'

The Python standard library's `urlopen` function (`urllib2.urlopen` in Python
2, and `urllib.request.urlopen` in Python 3) has a circular reference problem.
This patch provides a simple helper method, 'http_get', which fetches text from
a URI and which works around this issue. Verified with gc.DEBUG_LEAK.

Change-Id: I9961c7a3769e0827ad5d83eaa10b1911182b2904
---
M server/eventlogging/compat.py
M server/eventlogging/schema.py
2 files changed, 17 insertions(+), 3 deletions(-)


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

diff --git a/server/eventlogging/compat.py b/server/eventlogging/compat.py
index a0b772d..84ee6ed 100644
--- a/server/eventlogging/compat.py
+++ b/server/eventlogging/compat.py
@@ -49,6 +49,21 @@
 return unquote(bytes).decode('utf-8')
 
 
+def http_get(url):
+Simple wrapper around the standard library's `urlopen` function which
+works around a circular ref. See http://bugs.python.org/issue1208304.
+
+req = None
+try:
+req = urlopen(url)
+return req.read().decode('utf-8')
+finally:
+if req is not None:
+if hasattr(req, 'fp') and hasattr(req.fp, '_sock'):
+req.fp._sock.recv = None
+req.close()
+
+
 @functools.wraps(uuid.uuid5)
 def uuid5(namespace, name):
 Generate UUID5 for `name` in `namespace`.
diff --git a/server/eventlogging/schema.py b/server/eventlogging/schema.py
index 8436fb5..7b414c4 100644
--- a/server/eventlogging/schema.py
+++ b/server/eventlogging/schema.py
@@ -13,7 +13,7 @@
 
 import jsonschema
 
-from .compat import json, urlopen
+from .compat import json, http_get
 
 __all__ = ('CAPSULE_SCID', 'get_schema', 'SCHEMA_URL_FORMAT', 'validate')
 
@@ -53,8 +53,7 @@
 Retrieve schema via HTTP.
 url = SCHEMA_URL_FORMAT % scid
 try:
-content = urlopen(url).read().decode('utf-8')
-schema = json.loads(content)
+schema = json.loads(http_get(url))
 except (ValueError, EnvironmentError) as ex:
 raise jsonschema.SchemaError('Schema fetch failure: %s' % ex)
 jsonschema.Draft3Validator.check_schema(schema)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9961c7a3769e0827ad5d83eaa10b1911182b2904
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Update HttpSchemaTestMixin for `http_get` - change (mediawiki...EventLogging)

2013-07-20 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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


Change subject: Update HttpSchemaTestMixin for `http_get`
..

Update HttpSchemaTestMixin for `http_get`

This patch updates HttpSchemaTestMixin to stub `http_get` rather than
`urlopen`, as the former is now what the production code uses to retrieve
schema.

Also removes outer try/except loop from eventlogging-consumer.

Change-Id: I49db6947791e88bcd221d0e446f8201d58e1b76b
---
M server/bin/eventlogging-consumer
M server/tests/fixtures.py
M server/tests/test_schema.py
3 files changed, 13 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging 
refs/changes/26/74926/1

diff --git a/server/bin/eventlogging-consumer b/server/bin/eventlogging-consumer
index e58abf4..9d793d3 100755
--- a/server/bin/eventlogging-consumer
+++ b/server/bin/eventlogging-consumer
@@ -46,8 +46,4 @@
 eventlogging.load_plugins()
 
 log.info('Driving %s - %s..', args.input, args.output)
-while 1:
-try:
-eventlogging.drive(args.input, args.output)
-except:
-log.exception('drive() failure')
+eventlogging.drive(args.input, args.output)
diff --git a/server/tests/fixtures.py b/server/tests/fixtures.py
index 5aa16d9..1fb9a5c 100644
--- a/server/tests/fixtures.py
+++ b/server/tests/fixtures.py
@@ -174,22 +174,22 @@
 class HttpSchemaTestMixin(object):
 A :class:`unittest.TestCase` mix-in for stubbing HTTP responses.
 
-http_resp = b''
+http_resp = ''
 
 def setUp(self):
-Replace `urlopen` with stub.
+Replace `http_get` with stub.
 super(HttpSchemaTestMixin, self).setUp()
-self.orig_urlopen = eventlogging.schema.urlopen
-eventlogging.schema.urlopen = self.urlopen_stub
+self.orig_http_get = eventlogging.schema.http_get
+eventlogging.schema.http_get = self.http_get_stub
 eventlogging.schema.schema_cache.clear()
 
 def tearDown(self):
-Restore original `urlopen`.
-eventlogging.schema.urlopen = self.orig_urlopen
+Restore original `http_get`.
+eventlogging.schema.http_get = self.orig_http_get
 
-def urlopen_stub(self, url):
-Test stub for `urlopen`.
-return io.BytesIO(self.http_resp)
+def http_get_stub(self, url):
+Test stub for `http_get`.
+return self.http_resp
 
 
 class HandlerTestMixin(object):
diff --git a/server/tests/test_schema.py b/server/tests/test_schema.py
index 56bebbb..4aeb6ae 100644
--- a/server/tests/test_schema.py
+++ b/server/tests/test_schema.py
@@ -31,19 +31,19 @@
 
 def test_valid_resp(self):
 Test handling of HTTP response containing valid schema.
-self.http_resp = b'{properties:{value:{type:number}}}'
+self.http_resp = '{properties:{value:{type:number}}}'
 schema = eventlogging.schema.http_get_schema(TEST_SCHEMA_SCID)
 self.assertEqual(schema, {'properties': {'value': {'type': 'number'}}})
 
 def test_invalid_resp(self):
 Test handling of HTTP response not containing valid schema.
-self.http_resp = b'foo'
+self.http_resp = 'foo'
 with self.assertRaises(eventlogging.SchemaError):
 eventlogging.schema.http_get_schema(TEST_SCHEMA_SCID)
 
 def test_caching(self):
 Valid HTTP responses containing JSON Schema are cached.
-self.http_resp = b'{properties:{value:{type:number}}}'
+self.http_resp = '{properties:{value:{type:number}}}'
 eventlogging.get_schema(TEST_SCHEMA_SCID)
 self.assertIn(TEST_SCHEMA_SCID, eventlogging.schema.schema_cache)
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49db6947791e88bcd221d0e446f8201d58e1b76b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Update HttpSchemaTestMixin for `http_get` - change (mediawiki...EventLogging)

2013-07-20 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update HttpSchemaTestMixin for `http_get`
..


Update HttpSchemaTestMixin for `http_get`

This patch updates HttpSchemaTestMixin to stub `http_get` rather than
`urlopen`, as the former is now what the production code uses to retrieve
schema.

Also removes outer try/except loop from eventlogging-consumer.

Change-Id: I49db6947791e88bcd221d0e446f8201d58e1b76b
---
M server/bin/eventlogging-consumer
M server/tests/fixtures.py
M server/tests/test_schema.py
3 files changed, 13 insertions(+), 17 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/server/bin/eventlogging-consumer b/server/bin/eventlogging-consumer
index e58abf4..9d793d3 100755
--- a/server/bin/eventlogging-consumer
+++ b/server/bin/eventlogging-consumer
@@ -46,8 +46,4 @@
 eventlogging.load_plugins()
 
 log.info('Driving %s - %s..', args.input, args.output)
-while 1:
-try:
-eventlogging.drive(args.input, args.output)
-except:
-log.exception('drive() failure')
+eventlogging.drive(args.input, args.output)
diff --git a/server/tests/fixtures.py b/server/tests/fixtures.py
index 5aa16d9..1fb9a5c 100644
--- a/server/tests/fixtures.py
+++ b/server/tests/fixtures.py
@@ -174,22 +174,22 @@
 class HttpSchemaTestMixin(object):
 A :class:`unittest.TestCase` mix-in for stubbing HTTP responses.
 
-http_resp = b''
+http_resp = ''
 
 def setUp(self):
-Replace `urlopen` with stub.
+Replace `http_get` with stub.
 super(HttpSchemaTestMixin, self).setUp()
-self.orig_urlopen = eventlogging.schema.urlopen
-eventlogging.schema.urlopen = self.urlopen_stub
+self.orig_http_get = eventlogging.schema.http_get
+eventlogging.schema.http_get = self.http_get_stub
 eventlogging.schema.schema_cache.clear()
 
 def tearDown(self):
-Restore original `urlopen`.
-eventlogging.schema.urlopen = self.orig_urlopen
+Restore original `http_get`.
+eventlogging.schema.http_get = self.orig_http_get
 
-def urlopen_stub(self, url):
-Test stub for `urlopen`.
-return io.BytesIO(self.http_resp)
+def http_get_stub(self, url):
+Test stub for `http_get`.
+return self.http_resp
 
 
 class HandlerTestMixin(object):
diff --git a/server/tests/test_schema.py b/server/tests/test_schema.py
index 56bebbb..4aeb6ae 100644
--- a/server/tests/test_schema.py
+++ b/server/tests/test_schema.py
@@ -31,19 +31,19 @@
 
 def test_valid_resp(self):
 Test handling of HTTP response containing valid schema.
-self.http_resp = b'{properties:{value:{type:number}}}'
+self.http_resp = '{properties:{value:{type:number}}}'
 schema = eventlogging.schema.http_get_schema(TEST_SCHEMA_SCID)
 self.assertEqual(schema, {'properties': {'value': {'type': 'number'}}})
 
 def test_invalid_resp(self):
 Test handling of HTTP response not containing valid schema.
-self.http_resp = b'foo'
+self.http_resp = 'foo'
 with self.assertRaises(eventlogging.SchemaError):
 eventlogging.schema.http_get_schema(TEST_SCHEMA_SCID)
 
 def test_caching(self):
 Valid HTTP responses containing JSON Schema are cached.
-self.http_resp = b'{properties:{value:{type:number}}}'
+self.http_resp = '{properties:{value:{type:number}}}'
 eventlogging.get_schema(TEST_SCHEMA_SCID)
 self.assertIn(TEST_SCHEMA_SCID, eventlogging.schema.schema_cache)
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I49db6947791e88bcd221d0e446f8201d58e1b76b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Set ZMQ_HWM, ZMQ_LINGER ZMQ_(SND|RCV)BUF on all sockets - change (mediawiki...EventLogging)

2013-07-20 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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


Change subject: Set ZMQ_HWM, ZMQ_LINGER  ZMQ_(SND|RCV)BUF on all sockets
..

Set ZMQ_HWM, ZMQ_LINGER  ZMQ_(SND|RCV)BUF on all sockets

This patch sets a default high-water mark, socket buffer size and linger
timeout on all ZeroMQ sockets, to prevent memory bloat.

Change-Id: I4a14c951960bc4a82cf33b48395940fa9d2dcfea
---
M server/bin/eventlogging-forwarder
M server/bin/eventlogging-multiplexer
M server/bin/eventlogging-processor
M server/eventlogging/handlers.py
M server/eventlogging/stream.py
5 files changed, 47 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging 
refs/changes/27/74927/1

diff --git a/server/bin/eventlogging-forwarder 
b/server/bin/eventlogging-forwarder
index 1ec925e..78be6a5 100755
--- a/server/bin/eventlogging-forwarder
+++ b/server/bin/eventlogging-forwarder
@@ -30,6 +30,8 @@
 import zmq
 
 
+from eventlogging.stream import HWM, LINGER, BLOCK_SIZE
+
 UDP_BUFSIZE = 65536  # Udp2LogConfig::BLOCK_SIZE
 
 parser = argparse.ArgumentParser(description='ZeroMQ UDP = PUB Device',
@@ -45,6 +47,9 @@
 
 ctx = zmq.Context.instance()
 sock_out = ctx.socket(zmq.PUB)
+sock_out.hwm = HWM
+sock_out.linger = LINGER
+sock_out.setsockopt(zmq.SNDBUF, BLOCK_SIZE)
 sock_out.bind('tcp://*:%d' % args.port)
 
 logging.info('Forwarding udp:%d = tcp:%d...', args.port, args.port)
@@ -52,7 +57,7 @@
 sock_in.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
 sock_in.bind(('0.0.0.0', args.port))
 
-with io.open(sock_in.fileno(), buffering=UDP_BUFSIZE, encoding='utf8',
+with io.open(sock_in.fileno(), buffering=BLOCK_SIZE, encoding='utf8',
  errors='ignore') as f:
 if args.count:
 f = (str(id) + '\t' + msg for id, msg in enumerate(f))
diff --git a/server/bin/eventlogging-multiplexer 
b/server/bin/eventlogging-multiplexer
index 2e1d740..61f4ec8 100755
--- a/server/bin/eventlogging-multiplexer
+++ b/server/bin/eventlogging-multiplexer
@@ -30,6 +30,8 @@
 
 import zmq
 
+from eventlogging.stream import BLOCK_SIZE, HWM, LINGER
+
 
 logging.basicConfig(level=logging.DEBUG, stream=sys.stderr)
 
@@ -44,6 +46,9 @@
 poller = zmq.Poller()
 
 pub = ctx.socket(zmq.PUB)
+pub.hwm = HWM
+pub.linger = LINGER
+pub.setsockopt(zmq.SNDBUF, BLOCK_SIZE)
 pub.bind(args.output)
 logging.info('Writing to %s..', args.output)
 
@@ -52,7 +57,10 @@
 logging.info('Polling %s..', uri)
 sock = ctx.socket(zmq.SUB)
 if args.sid is not None:
-sock.setsockopt(zmq.IDENTITY, args.sid)
+sock.identity = args.sid.encode('utf8')
+sock.hwm = HWM
+sock.linger = LINGER
+sock.setsockopt(zmq.RCVBUF, BLOCK_SIZE)
 sock.connect(uri)
 sock.setsockopt(zmq.SUBSCRIBE, b'')
 poller.register(sock, zmq.POLLIN)
diff --git a/server/bin/eventlogging-processor 
b/server/bin/eventlogging-processor
index 83bfd37..e0c246b 100755
--- a/server/bin/eventlogging-processor
+++ b/server/bin/eventlogging-processor
@@ -38,6 +38,7 @@
 import zmq
 
 from eventlogging import capsule_uuid, json, LogParser, validate, zmq_subscribe
+from eventlogging.stream import HWM, LINGER, BLOCK_SIZE
 
 
 logging.basicConfig(level=logging.DEBUG, stream=sys.stderr)
@@ -54,6 +55,9 @@
 
 context = zmq.Context.instance()
 pub = context.socket(zmq.PUB)
+pub.hwm = HWM
+pub.linger = LINGER
+pub.setsockopt(zmq.SNDBUF, BLOCK_SIZE)
 pub.bind(args.output)
 
 logging.info('Publishing JSON events on %s.', args.output)
diff --git a/server/eventlogging/handlers.py b/server/eventlogging/handlers.py
index 9d867b1..4319f14 100644
--- a/server/eventlogging/handlers.py
+++ b/server/eventlogging/handlers.py
@@ -27,6 +27,7 @@
 
 from .factory import writes, reads, mapper
 from .compat import urlparse
+from .stream import BLOCK_SIZE, HWM, LINGER
 from .jrm import store_sql_event
 
 
@@ -36,8 +37,6 @@
 #: 'EVENTLOGGING_PLUGIN_DIR' environment variable if it is defined. If it is
 #: not defined, EventLogging will default to the value specified below.
 DEFAULT_PLUGIN_DIR = '/usr/local/lib/eventlogging'
-
-UDP_BLOCK_SIZE = 65536  # Corresponds to Udp2LogConfig::BLOCK_SIZE
 
 
 def iter_text(f, encoding='utf8', errors='replace', **kwargs):
@@ -117,6 +116,9 @@
 Publish events on a ZeroMQ publisher socket.
 context = zmq.Context.instance()
 pub = context.socket(zmq.PUB)
+pub.hwm = HWM
+pub.linger = LINGER
+pub.setsockopt(zmq.SNDBUF, BLOCK_SIZE)
 pub.bind(uri)
 
 while 1:
@@ -152,7 +154,10 @@
 context = zmq.Context.instance()
 sub = context.socket(zmq.SUB)
 if socket_id is not None:
-sub.setsockopt(zmq.IDENTITY, socket_id.encode('utf8'))
+sub.identity = socket_id.encode('utf8')
+sub.hwm = HWM
+sub.linger = LINGER
+sub.setsockopt(zmq.RCVBUF, BLOCK_SIZE)
 sub.connect(uri)
 sub.setsockopt(zmq.SUBSCRIBE, topic.encode('utf8'))
 
@@ -167,4 +172,4 @@
 sock = 

[MediaWiki-commits] [Gerrit] Set ZMQ_HWM, ZMQ_LINGER ZMQ_(SND|RCV)BUF on all sockets - change (mediawiki...EventLogging)

2013-07-20 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Set ZMQ_HWM, ZMQ_LINGER  ZMQ_(SND|RCV)BUF on all sockets
..


Set ZMQ_HWM, ZMQ_LINGER  ZMQ_(SND|RCV)BUF on all sockets

This patch sets a default high-water mark, socket buffer size and linger
timeout on all ZeroMQ sockets, to prevent memory bloat.

Change-Id: I4a14c951960bc4a82cf33b48395940fa9d2dcfea
---
M server/bin/eventlogging-forwarder
M server/bin/eventlogging-multiplexer
M server/bin/eventlogging-processor
M server/eventlogging/handlers.py
M server/eventlogging/stream.py
5 files changed, 47 insertions(+), 7 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/server/bin/eventlogging-forwarder 
b/server/bin/eventlogging-forwarder
index 1ec925e..78be6a5 100755
--- a/server/bin/eventlogging-forwarder
+++ b/server/bin/eventlogging-forwarder
@@ -30,6 +30,8 @@
 import zmq
 
 
+from eventlogging.stream import HWM, LINGER, BLOCK_SIZE
+
 UDP_BUFSIZE = 65536  # Udp2LogConfig::BLOCK_SIZE
 
 parser = argparse.ArgumentParser(description='ZeroMQ UDP = PUB Device',
@@ -45,6 +47,9 @@
 
 ctx = zmq.Context.instance()
 sock_out = ctx.socket(zmq.PUB)
+sock_out.hwm = HWM
+sock_out.linger = LINGER
+sock_out.setsockopt(zmq.SNDBUF, BLOCK_SIZE)
 sock_out.bind('tcp://*:%d' % args.port)
 
 logging.info('Forwarding udp:%d = tcp:%d...', args.port, args.port)
@@ -52,7 +57,7 @@
 sock_in.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
 sock_in.bind(('0.0.0.0', args.port))
 
-with io.open(sock_in.fileno(), buffering=UDP_BUFSIZE, encoding='utf8',
+with io.open(sock_in.fileno(), buffering=BLOCK_SIZE, encoding='utf8',
  errors='ignore') as f:
 if args.count:
 f = (str(id) + '\t' + msg for id, msg in enumerate(f))
diff --git a/server/bin/eventlogging-multiplexer 
b/server/bin/eventlogging-multiplexer
index 2e1d740..61f4ec8 100755
--- a/server/bin/eventlogging-multiplexer
+++ b/server/bin/eventlogging-multiplexer
@@ -30,6 +30,8 @@
 
 import zmq
 
+from eventlogging.stream import BLOCK_SIZE, HWM, LINGER
+
 
 logging.basicConfig(level=logging.DEBUG, stream=sys.stderr)
 
@@ -44,6 +46,9 @@
 poller = zmq.Poller()
 
 pub = ctx.socket(zmq.PUB)
+pub.hwm = HWM
+pub.linger = LINGER
+pub.setsockopt(zmq.SNDBUF, BLOCK_SIZE)
 pub.bind(args.output)
 logging.info('Writing to %s..', args.output)
 
@@ -52,7 +57,10 @@
 logging.info('Polling %s..', uri)
 sock = ctx.socket(zmq.SUB)
 if args.sid is not None:
-sock.setsockopt(zmq.IDENTITY, args.sid)
+sock.identity = args.sid.encode('utf8')
+sock.hwm = HWM
+sock.linger = LINGER
+sock.setsockopt(zmq.RCVBUF, BLOCK_SIZE)
 sock.connect(uri)
 sock.setsockopt(zmq.SUBSCRIBE, b'')
 poller.register(sock, zmq.POLLIN)
diff --git a/server/bin/eventlogging-processor 
b/server/bin/eventlogging-processor
index 83bfd37..e0c246b 100755
--- a/server/bin/eventlogging-processor
+++ b/server/bin/eventlogging-processor
@@ -38,6 +38,7 @@
 import zmq
 
 from eventlogging import capsule_uuid, json, LogParser, validate, zmq_subscribe
+from eventlogging.stream import HWM, LINGER, BLOCK_SIZE
 
 
 logging.basicConfig(level=logging.DEBUG, stream=sys.stderr)
@@ -54,6 +55,9 @@
 
 context = zmq.Context.instance()
 pub = context.socket(zmq.PUB)
+pub.hwm = HWM
+pub.linger = LINGER
+pub.setsockopt(zmq.SNDBUF, BLOCK_SIZE)
 pub.bind(args.output)
 
 logging.info('Publishing JSON events on %s.', args.output)
diff --git a/server/eventlogging/handlers.py b/server/eventlogging/handlers.py
index 9d867b1..4319f14 100644
--- a/server/eventlogging/handlers.py
+++ b/server/eventlogging/handlers.py
@@ -27,6 +27,7 @@
 
 from .factory import writes, reads, mapper
 from .compat import urlparse
+from .stream import BLOCK_SIZE, HWM, LINGER
 from .jrm import store_sql_event
 
 
@@ -36,8 +37,6 @@
 #: 'EVENTLOGGING_PLUGIN_DIR' environment variable if it is defined. If it is
 #: not defined, EventLogging will default to the value specified below.
 DEFAULT_PLUGIN_DIR = '/usr/local/lib/eventlogging'
-
-UDP_BLOCK_SIZE = 65536  # Corresponds to Udp2LogConfig::BLOCK_SIZE
 
 
 def iter_text(f, encoding='utf8', errors='replace', **kwargs):
@@ -117,6 +116,9 @@
 Publish events on a ZeroMQ publisher socket.
 context = zmq.Context.instance()
 pub = context.socket(zmq.PUB)
+pub.hwm = HWM
+pub.linger = LINGER
+pub.setsockopt(zmq.SNDBUF, BLOCK_SIZE)
 pub.bind(uri)
 
 while 1:
@@ -152,7 +154,10 @@
 context = zmq.Context.instance()
 sub = context.socket(zmq.SUB)
 if socket_id is not None:
-sub.setsockopt(zmq.IDENTITY, socket_id.encode('utf8'))
+sub.identity = socket_id.encode('utf8')
+sub.hwm = HWM
+sub.linger = LINGER
+sub.setsockopt(zmq.RCVBUF, BLOCK_SIZE)
 sub.connect(uri)
 sub.setsockopt(zmq.SUBSCRIBE, topic.encode('utf8'))
 
@@ -167,4 +172,4 @@
 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
 

[MediaWiki-commits] [Gerrit] Ganglia module: set ZMQ_HWM, ZMQ_LINGER ZMQ_SNDRCV on SUB ... - change (mediawiki...EventLogging)

2013-07-20 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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


Change subject: Ganglia module: set ZMQ_HWM, ZMQ_LINGER  ZMQ_SNDRCV on SUB 
sockets
..

Ganglia module: set ZMQ_HWM, ZMQ_LINGER  ZMQ_SNDRCV on SUB sockets

Change-Id: Ib54568642b557dede19a8fa72117c4ea45ec5721
---
M ganglia/python_modules/eventlogging_mon.py
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/ganglia/python_modules/eventlogging_mon.py 
b/ganglia/python_modules/eventlogging_mon.py
index ac9ff55..f40eb61 100644
--- a/ganglia/python_modules/eventlogging_mon.py
+++ b/ganglia/python_modules/eventlogging_mon.py
@@ -66,6 +66,9 @@
 for name, uri in endpoints.iteritems():
 logging.info('Registering %s (%s).', name, uri)
 socket = ctx.socket(zmq.SUB)
+socket.hwm = 1000
+socket.linger = 1000
+socket.setsockopt(zmq.RCVBUF, 65536)
 socket.connect(uri)
 socket.setsockopt(zmq.SUBSCRIBE, '')
 poller.register(socket, zmq.POLLIN)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib54568642b557dede19a8fa72117c4ea45ec5721
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Ganglia module: set ZMQ_HWM, ZMQ_LINGER ZMQ_SNDRCV on SUB ... - change (mediawiki...EventLogging)

2013-07-20 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Ganglia module: set ZMQ_HWM, ZMQ_LINGER  ZMQ_SNDRCV on SUB 
sockets
..


Ganglia module: set ZMQ_HWM, ZMQ_LINGER  ZMQ_SNDRCV on SUB sockets

Change-Id: Ib54568642b557dede19a8fa72117c4ea45ec5721
---
M ganglia/python_modules/eventlogging_mon.py
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ganglia/python_modules/eventlogging_mon.py 
b/ganglia/python_modules/eventlogging_mon.py
index ac9ff55..f40eb61 100644
--- a/ganglia/python_modules/eventlogging_mon.py
+++ b/ganglia/python_modules/eventlogging_mon.py
@@ -66,6 +66,9 @@
 for name, uri in endpoints.iteritems():
 logging.info('Registering %s (%s).', name, uri)
 socket = ctx.socket(zmq.SUB)
+socket.hwm = 1000
+socket.linger = 1000
+socket.setsockopt(zmq.RCVBUF, 65536)
 socket.connect(uri)
 socket.setsockopt(zmq.SUBSCRIBE, '')
 poller.register(socket, zmq.POLLIN)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib54568642b557dede19a8fa72117c4ea45ec5721
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Revert Revert Revert Revert Automatically register repo ... - change (mediawiki...Wikibase)

2013-07-20 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

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


Change subject: Revert Revert Revert Revert Automatically register repo 
tests.
..

Revert Revert Revert Revert Automatically register repo tests.

This reverts commit d0b951beeff2e4dc2693177be2acd6b0cd14f8a2.

Change-Id: Idc11440312fa229a2c53aee092756cbfc9ea8381
---
M repo/Wikibase.hooks.php
M repo/tests/phpunit/includes/EditEntityTest.php
M repo/tests/phpunit/includes/api/ModifyEntityTestBase.php
M repo/tests/phpunit/includes/api/PermissionsTest.php
4 files changed, 73 insertions(+), 160 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/30/74930/1

diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index fe1e9a0..695e855 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -1,10 +1,13 @@
 ?php
 
 namespace Wikibase;
-
+use RecursiveDirectoryIterator;
+use RecursiveIteratorIterator;
 use RequestContext;
+use SplFileInfo;
 use Title, Language, User, Revision, WikiPage, EditPage, ContentHandler, Html, 
MWException;
 use Wikibase\Repo\WikibaseRepo;
+
 
 /**
  * File defining the hook handlers for the Wikibase extension.
@@ -150,102 +153,19 @@
 */
public static function registerUnitTests( array $files ) {
// @codeCoverageIgnoreStart
-   $testFiles = array(
-   'Autocomment',
-   'ClaimSummaryBuilder',
-   'EditEntity',
-   'EntityView',
-   'ItemMove',
-   'ItemContentDiffView',
-   'ItemMove',
-   'ItemView',
-   'LabelDescriptionDuplicateDetector',
-   'MultiLangConstraintDetector',
-   'NamespaceUtils',
-   'Summary',
-   'WikibaseRepo',
+   $directoryIterator = new RecursiveDirectoryIterator( __DIR__ . 
'/tests/phpunit/' );
 
-   'actions/EditEntityAction',
-   'actions/ViewEntityAction',
-
-   'api/BotEdit',
-   'api/EditPage',
-   'api/GetEntities',
-   'api/SetLabel',
-   'api/SetDescription',
-   'api/LinkTitles',
-   'api/Permissions',
-   'api/SetAliases',
-   'api/EditEntity',
-   'api/SetSiteLink',
-   'api/CreateClaim',
-   'api/GetClaims',
-   'api/RemoveClaims',
-   'api/SetClaimValue',
-   'api/SetReference',
-   'api/RemoveReferences',
-   'api/SetClaim',
-   'api/RemoveQualifiers',
-   'api/SetQualifier',
-   'api/SnakValidationHelper',
-   'api/ItemByTitleHelper',
-
-   'changeop/ChangeOps',
-   'changeop/ChangeOpLabel',
-   'changeop/ChangeOpDescription',
-   'changeop/ChangeOpAliases',
-   'changeop/ChangeOpSiteLink',
-
-   'content/EntityContentFactory',
-   'content/EntityHandler',
-   'content/ItemContent',
-   'content/ItemHandler',
-   'content/PropertyContent',
-   'content/PropertyHandler',
-
-   'LinkedData/EntityDataSerializationService',
-   'LinkedData/EntityDataRequestHandler',
-   'LinkedData/EntityDataUriManager',
-
-   'rdf/RdfBuilder',
-   'rdf/RdfSerializer',
-
-   'specials/SpecialEntityData',
-   'specials/SpecialMyLanguageFallbackChain',
-   'specials/SpecialNewItem',
-   'specials/SpecialNewProperty',
-   'specials/SpecialItemDisambiguation',
-   'specials/SpecialItemByTitle',
-   'specials/SpecialSetDescription',
-   'specials/SpecialSetLabel',
-   'specials/SpecialSetAliases',
-
-   'store/IdGenerator',
-   'store/StoreFactory',
-   'store/Store',
-
-   'store/sql/DispatchStats',
-   'store/sql/EntityPerPageBuilder',
-   'store/sql/SqlIdGenerator',
-   'store/sql/TermSqlIndex',
-   'store/sql/TermSearchKeyBuilder',
-
-   'updates/ItemDeletionUpdate',
-   

[MediaWiki-commits] [Gerrit] Properly reset group permissions in EntityContentTest - change (mediawiki...Wikibase)

2013-07-20 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

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


Change subject: Properly reset group permissions in EntityContentTest
..

Properly reset group permissions in EntityContentTest

This will (I'm 99% sure this time) fix the remaining
problems we see with travis.

Change-Id: Ic40f273332e1c1fdeffbb7bbfc4d11e77f2c0827
---
M repo/tests/phpunit/includes/content/EntityContentTest.php
1 file changed, 25 insertions(+), 6 deletions(-)


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

diff --git a/repo/tests/phpunit/includes/content/EntityContentTest.php 
b/repo/tests/phpunit/includes/content/EntityContentTest.php
index a268d64..7c4c194 100644
--- a/repo/tests/phpunit/includes/content/EntityContentTest.php
+++ b/repo/tests/phpunit/includes/content/EntityContentTest.php
@@ -35,20 +35,39 @@
  */
 abstract class EntityContentTest extends \MediaWikiTestCase {
 
+   protected $permissions;
+   protected $old_user;
+
function setUp() {
global $wgGroupPermissions, $wgUser;
 
parent::setUp();
-   $this-setMwGlobals(
-   array(
-   'wgGroupPermissions' = $wgGroupPermissions,
-   'wgUser' = $wgUser
-   )
-   );
+
+   $this-permissions = $wgGroupPermissions;
+   $this-old_user = $wgUser;
 
\TestSites::insertIntoDb();
}
 
+   function tearDown() {
+   global $wgGroupPermissions;
+   global $wgUser;
+
+   $wgGroupPermissions = $this-permissions;
+
+   if ( $this-old_user ) { // should not be null, but sometimes, 
it is
+   $wgUser = $this-old_user;
+   }
+
+   if ( $wgUser ) { // should not be null, but sometimes, it is
+   // reset rights cache
+   $wgUser-addGroup( dummy );
+   $wgUser-removeGroup( dummy );
+   }
+
+   parent::tearDown();
+   }
+
public function dataGetTextForSearchIndex() {
return array( // runs
array( // //0

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic40f273332e1c1fdeffbb7bbfc4d11e77f2c0827
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man h...@online.de

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


[MediaWiki-commits] [Gerrit] Process cache the central user ID - change (mediawiki...OAuth)

2013-07-20 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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


Change subject: Process cache the central user ID
..

Process cache the central user ID

Change-Id: I1af30d6602cb8aa4f257e1eb24d998fae1c152f2
---
M backend/MWOAuthUtils.php
1 file changed, 11 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth 
refs/changes/31/74931/1

diff --git a/backend/MWOAuthUtils.php b/backend/MWOAuthUtils.php
index 6cda593..59c7a72 100644
--- a/backend/MWOAuthUtils.php
+++ b/backend/MWOAuthUtils.php
@@ -243,11 +243,17 @@
if ( MWOAuthUtils::isCentralWiki() ) {
$id = $user-getId();
} else { // only some central user system can give us the ID
-   $id = false;
-   // Let CentralAuth check that $user is attached to a 
global account and
-   // that the foreign local account on the central wiki 
is also attached to it
-   wfRunHooks( 'OAuthGetCentralIdFromLocalUser',
-   array( $user, $wgMWOAuthCentralWiki, $id ) );
+   if ( isset( $user-oAuthUserData['centralId'] ) ) {
+   $id = $user-oAuthUserData['centralId'];
+   } else {
+   $id = false;
+   // Let CentralAuth check that $user is attached 
to a global account and
+   // that the foreign local account on the 
central wiki is also attached to it
+   wfRunHooks( 'OAuthGetCentralIdFromLocalUser',
+   array( $user, $wgMWOAuthCentralWiki, 
$id ) );
+   // Process cache the result to avoid queries
+   $user-oAuthUserData['centralId'] = $id;
+   }
}
 
if ( !$id ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1af30d6602cb8aa4f257e1eb24d998fae1c152f2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz asch...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fixed remaining misuse of central user ID - change (mediawiki...OAuth)

2013-07-20 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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


Change subject: Fixed remaining misuse of central user ID
..

Fixed remaining misuse of central user ID

Change-Id: Id21ffc9053cb7d2b88341511403ce41d0bfc98dd
---
M backend/MWOAuthDataStore.php
M backend/MWOAuthServer.php
M frontend/MWOAuthUI.hooks.php
M frontend/specialpages/SpecialMWOAuth.php
4 files changed, 10 insertions(+), 4 deletions(-)


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

diff --git a/backend/MWOAuthDataStore.php b/backend/MWOAuthDataStore.php
index e513805..9701cc6 100644
--- a/backend/MWOAuthDataStore.php
+++ b/backend/MWOAuthDataStore.php
@@ -97,7 +97,7 @@
public static function newToken() {
return new MWOAuthToken(
MWCryptRand::generateHex( 32, false), // the key 
doesn't need to be unpredictable
-   MWCryptRand::generateHex( 32, true)
+   MWCryptRand::generateHex( 32, true )
);
}
 
diff --git a/backend/MWOAuthServer.php b/backend/MWOAuthServer.php
index ec42f5a..6217f65 100644
--- a/backend/MWOAuthServer.php
+++ b/backend/MWOAuthServer.php
@@ -126,7 +126,7 @@
// ** Generate a new access token if this is a new authorization
// * Resave request token with the access token
 
-   $verifyCode = MWCryptRand::generateHex( 32, true);
+   $verifyCode = MWCryptRand::generateHex( 32, true );
$requestToken = $this-data_store-lookup_token( $consumer, 
'request', $requestTokenKey );
if ( !$requestToken || !( $requestToken instanceof MWOAuthToken 
) ) {
throw new MWOAuthException( 
'mwoauthserver-invalid-request-token' );
diff --git a/frontend/MWOAuthUI.hooks.php b/frontend/MWOAuthUI.hooks.php
index 01c491b..3b674d9 100644
--- a/frontend/MWOAuthUI.hooks.php
+++ b/frontend/MWOAuthUI.hooks.php
@@ -3,7 +3,7 @@
  * Class containing GUI even handler functions for an OAuth environment
  */
 class MWOAuthUIHooks {
-   public static function onGetPreferences(  $user, $preferences ) {
+   public static function onGetPreferences( $user, $preferences ) {
$prefInsert = array( 'mwoauth-prefs-managegrants' =
array(
'section' = 'personal/info',
diff --git a/frontend/specialpages/SpecialMWOAuth.php 
b/frontend/specialpages/SpecialMWOAuth.php
index 11f84cf..4d523f9 100644
--- a/frontend/specialpages/SpecialMWOAuth.php
+++ b/frontend/specialpages/SpecialMWOAuth.php
@@ -81,6 +81,12 @@
$mwUser,
$consumer-getDAO()
);
+   // Get the name of the central 
user that published the consumer
+   $publisher = $dbr-selectField( 
'user', 'user_name',
+   array( 'user_id' = 
$consumer-get( 'userId' ) ), __METHOD__ );
+   if ( !is_string( $publisher ) ) 
{
+   throw new 
MWOAuthException( 'mwoauth-bad-request' );
+   }
 
$formParams = array(
'consumerKey' = 
$consumerKey,
@@ -88,7 +94,7 @@
'grants' = 
$consumer-get( 'grants' ),
'existing' = $existing,
'description' = array (
-   'user' = 
User::newFromId( $consumer-get( 'userId') )-getName(),
+   'user' = 
$publisher,
'name' = 
$consumer-get( 'name'),
'version' = 
$consumer-get( 'version'),
'description' 
= $consumer-get( 'description'),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id21ffc9053cb7d2b88341511403ce41d0bfc98dd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz asch...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Made newFromNameVersionUser() not accept User objects to avo... - change (mediawiki...OAuth)

2013-07-20 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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


Change subject: Made newFromNameVersionUser() not accept User objects to avoid 
confusion
..

Made newFromNameVersionUser() not accept User objects to avoid confusion

Change-Id: If1f63733461f828c3584f3d1af0f98cd024b5c64
---
M backend/MWOAuthConsumer.php
1 file changed, 3 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth 
refs/changes/33/74933/1

diff --git a/backend/MWOAuthConsumer.php b/backend/MWOAuthConsumer.php
index 6a26d1c..d3dc2ab 100644
--- a/backend/MWOAuthConsumer.php
+++ b/backend/MWOAuthConsumer.php
@@ -131,18 +131,16 @@
 * @param DBConnRef $db
 * @param string $name
 * @param string $version
-* @param User|integer $user User or user ID
+* @param integer $userId Central user ID
 * @param integer $flags MWOAuthConsumer::READ_* bitfield
 * @return MWOAuthConsumer|bool
 */
public static function newFromNameVersionUser(
-   DBConnRef $db, $name, $version, $user, $flags = 0
+   DBConnRef $db, $name, $version, $userId, $flags = 0
) {
-   $uid = ( $user instanceof User ) ? $user-getId() : $user;
-
$row = $db-selectRow( static::getTable(),
array_values( static::getFieldColumnMap() ),
-   array( 'oarc_name' = $name, 'oarc_version' = 
$version, 'oarc_user_id' = $uid ),
+   array( 'oarc_name' = $name, 'oarc_version' = 
$version, 'oarc_user_id' = $userId ),
__METHOD__,
( $flags  self::READ_LOCKING ) ? array( 'FOR UPDATE' ) 
: array()
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If1f63733461f828c3584f3d1af0f98cd024b5c64
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz asch...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Enforce 1.0a callback param handling - change (mediawiki...OAuth)

2013-07-20 Thread CSteipp (Code Review)
CSteipp has uploaded a new change for review.

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


Change subject: Enforce 1.0a callback param handling
..

Enforce 1.0a callback param handling

The 1.0a specification requires that oauth_callback is included in the
request to /initiate. It also requires that oauth_callback_confirmed be
returned. (see RFC5849, section 2.1)

Change-Id: I144ef583dcabf2c7ac89f3f7d21bc36a64107b1f
---
M backend/MWOAuthServer.php
M frontend/language/MWOAuth.i18n.php
M tests/testClient.php
M tests/testClientHeaders.php
4 files changed, 14 insertions(+), 4 deletions(-)


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

diff --git a/backend/MWOAuthServer.php b/backend/MWOAuthServer.php
index ec42f5a..0f7ece7 100644
--- a/backend/MWOAuthServer.php
+++ b/backend/MWOAuthServer.php
@@ -26,10 +26,17 @@
 
$this-check_signature( $request, $consumer, $token );
 
-   // Rev A change
+   // In MediaWiki, we require the callback to be established at 
registration
+   // OAuth 1.0a (rfc5849, section 2.1) specifies that 
oauth_callback is required
+   // for the temporary credentials, and If the client is unable 
to receive callbacks 
+   // or a callback URI has been established via other means, the 
parameter value MUST 
+   // be set to oob (case sensitive), to indicate an out-of-band 
configuration.
$callback = $request-get_parameter( 'oauth_callback' );
+   if ( !$callback || $callback !== 'oob' ) {
+   throw new MWOAuthException( 'callback-not-oob' );
+   }
$new_token = $this-data_store-new_request_token( $consumer, 
$callback );
-
+   $new_token-oauth_callback_confirmed = 'true';
return $new_token;
}
 
diff --git a/frontend/language/MWOAuth.i18n.php 
b/frontend/language/MWOAuth.i18n.php
index 044b8ce..631f44f 100644
--- a/frontend/language/MWOAuth.i18n.php
+++ b/frontend/language/MWOAuth.i18n.php
@@ -212,6 +212,8 @@
'mwoauth-grant-createeditmovepage' = 'Create, edit, and move pages',
'mwoauth-grant-uploadfile' = 'Upload new files',
'mwoauth-grant-uploadeditmovefile' = 'Upload, replace, and move files',
+
+   'mwoauth-callback-not-oob' = 'oauth_callback must be set, and must be 
set to oob (case-sensitive)',
 );
 
 /** Message documentation (Message documentation)
@@ -407,6 +409,7 @@
'mwoauth-grants-createpages' = '{{Identical|Create page}}',
'mwoauth-grants-deletepages' = '{{Identical|Delete page}}',
'mwoauth-grants-upload' = '{{Identical|Upload file}}',
+   'mwoauth-callback-not-oob' = 'Warning that the OAuth developer failed 
to include the required oauth_callback parameter, which must be set to the 
case-sensitive string oob',
 );
 
 /** Asturian (asturianu)
diff --git a/tests/testClient.php b/tests/testClient.php
index 383ea64..26de10c 100644
--- a/tests/testClient.php
+++ b/tests/testClient.php
@@ -13,7 +13,7 @@
 $consumerKey = 'dpf43f3p2l4k3l03';
 $consumerSecret = 'kd94hf93k423kf44';
 $baseurl = 'https://localhost/wiki/index.php?title=Special:MWOAuth';
-$endpoint = $baseurl . '/initiateformat=json';
+$endpoint = $baseurl . '/initiateformat=jsonoauth_callback=oob';
 
 $endpoint_acc = $baseurl . '/tokenformat=json';
 
diff --git a/tests/testClientHeaders.php b/tests/testClientHeaders.php
index 82c8a19..80d5850 100644
--- a/tests/testClientHeaders.php
+++ b/tests/testClientHeaders.php
@@ -13,7 +13,7 @@
 $consumerKey = 'dpf43f3p2l4k3l03';
 $consumerSecret = 'kd94hf93k423kf44';
 $baseurl = 'https://localhost/wiki/index.php?title=Special:MWOAuth';
-$endpoint = $baseurl . '/initiateformat=json';
+$endpoint = $baseurl . '/initiateformat=jsonoauth_callback=oob';
 
 $endpoint_acc = $baseurl . '/tokenformat=json';
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I144ef583dcabf2c7ac89f3f7d21bc36a64107b1f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: CSteipp cste...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Use MWOAuthUtils::grantName() to fix broken messages - change (mediawiki...OAuth)

2013-07-20 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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


Change subject: Use MWOAuthUtils::grantName() to fix broken messages
..

Use MWOAuthUtils::grantName() to fix broken messages

Change-Id: I934e9ebde513b63ac88ad0aa13a89c41ecfc53ca
---
M frontend/specialpages/SpecialMWOAuth.php
1 file changed, 2 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth 
refs/changes/35/74935/1

diff --git a/frontend/specialpages/SpecialMWOAuth.php 
b/frontend/specialpages/SpecialMWOAuth.php
index 11f84cf..7c1c6f9 100644
--- a/frontend/specialpages/SpecialMWOAuth.php
+++ b/frontend/specialpages/SpecialMWOAuth.php
@@ -207,15 +207,11 @@
);
} else {
$list = '';
-   foreach ( $grants as $grant) {
-   // Give grep a chance to find the usages:
-   // mwoauth-grants-editpages, 
mwoauth-grants-editmyinterface, mwoauth-grants-editinterface,
-   // mwoauth-grants-movepages, 
mwoauth-grants-createpages, mwoauth-grants-deletepages,
-   // mwoauth-grants-upload
+   foreach ( $grants as $grant ) {
$list .= Html::element(
'li',
array(),
-   $this-msg( mwoauth-grants-$grant 
)-text()
+   MWOAuthUtils::grantName( $grant )
);
}
$html .= Html::rawElement( 'ul', array(), $list );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I934e9ebde513b63ac88ad0aa13a89c41ecfc53ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz asch...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Added CLI guards around test scripts - change (mediawiki...OAuth)

2013-07-20 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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


Change subject: Added CLI guards around test scripts
..

Added CLI guards around test scripts

Change-Id: I0850bfd38a2ea4e32592ec3833b861ee5c9723cf
---
M tests/testClient.php
M tests/testClientHeaders.php
2 files changed, 10 insertions(+), 0 deletions(-)


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

diff --git a/tests/testClient.php b/tests/testClient.php
index 383ea64..27b180d 100644
--- a/tests/testClient.php
+++ b/tests/testClient.php
@@ -1,4 +1,9 @@
 ?php
+
+if ( PHP_SAPI !== 'cli' ) {
+   die( CLI-only test script );
+}
+
 /**
  * A basic client for overall testing
  */
diff --git a/tests/testClientHeaders.php b/tests/testClientHeaders.php
index 82c8a19..24b9dbe 100644
--- a/tests/testClientHeaders.php
+++ b/tests/testClientHeaders.php
@@ -1,4 +1,9 @@
 ?php
+
+if ( PHP_SAPI !== 'cli' ) {
+   die( CLI-only test script );
+}
+
 /**
  * A basic client for overall testing
  */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0850bfd38a2ea4e32592ec3833b861ee5c9723cf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz asch...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Make the user a bot, not a sysop. - change (mediawiki...MassMessage)

2013-07-20 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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


Change subject: Make the user a bot, not a sysop.
..

Make the user a bot, not a sysop.

Left over from a bad copy-paste job from AbuseFilter.

Change-Id: I0e1a33ecf842e78ed4d1896dd168f91033078179
---
M MassMessage.body.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage 
refs/changes/37/74937/1

diff --git a/MassMessage.body.php b/MassMessage.body.php
index 96b75f2..be3404e 100644
--- a/MassMessage.body.php
+++ b/MassMessage.body.php
@@ -44,7 +44,7 @@
}
 
// Make the user a bot so it doesn't look weird
-   $user-addGroup( 'sysop' );
+   $user-addGroup( 'bot' );
 
return $user;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e1a33ecf842e78ed4d1896dd168f91033078179
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com

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


[MediaWiki-commits] [Gerrit] Make the user a bot, not a sysop. - change (mediawiki...MassMessage)

2013-07-20 Thread Legoktm (Code Review)
Legoktm has submitted this change and it was merged.

Change subject: Make the user a bot, not a sysop.
..


Make the user a bot, not a sysop.

Left over from a bad copy-paste job from AbuseFilter.

Change-Id: I0e1a33ecf842e78ed4d1896dd168f91033078179
---
M MassMessage.body.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Legoktm: Verified; Looks good to me, approved



diff --git a/MassMessage.body.php b/MassMessage.body.php
index 96b75f2..be3404e 100644
--- a/MassMessage.body.php
+++ b/MassMessage.body.php
@@ -44,7 +44,7 @@
}
 
// Make the user a bot so it doesn't look weird
-   $user-addGroup( 'sysop' );
+   $user-addGroup( 'bot' );
 
return $user;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0e1a33ecf842e78ed4d1896dd168f91033078179
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com

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


[MediaWiki-commits] [Gerrit] Hardcode the bot's username as $wgMassMessageAccountUsername - change (mediawiki...MassMessage)

2013-07-20 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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


Change subject: Hardcode the bot's username as $wgMassMessageAccountUsername
..

Hardcode the bot's username as $wgMassMessageAccountUsername

Rather than using a translated username, use one hardcoded one so we can
ensure that local administrators cannot change it. Also migrate the code to 
create
the account with to be run when update.php is.

I also added in a simple hook to prevent crats from renaming the user account, 
which
would break global posting.

Change-Id: I4e95ef97d693ba62d69758ac96401064e1b0f097
---
M MassMessage.body.php
A MassMessage.hooks.php
M MassMessage.i18n.php
M MassMessage.php
4 files changed, 77 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage 
refs/changes/38/74938/1

diff --git a/MassMessage.body.php b/MassMessage.body.php
index be3404e..e48c0d2 100644
--- a/MassMessage.body.php
+++ b/MassMessage.body.php
@@ -11,41 +11,15 @@
  */
 
 
-
 class MassMessage {
 
/*
-* Sets up the messenger account for our use if it hasn't been already.
+* Returns the user account to send messages with.
 *
 * @return User
-* @fixme This should use the langage for the target site, not 
submission site
 */
public static function getMessengerUser() {
-   // Function kinda copied from the AbuseFilter
-   $user = User::newFromName( wfMessage( 'massmessage-sender' 
)-inContentLanguage()-text() );
-   $user-load();
-   if ( $user-getId()  $user-mPassword == '' ) {
-   // We've already stolen the account
-   return $user;
-   }
-
-   if ( !$user-getId() ) {
-   $user-addToDatabase();
-   $user-saveSettings();
-
-   // Increment site_stats.ss_users
-   $ssu = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
-   $ssu-doUpdate();
-   } else {
-   // Someone already created the account, lets take it 
over.
-   $user-setPassword( null );
-   $user-setEmail( null );
-   $user-saveSettings();
-   }
-
-   // Make the user a bot so it doesn't look weird
-   $user-addGroup( 'bot' );
-
-   return $user;
+   global $wgMassMessageAccountUsername;
+   return User::newFromName( $wgMassMessageAccountUsername );
}
-}
\ No newline at end of file
+}
diff --git a/MassMessage.hooks.php b/MassMessage.hooks.php
new file mode 100644
index 000..a7d2307
--- /dev/null
+++ b/MassMessage.hooks.php
@@ -0,0 +1,56 @@
+?php
+
+/*
+ * Hooks!
+ *
+ * @file
+ * @author Kunal Mehta
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
+ */
+
+class MassMessageHooks {
+   /**
+* If someone is trying to rename the bot, don't let them.
+* @param $uid int
+* @param $oldName string
+* @param $newName string
+* @return bool|string
+*/
+   public static function onRenameUserPreRename( $uid, $oldName, $newName 
) {
+   if ( $oldName == wfMessage( 'massmessage-sender' 
)-inContentLanguage()-text() ) {
+   return wfMessage( 'massmessage-cannot-rename' 
)-inContentLanguage()-text() ;
+   }
+   return true;
+   }
+   /**
+* Create the bot account on setup.
+* Function inspired by the AbuseFilter extension
+*/
+
+   public static function onLoadExtensionSchemaUpdates( DatabaseUpdater 
$updater ) {
+   global $wgMassMessageAccountUsername, 
$wgMassMessageAccountPassword;
+   
+   $user = User::newFromName( $wgMassMessageAccountUsername );
+   $user-load();
+
+   if ( !$user-getId() ) { // Doesn't exist yet
+   $user-addToDatabase();
+   $user-saveSettings();
+
+   // Increment site_stats.ss_users
+   $ssu = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
+   $ssu-doUpdate();
+   }
+   // It might already exist, but doing this doesn't hurt.
+   $user-setPassword( $wgMassMessageAccountPassword );
+   $user-setEmail( null ); // This isn't important because we can 
easily reset the password.
+   $user-saveSettings();
+   if ( !in_array( 'bot', $user-getGroups() ) ) {
+   // Make the user a bot so it doesn't look weird
+   $user-addGroup( 'bot' );
+   }
+
+   return true;
+
+   }
+}
diff --git a/MassMessage.i18n.php