[MediaWiki-commits] [Gerrit] Avoid pointless getNativeData() call in isCountable() - change (mediawiki/core)

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

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

Change subject: Avoid pointless getNativeData() call in isCountable()
..

Avoid pointless getNativeData() call in isCountable()

Change-Id: I40ed1972a8815de645d11217b35c1060d5007e5a
---
M includes/content/WikitextContent.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/07/212507/1

diff --git a/includes/content/WikitextContent.php 
b/includes/content/WikitextContent.php
index dbe09f9..3b449b6 100644
--- a/includes/content/WikitextContent.php
+++ b/includes/content/WikitextContent.php
@@ -273,12 +273,11 @@
return false;
}
 
-   $text = $this->getNativeData();
-
switch ( $wgArticleCountMethod ) {
case 'any':
return true;
case 'comma':
+   $text = $this->getNativeData();
return strpos( $text, ',' ) !== false;
case 'link':
if ( $hasLinks === null ) { # not known, find 
out

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I40ed1972a8815de645d11217b35c1060d5007e5a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] should still be short URL in repo I think - change (wikidata...rdf)

2015-05-20 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review.

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

Change subject: should still be short URL in repo I think
..

should still be short URL in repo I think

Change-Id: Ie9f990aeb586af44d3966a6964223d04ad6e6f77
---
M gui/gui.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/06/212506/1

diff --git a/gui/gui.js b/gui/gui.js
index 485f8f4..ee609b8 100644
--- a/gui/gui.js
+++ b/gui/gui.js
@@ -2,7 +2,7 @@
 window.EDITOR = {};
 
 (function($, mw) {
-   var SERVICE = 
'http://wdqs-beta.wmflabs.org/bigdata/namespace/wdq/sparql',
+   var SERVICE = '/bigdata/namespace/wdq/sparql',
SHORTURL = 'http://tinyurl.com/create.php?url=',
NAMESPACE_SHORTCUTS = {
'Wikidata' : {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9f990aeb586af44d3966a6964223d04ad6e6f77
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 

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


[MediaWiki-commits] [Gerrit] Make sure $dbw is an object in DeferredUpdates::addUpdate() - change (mediawiki/core)

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

Change subject: Make sure $dbw is an object in DeferredUpdates::addUpdate()
..


Make sure $dbw is an object in DeferredUpdates::addUpdate()

Change-Id: Ib52574bc7f2e13bf06f595e349a7b3ccea425056
---
M includes/deferred/DeferredUpdates.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/deferred/DeferredUpdates.php 
b/includes/deferred/DeferredUpdates.php
index 29bb8d7..082d435 100644
--- a/includes/deferred/DeferredUpdates.php
+++ b/includes/deferred/DeferredUpdates.php
@@ -65,7 +65,7 @@
$lb = wfGetLB();
$dbw = $lb->getAnyOpenConnection( $lb->getWriterIndex() 
);
// Do the update as soon as there is no transaction
-   if ( $dbw->trxLevel() ) {
+   if ( $dbw && $dbw->trxLevel() ) {
$waitingOnTrx = true;
$dbw->onTransactionIdle( function() use ( 
&$waitingOnTrx ) {
DeferredUpdates::doUpdates();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib52574bc7f2e13bf06f595e349a7b3ccea425056
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Make sure $dbw is an object in DeferredUpdates::addUpdate() - change (mediawiki/core)

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

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

Change subject: Make sure $dbw is an object in DeferredUpdates::addUpdate()
..

Make sure $dbw is an object in DeferredUpdates::addUpdate()

Change-Id: Ib52574bc7f2e13bf06f595e349a7b3ccea425056
---
M includes/deferred/DeferredUpdates.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/deferred/DeferredUpdates.php 
b/includes/deferred/DeferredUpdates.php
index 29bb8d7..082d435 100644
--- a/includes/deferred/DeferredUpdates.php
+++ b/includes/deferred/DeferredUpdates.php
@@ -65,7 +65,7 @@
$lb = wfGetLB();
$dbw = $lb->getAnyOpenConnection( $lb->getWriterIndex() 
);
// Do the update as soon as there is no transaction
-   if ( $dbw->trxLevel() ) {
+   if ( $dbw && $dbw->trxLevel() ) {
$waitingOnTrx = true;
$dbw->onTransactionIdle( function() use ( 
&$waitingOnTrx ) {
DeferredUpdates::doUpdates();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib52574bc7f2e13bf06f595e349a7b3ccea425056
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] CX: Fix language codes - change (operations/puppet)

2015-05-20 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review.

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

Change subject: CX: Fix language codes
..

CX: Fix language codes

Language selector shouldn't use MW domain code.

Change-Id: Ie2f1ea1f5ead4b98db940fe6ffb26f6628b2046c
---
M hieradata/common/cxserver.yaml
M hieradata/labs/deployment-prep/common.yaml
2 files changed, 9 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/04/212504/1

diff --git a/hieradata/common/cxserver.yaml b/hieradata/common/cxserver.yaml
index 460b149..c3bef1c 100644
--- a/hieradata/common/cxserver.yaml
+++ b/hieradata/common/cxserver.yaml
@@ -24,7 +24,7 @@
 - 'be-x-old'
 - 'be'
 - 'bg'
-- 'bh'
+- 'bho'
 - 'bi'
 - 'bjn'
 - 'bm'
@@ -46,7 +46,7 @@
 - 'chy'
 - 'ckb'
 - 'co'
-- 'crh'
+- 'crh-latn'
 - 'cr'
 - 'csb'
 - 'cs'
@@ -301,14 +301,15 @@
 - 'be'
 - 'bcl'
 - 'bg'
-- 'bh'
+- 'bho'
 - 'bm'
 - 'ca'
 - 'cbk-za'
 - 'ceb'
-- 'cv'
+- 'crh-latn'
 - 'cs'
 - 'csb'
+- 'cv'
 - 'da'
 - 'ee'
 - 'el'
diff --git a/hieradata/labs/deployment-prep/common.yaml 
b/hieradata/labs/deployment-prep/common.yaml
index 90fac3e..79a1db2 100644
--- a/hieradata/labs/deployment-prep/common.yaml
+++ b/hieradata/labs/deployment-prep/common.yaml
@@ -80,7 +80,7 @@
 - 'be-x-old'
 - 'be'
 - 'bg'
-- 'bh'
+- 'bho'
 - 'bi'
 - 'bjn'
 - 'bm'
@@ -102,7 +102,7 @@
 - 'chy'
 - 'ckb'
 - 'co'
-- 'crh'
+- 'crh-latn'
 - 'cr'
 - 'csb'
 - 'cs'
@@ -369,7 +369,7 @@
 - 'be-x-old'
 - 'be'
 - 'bg'
-- 'bh'
+- 'bho'
 - 'bi'
 - 'bjn'
 - 'bm'
@@ -391,7 +391,7 @@
 - 'chy'
 - 'ckb'
 - 'co'
-- 'crh'
+- 'crh-latn'
 - 'cr'
 - 'csb'
 - 'cs'

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

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

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


[MediaWiki-commits] [Gerrit] Test with $wgDiff = false when wikidiff2 is installed - change (mediawiki...Echo)

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

Change subject: Test with $wgDiff = false when wikidiff2 is installed
..


Test with $wgDiff = false when wikidiff2 is installed

Change-Id: I404b26589d0e8788c458f72c1d608af859e98a6f
---
M tests/phpunit/includes/DiscussionParserTest.php
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/tests/phpunit/includes/DiscussionParserTest.php 
b/tests/phpunit/includes/DiscussionParserTest.php
index ebb1a32..c0c29b5 100644
--- a/tests/phpunit/includes/DiscussionParserTest.php
+++ b/tests/phpunit/includes/DiscussionParserTest.php
@@ -120,7 +120,9 @@
protected function setUp() {
parent::setUp();
 
-   $this->setMwGlobals( array( 'wgDiff' => false ) );
+   if ( extension_loaded( 'wikidiff2' ) ) {
+   $this->setMwGlobals( array( 'wgDiff' => false ) );
+   }
 
// we only need to add these users once, we won't (can't) tear 
them down anyway
static $executed = false;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I404b26589d0e8788c458f72c1d608af859e98a6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Test with $wgDiff = false when wikidiff2 is installed - change (mediawiki...Echo)

2015-05-20 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Test with $wgDiff = false when wikidiff2 is installed
..

Test with $wgDiff = false when wikidiff2 is installed

Change-Id: I404b26589d0e8788c458f72c1d608af859e98a6f
---
M tests/phpunit/includes/DiscussionParserTest.php
1 file changed, 3 insertions(+), 1 deletion(-)


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

diff --git a/tests/phpunit/includes/DiscussionParserTest.php 
b/tests/phpunit/includes/DiscussionParserTest.php
index ebb1a32..c0c29b5 100644
--- a/tests/phpunit/includes/DiscussionParserTest.php
+++ b/tests/phpunit/includes/DiscussionParserTest.php
@@ -120,7 +120,9 @@
protected function setUp() {
parent::setUp();
 
-   $this->setMwGlobals( array( 'wgDiff' => false ) );
+   if ( extension_loaded( 'wikidiff2' ) ) {
+   $this->setMwGlobals( array( 'wgDiff' => false ) );
+   }
 
// we only need to add these users once, we won't (can't) tear 
them down anyway
static $executed = false;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I404b26589d0e8788c458f72c1d608af859e98a6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 

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


[MediaWiki-commits] [Gerrit] cxserver should use valid language codes - change (mediawiki...cxserver)

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

Change subject: cxserver should use valid language codes
..


cxserver should use valid language codes

To avoid all confusions, do not mix up valid MW content language codes and
language codes in the Wiki domains.

For example, bho is a valid content language while bh is not. bh is
used in the domain of bh.wikipedia.org

cxserver should never use language codes in the domain names.

Change-Id: I687e66967b0762b0decaec92261818748c43ce86
---
M config.defaults.js
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/config.defaults.js b/config.defaults.js
index c281be0..3700355 100644
--- a/config.defaults.js
+++ b/config.defaults.js
@@ -23,8 +23,8 @@
cert: null,
// Service registry
registry: {
-   source: [ 'aa', 'ab', 'ace', 'af', 'ak', 'als', 'am', 'ang', 
'an', 'arc', 'ar', 'arz', 'ast', 'as', 'av', 'ay', 'az', 'bar', 'bat-smg', 
'ba', 'bcl', 'be-x-old', 'be', 'bg', 'bh', 'bi', 'bjn', 'bm', 'bn', 'bo', 
'bpy', 'br', 'bs', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ceb', 'ce', 'cho', 
'chr', 'ch', 'chy', 'ckb', 'co', 'crh', 'cr', 'csb', 'cs', 'cu', 'cv', 'cy', 
'da', 'de', 'diq', 'dsb', 'dv', 'dz', 'ee', 'el', 'eml', 'en', 'eo', 'es', 
'et', 'eu', 'ext', 'fa', 'ff', 'fiu-vro', 'fi', 'fj', 'fo', 'frp', 'frr', 'fr', 
'fur', 'fy', 'gag', 'gan', 'ga', 'gd', 'glk', 'gl', 'gn', 'got', 'gu', 'gv', 
'hak', 'ha', 'haw', 'he', 'hif', 'hi', 'ho', 'hr', 'hsb', 'ht', 'hu', 'hy', 
'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ilo', 'io', 'is', 'it', 'iu', 'ja', 
'jbo', 'jv', 'kaa', 'kab', 'ka', 'kbd', 'kg', 'ki', 'kj', 'kk', 'kl', 'km', 
'kn', 'koi', 'ko', 'krc', 'kr', 'ksh', 'ks', 'ku', 'kv', 'kw', 'ky', 'lad', 
'la', 'lbe', 'lb', 'lez', 'lg', 'lij', 'li', 'lmo', 'ln', 'lo', 'ltg', 'lt', 
'lv', 'mai', 'map-bms', 'mdf', 'mg', 'mhr', 'mh', 'min', 'mi', 'mk', 'ml', 
'mn', 'mo', 'mrj', 'mr', 'ms', 'mt', 'mus', 'mwl', 'myv', 'my', 'mzn', 'nah', 
'nap', 'na', 'nds-nl', 'nds', 'ne', 'new', 'ng', 'nl', 'nn', 'nov', 'no', 
'nrm', 'nso', 'nv', 'ny', 'oc', 'om', 'or', 'os', 'pag', 'pam', 'pap', 'pa', 
'pcd', 'pdc', 'pfl', 'pih', 'pi', 'pl', 'pms', 'pnb', 'pnt', 'ps', 'pt', 'qu', 
'rm', 'rmy', 'rn', 'roa-rup', 'roa-tara', 'ro', 'rue', 'ru', 'rw', 'sah', 'sa', 
'scn', 'sco', 'sc', 'sd', 'se', 'sg', 'sh', 'simple', 'si', 'sk', 'sl', 'sm', 
'sn', 'so', 'sq', 'srn', 'sr', 'ss', 'stq', 'st', 'su', 'sv', 'sw', 'szl', 
'ta', 'tet', 'te', 'tg', 'th', 'ti', 'tk', 'tl', 'tn', 'to', 'tpi', 'tr', 'ts', 
'tt', 'tum', 'tw', 'tyv', 'ty', 'udm', 'ug', 'uk', 'ur', 'uz', 'vec', 'vep', 
've', 'vi', 'vls', 'vo', 'war', 'wa', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'yi', 
'yo', 'za', 'zea', 'zh-classical', 'zh-min-nan', 'zh-yue', 'zh', 'zu' ],
-   target: [ 'aa', 'ab', 'ace', 'af', 'ak', 'als', 'am', 'ang', 
'an', 'arc', 'ar', 'arz', 'ast', 'as', 'av', 'ay', 'az', 'bar', 'bat-smg', 
'ba', 'bcl', 'be-x-old', 'be', 'bg', 'bh', 'bi', 'bjn', 'bm', 'bn', 'bo', 
'bpy', 'br', 'bs', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ceb', 'ce', 'cho', 
'chr', 'ch', 'chy', 'ckb', 'co', 'crh', 'cr', 'csb', 'cs', 'cu', 'cv', 'cy', 
'da', 'de', 'diq', 'dsb', 'dv', 'dz', 'ee', 'el', 'eml', 'en', 'eo', 'es', 
'et', 'eu', 'ext', 'fa', 'ff', 'fiu-vro', 'fi', 'fj', 'fo', 'frp', 'frr', 'fr', 
'fur', 'fy', 'gag', 'gan', 'ga', 'gd', 'glk', 'gl', 'gn', 'got', 'gu', 'gv', 
'hak', 'ha', 'haw', 'he', 'hif', 'hi', 'ho', 'hr', 'hsb', 'ht', 'hu', 'hy', 
'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ilo', 'io', 'is', 'it', 'iu', 'ja', 
'jbo', 'jv', 'kaa', 'kab', 'ka', 'kbd', 'kg', 'ki', 'kj', 'kk', 'kl', 'km', 
'kn', 'koi', 'ko', 'krc', 'kr', 'ksh', 'ks', 'ku', 'kv', 'kw', 'ky', 'lad', 
'la', 'lbe', 'lb', 'lez', 'lg', 'lij', 'li', 'lmo', 'ln', 'lo', 'ltg', 'lt', 
'lv', 'mai', 'map-bms', 'mdf', 'mg', 'mhr', 'mh', 'min', 'mi', 'mk', 'ml', 
'mn', 'mo', 'mrj', 'mr', 'ms', 'mt', 'mus', 'mwl', 'myv', 'my', 'mzn', 'nah', 
'nap', 'na', 'nds-nl', 'nds', 'ne', 'new', 'ng', 'nl', 'nn', 'nov', 'no', 
'nrm', 'nso', 'nv', 'ny', 'oc', 'om', 'or', 'os', 'pag', 'pam', 'pap', 'pa', 
'pcd', 'pdc', 'pfl', 'pih', 'pi', 'pl', 'pms', 'pnb', 'pnt', 'ps', 'pt', 'qu', 
'rm', 'rmy', 'rn', 'roa-rup', 'roa-tara', 'ro', 'rue', 'ru', 'rw', 'sah', 'sa', 
'scn', 'sco', 'sc', 'sd', 'se', 'sg', 'sh', 'simple', 'si', 'sk', 'sl', 'sm', 
'sn', 'so', 'sq', 'srn', 'sr', 'ss', 'stq', 'st', 'su', 'sv', 'sw', 'szl', 
'ta', 'tet', 'te', 'tg', 'th', 'ti', 'tk', 'tl', 'tn', 'to', 'tpi', 'tr', 'ts', 
'tt', 'tum', 'tw', 'tyv', 'ty', 'udm', 'ug', 'uk', 'ur', 'uz', 'vec', 'vep', 
've', 'vi', 'vls', 'vo', 'war', 'wa', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'yi', 
'yo', 'za', 'zea', 'zh-classical', 'zh-min-nan', 'zh-yue', 'zh', 'zu' ],
+   source: [ 'aa', 'ab', 'ace', 'af', 'ak', 'als', 'am', 'ang', 
'an', 'arc', 'ar', 'arz', 'ast', 'as', 'av', 'ay', 'az', 'bar', 'bat-smg', 
'ba', 'bcl', 'be-x-

[MediaWiki-commits] [Gerrit] Run DiscussionParserTest with $wgDiff = false to match prod - change (mediawiki...Echo)

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

Change subject: Run DiscussionParserTest with $wgDiff = false to match prod
..


Run DiscussionParserTest with $wgDiff = false to match prod

Change-Id: Ie2f64bdb5c614a71412d935ea1b8e9ce7dc2a9a4
---
M tests/phpunit/includes/DiscussionParserTest.php
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/tests/phpunit/includes/DiscussionParserTest.php 
b/tests/phpunit/includes/DiscussionParserTest.php
index 0b9f3c1..ebb1a32 100644
--- a/tests/phpunit/includes/DiscussionParserTest.php
+++ b/tests/phpunit/includes/DiscussionParserTest.php
@@ -120,6 +120,8 @@
protected function setUp() {
parent::setUp();
 
+   $this->setMwGlobals( array( 'wgDiff' => false ) );
+
// we only need to add these users once, we won't (can't) tear 
them down anyway
static $executed = false;
if ( $executed === true ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie2f64bdb5c614a71412d935ea1b8e9ce7dc2a9a4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 
Gerrit-Reviewer: Mattflaschen 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Run DiscussionParserTest with $wgDiff = false to match prod - change (mediawiki...Echo)

2015-05-20 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Run DiscussionParserTest with $wgDiff = false to match prod
..

Run DiscussionParserTest with $wgDiff = false to match prod

Change-Id: Ie2f64bdb5c614a71412d935ea1b8e9ce7dc2a9a4
---
M tests/phpunit/includes/DiscussionParserTest.php
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/tests/phpunit/includes/DiscussionParserTest.php 
b/tests/phpunit/includes/DiscussionParserTest.php
index 0b9f3c1..ebb1a32 100644
--- a/tests/phpunit/includes/DiscussionParserTest.php
+++ b/tests/phpunit/includes/DiscussionParserTest.php
@@ -120,6 +120,8 @@
protected function setUp() {
parent::setUp();
 
+   $this->setMwGlobals( array( 'wgDiff' => false ) );
+
// we only need to add these users once, we won't (can't) tear 
them down anyway
static $executed = false;
if ( $executed === true ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2f64bdb5c614a71412d935ea1b8e9ce7dc2a9a4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 

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


[MediaWiki-commits] [Gerrit] Make wbmergeitems respect the bot parameter - change (mediawiki...Wikibase)

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

Change subject: Make wbmergeitems respect the bot parameter
..


Make wbmergeitems respect the bot parameter

Change-Id: I6627b56c5ca357057481357ccde61feef77e3bac
---
M repo/includes/Interactors/ItemMergeInteractor.php
M repo/includes/api/MergeItems.php
M repo/tests/phpunit/includes/api/BotEditTest.php
3 files changed, 41 insertions(+), 15 deletions(-)

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



diff --git a/repo/includes/Interactors/ItemMergeInteractor.php 
b/repo/includes/Interactors/ItemMergeInteractor.php
index 7ac98f0..ef0ebd4 100644
--- a/repo/includes/Interactors/ItemMergeInteractor.php
+++ b/repo/includes/Interactors/ItemMergeInteractor.php
@@ -127,13 +127,14 @@
 * @param ItemId $toId
 * @param array $ignoreConflicts The kinds of conflicts to ignore
 * @param string|null $summary
+* @param bool $bot Mark the edit as bot edit
 *
 * @return array A list of exactly two EntityRevision objects. The 
first one represents
 * the modified source item, the second one represents the modified 
target item.
 *
 * @throws ItemMergeException
 */
-   public function mergeItems( ItemId $fromId, ItemId $toId, 
$ignoreConflicts = array(), $summary = null ) {
+   public function mergeItems( ItemId $fromId, ItemId $toId, 
$ignoreConflicts = array(), $summary = null, $bot = false ) {
 
$this->checkPermissions( $fromId );
$this->checkPermissions( $toId );
@@ -159,7 +160,7 @@
throw new ItemMergeException( $e->getMessage(), 
'failed-modify', $e );
}
 
-   return $this->attemptSaveMerge( $fromEntity, $toEntity, 
$summary );
+   return $this->attemptSaveMerge( $fromEntity, $toEntity, 
$summary, $bot );
}
 
private function loadEntity( EntityId $entityId ) {
@@ -207,27 +208,33 @@
 * @param Item $fromItem
 * @param Item $toItem
 * @param string|null $summary
+* @param bool $bot
 *
 * @return array A list of exactly two EntityRevision objects. The 
first one represents
 * the modified source item, the second one represents the modified 
target item.
 */
-   private function attemptSaveMerge( Item $fromItem, Item $toItem, 
$summary = null ) {
+   private function attemptSaveMerge( Item $fromItem, Item $toItem, 
$summary, $bot ) {
$toSummary = $this->getSummary( 'to', $toItem->getId(), 
$summary );
-   $fromRev = $this->saveEntity( $fromItem, $toSummary );
+   $fromRev = $this->saveEntity( $fromItem, $toSummary, $bot );
 
$fromSummary = $this->getSummary( 'from', $fromItem->getId(), 
$summary );
-   $toRev = $this->saveEntity( $toItem, $fromSummary );
+   $toRev = $this->saveEntity( $toItem, $fromSummary, $bot );
 
return array( $fromRev, $toRev );
}
 
-   private function saveEntity( Entity $entity, Summary $summary ) {
+   private function saveEntity( Entity $entity, Summary $summary, $bot ) {
+   $flags = EDIT_UPDATE;
+   if ( $bot && $this->user->isAllowed( 'bot' ) ) {
+   $flags |= EDIT_FORCE_BOT;
+   }
+
try {
return $this->entityStore->saveEntity(
$entity,
$this->summaryFormatter->formatSummary( 
$summary ),
$this->user,
-   EDIT_UPDATE
+   $flags
);
} catch ( StorageException $ex ) {
throw new ItemMergeException( $ex->getMessage(), 
'failed-save', $ex );
diff --git a/repo/includes/api/MergeItems.php b/repo/includes/api/MergeItems.php
index d237786..e61f53c 100644
--- a/repo/includes/api/MergeItems.php
+++ b/repo/includes/api/MergeItems.php
@@ -126,7 +126,7 @@
$ignoreConflicts = array();
}
 
-   $this->mergeItems( $fromId, $toId, $ignoreConflicts, 
$summary );
+   $this->mergeItems( $fromId, $toId, $ignoreConflicts, 
$summary, $params['bot'] );
} catch ( EntityIdParsingException $ex ) {
$this->errorReporter->dieException( $ex, 
'invalid-entity-id' );
} catch ( ItemMergeException $ex ) {
@@ -139,9 +139,10 @@
 * @param ItemId $toId
 * @param array $ignoreConflicts
 * @param string $summary
+* @param bool $bot
 */
-   private function mergeItems( ItemId $fromId, ItemId $toId, array 
$ignoreConflicts, $summary ) {
-   list( $newRevisionFrom, $newRevisionTo ) = 
$this->interactor->mer

[MediaWiki-commits] [Gerrit] cxserver should use valid language codes - change (mediawiki...cxserver)

2015-05-20 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review.

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

Change subject: cxserver should use valid language codes
..

cxserver should use valid language codes

To avoid all confusions, do not mix up valid MW content language codes and
language codes in the Wiki domains.

For example, bho is a valid content language while bh is not. bh is
used in the domain of bh.wikipedia.org

cxserver should never use language codes in the domain names.

Change-Id: I687e66967b0762b0decaec92261818748c43ce86
---
M config.defaults.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/cxserver 
refs/changes/01/212501/1

diff --git a/config.defaults.js b/config.defaults.js
index c281be0..3700355 100644
--- a/config.defaults.js
+++ b/config.defaults.js
@@ -23,8 +23,8 @@
cert: null,
// Service registry
registry: {
-   source: [ 'aa', 'ab', 'ace', 'af', 'ak', 'als', 'am', 'ang', 
'an', 'arc', 'ar', 'arz', 'ast', 'as', 'av', 'ay', 'az', 'bar', 'bat-smg', 
'ba', 'bcl', 'be-x-old', 'be', 'bg', 'bh', 'bi', 'bjn', 'bm', 'bn', 'bo', 
'bpy', 'br', 'bs', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ceb', 'ce', 'cho', 
'chr', 'ch', 'chy', 'ckb', 'co', 'crh', 'cr', 'csb', 'cs', 'cu', 'cv', 'cy', 
'da', 'de', 'diq', 'dsb', 'dv', 'dz', 'ee', 'el', 'eml', 'en', 'eo', 'es', 
'et', 'eu', 'ext', 'fa', 'ff', 'fiu-vro', 'fi', 'fj', 'fo', 'frp', 'frr', 'fr', 
'fur', 'fy', 'gag', 'gan', 'ga', 'gd', 'glk', 'gl', 'gn', 'got', 'gu', 'gv', 
'hak', 'ha', 'haw', 'he', 'hif', 'hi', 'ho', 'hr', 'hsb', 'ht', 'hu', 'hy', 
'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ilo', 'io', 'is', 'it', 'iu', 'ja', 
'jbo', 'jv', 'kaa', 'kab', 'ka', 'kbd', 'kg', 'ki', 'kj', 'kk', 'kl', 'km', 
'kn', 'koi', 'ko', 'krc', 'kr', 'ksh', 'ks', 'ku', 'kv', 'kw', 'ky', 'lad', 
'la', 'lbe', 'lb', 'lez', 'lg', 'lij', 'li', 'lmo', 'ln', 'lo', 'ltg', 'lt', 
'lv', 'mai', 'map-bms', 'mdf', 'mg', 'mhr', 'mh', 'min', 'mi', 'mk', 'ml', 
'mn', 'mo', 'mrj', 'mr', 'ms', 'mt', 'mus', 'mwl', 'myv', 'my', 'mzn', 'nah', 
'nap', 'na', 'nds-nl', 'nds', 'ne', 'new', 'ng', 'nl', 'nn', 'nov', 'no', 
'nrm', 'nso', 'nv', 'ny', 'oc', 'om', 'or', 'os', 'pag', 'pam', 'pap', 'pa', 
'pcd', 'pdc', 'pfl', 'pih', 'pi', 'pl', 'pms', 'pnb', 'pnt', 'ps', 'pt', 'qu', 
'rm', 'rmy', 'rn', 'roa-rup', 'roa-tara', 'ro', 'rue', 'ru', 'rw', 'sah', 'sa', 
'scn', 'sco', 'sc', 'sd', 'se', 'sg', 'sh', 'simple', 'si', 'sk', 'sl', 'sm', 
'sn', 'so', 'sq', 'srn', 'sr', 'ss', 'stq', 'st', 'su', 'sv', 'sw', 'szl', 
'ta', 'tet', 'te', 'tg', 'th', 'ti', 'tk', 'tl', 'tn', 'to', 'tpi', 'tr', 'ts', 
'tt', 'tum', 'tw', 'tyv', 'ty', 'udm', 'ug', 'uk', 'ur', 'uz', 'vec', 'vep', 
've', 'vi', 'vls', 'vo', 'war', 'wa', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'yi', 
'yo', 'za', 'zea', 'zh-classical', 'zh-min-nan', 'zh-yue', 'zh', 'zu' ],
-   target: [ 'aa', 'ab', 'ace', 'af', 'ak', 'als', 'am', 'ang', 
'an', 'arc', 'ar', 'arz', 'ast', 'as', 'av', 'ay', 'az', 'bar', 'bat-smg', 
'ba', 'bcl', 'be-x-old', 'be', 'bg', 'bh', 'bi', 'bjn', 'bm', 'bn', 'bo', 
'bpy', 'br', 'bs', 'bug', 'bxr', 'ca', 'cbk-zam', 'cdo', 'ceb', 'ce', 'cho', 
'chr', 'ch', 'chy', 'ckb', 'co', 'crh', 'cr', 'csb', 'cs', 'cu', 'cv', 'cy', 
'da', 'de', 'diq', 'dsb', 'dv', 'dz', 'ee', 'el', 'eml', 'en', 'eo', 'es', 
'et', 'eu', 'ext', 'fa', 'ff', 'fiu-vro', 'fi', 'fj', 'fo', 'frp', 'frr', 'fr', 
'fur', 'fy', 'gag', 'gan', 'ga', 'gd', 'glk', 'gl', 'gn', 'got', 'gu', 'gv', 
'hak', 'ha', 'haw', 'he', 'hif', 'hi', 'ho', 'hr', 'hsb', 'ht', 'hu', 'hy', 
'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'ilo', 'io', 'is', 'it', 'iu', 'ja', 
'jbo', 'jv', 'kaa', 'kab', 'ka', 'kbd', 'kg', 'ki', 'kj', 'kk', 'kl', 'km', 
'kn', 'koi', 'ko', 'krc', 'kr', 'ksh', 'ks', 'ku', 'kv', 'kw', 'ky', 'lad', 
'la', 'lbe', 'lb', 'lez', 'lg', 'lij', 'li', 'lmo', 'ln', 'lo', 'ltg', 'lt', 
'lv', 'mai', 'map-bms', 'mdf', 'mg', 'mhr', 'mh', 'min', 'mi', 'mk', 'ml', 
'mn', 'mo', 'mrj', 'mr', 'ms', 'mt', 'mus', 'mwl', 'myv', 'my', 'mzn', 'nah', 
'nap', 'na', 'nds-nl', 'nds', 'ne', 'new', 'ng', 'nl', 'nn', 'nov', 'no', 
'nrm', 'nso', 'nv', 'ny', 'oc', 'om', 'or', 'os', 'pag', 'pam', 'pap', 'pa', 
'pcd', 'pdc', 'pfl', 'pih', 'pi', 'pl', 'pms', 'pnb', 'pnt', 'ps', 'pt', 'qu', 
'rm', 'rmy', 'rn', 'roa-rup', 'roa-tara', 'ro', 'rue', 'ru', 'rw', 'sah', 'sa', 
'scn', 'sco', 'sc', 'sd', 'se', 'sg', 'sh', 'simple', 'si', 'sk', 'sl', 'sm', 
'sn', 'so', 'sq', 'srn', 'sr', 'ss', 'stq', 'st', 'su', 'sv', 'sw', 'szl', 
'ta', 'tet', 'te', 'tg', 'th', 'ti', 'tk', 'tl', 'tn', 'to', 'tpi', 'tr', 'ts', 
'tt', 'tum', 'tw', 'tyv', 'ty', 'udm', 'ug', 'uk', 'ur', 'uz', 'vec', 'vep', 
've', 'vi', 'vls', 'vo', 'war', 'wa', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'yi', 
'yo', 'za', 'zea', 'zh-classical', 'zh-min-nan', 'zh-yue', 'zh', 'zu' ],
+   source: [ 'aa', 'ab', 'ace', 'af', 'ak', 'als', 'am', 'ang', 
'an', 'arc', 'ar', 'arz', 'ast', 'as', 'av', '

[MediaWiki-commits] [Gerrit] Work arround broken isset in php 5.3 - change (mediawiki...CirrusSearch)

2015-05-20 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Work arround broken isset in php 5.3
..

Work arround broken isset in php 5.3

Bug: T99871
Change-Id: I8e9040c6aef2a7607bbd9cec7b03960b2eadb3d6
---
M includes/ElasticsearchIntermediary.php
1 file changed, 31 insertions(+), 1 deletion(-)


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

diff --git a/includes/ElasticsearchIntermediary.php 
b/includes/ElasticsearchIntermediary.php
index cf66328..352b092 100644
--- a/includes/ElasticsearchIntermediary.php
+++ b/includes/ElasticsearchIntermediary.php
@@ -185,7 +185,7 @@
$offset = isset( $queryData['from'] ) ? 
$queryData['from'] : 0;
$logMessage .= " and returned $num of them 
starting at $offset";
}
-   if ( isset( 
$queryData['query']['filtered']['filter']['terms']['namespace'] ) ) {
+   if ( $this->_isset( $queryData, array( 'query', 
'filtered', 'filter', 'terms', 'namespace' ) ) ) {
$namespaces = 
$queryData['query']['filtered']['filter']['terms']['namespace'];
$logMessage .= ' within these namespaces: ' . 
implode( ', ', $namespaces );
}
@@ -274,4 +274,34 @@
}
return array( Status::newFatal( 'cirrussearch-backend-error' ), 
$message );
}
+
+   /**
+* Like isset, but wont fatal when one of the expected array keys in a
+* multi-dimensional array is a string.
+*
+* Temporary hack required only for php 5.3. Can be removed when 5.4 is 
no
+* longer a requirement.  See T99871 for more details.
+*
+* @param array $array
+* @param array $path
+* @return bool
+*/
+   private function _isset( $array, $path ) {
+   while( true ) {
+   $step = array_shift( $path );
+   if ( !isset( $array[$step] ) ) {
+   // next step of the path is non-existent
+   return false;
+   } elseif( !$path ) {
+   // reached the end of our path
+   return true;
+   } elseif ( !is_array( $array[$step] ) ) {
+   // more steps exist in the path, but we don't 
have an array
+   return false;
+   } else {
+   // keep looking
+   $array = $array[$step];
+   }
+   }
+   }
 }

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

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

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


[MediaWiki-commits] [Gerrit] Unset $wgDiff, so we stop shelling out to diff - change (operations/mediawiki-config)

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

Change subject: Unset $wgDiff, so we stop shelling out to diff
..


Unset $wgDiff, so we stop shelling out to diff

...and use UnifiedDiffFormatter() instead.

Change-Id: Ia5239c1e7e20348a82dffce916010b8a1d3fd67d
---
M wmf-config/CommonSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 7dea9fa..79e336e 100755
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1146,6 +1146,7 @@
 
 if ( extension_loaded( 'wikidiff2' ) ) {
$wgExternalDiffEngine = 'wikidiff2';
+   $wgDiff = false;
 }
 
 if ( file_exists( "$wmfConfigDir/interwiki.cdb" ) ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia5239c1e7e20348a82dffce916010b8a1d3fd67d
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Unset $wgDiff, so we stop shelling out to diff - change (operations/mediawiki-config)

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

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

Change subject: Unset $wgDiff, so we stop shelling out to diff
..

Unset $wgDiff, so we stop shelling out to diff

...and use UnifiedDiffFormatter() instead.

Change-Id: Ia5239c1e7e20348a82dffce916010b8a1d3fd67d
---
M wmf-config/CommonSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 7dea9fa..79e336e 100755
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1146,6 +1146,7 @@
 
 if ( extension_loaded( 'wikidiff2' ) ) {
$wgExternalDiffEngine = 'wikidiff2';
+   $wgDiff = false;
 }
 
 if ( file_exists( "$wmfConfigDir/interwiki.cdb" ) ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5239c1e7e20348a82dffce916010b8a1d3fd67d
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Make wbmergeitems respect the bot parameter - change (mediawiki...Wikibase)

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

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

Change subject: Make wbmergeitems respect the bot parameter
..

Make wbmergeitems respect the bot parameter

Change-Id: I6627b56c5ca357057481357ccde61feef77e3bac
---
M repo/includes/Interactors/ItemMergeInteractor.php
M repo/includes/api/MergeItems.php
M repo/tests/phpunit/includes/api/BotEditTest.php
3 files changed, 39 insertions(+), 15 deletions(-)


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

diff --git a/repo/includes/Interactors/ItemMergeInteractor.php 
b/repo/includes/Interactors/ItemMergeInteractor.php
index 7ac98f0..ef0ebd4 100644
--- a/repo/includes/Interactors/ItemMergeInteractor.php
+++ b/repo/includes/Interactors/ItemMergeInteractor.php
@@ -127,13 +127,14 @@
 * @param ItemId $toId
 * @param array $ignoreConflicts The kinds of conflicts to ignore
 * @param string|null $summary
+* @param bool $bot Mark the edit as bot edit
 *
 * @return array A list of exactly two EntityRevision objects. The 
first one represents
 * the modified source item, the second one represents the modified 
target item.
 *
 * @throws ItemMergeException
 */
-   public function mergeItems( ItemId $fromId, ItemId $toId, 
$ignoreConflicts = array(), $summary = null ) {
+   public function mergeItems( ItemId $fromId, ItemId $toId, 
$ignoreConflicts = array(), $summary = null, $bot = false ) {
 
$this->checkPermissions( $fromId );
$this->checkPermissions( $toId );
@@ -159,7 +160,7 @@
throw new ItemMergeException( $e->getMessage(), 
'failed-modify', $e );
}
 
-   return $this->attemptSaveMerge( $fromEntity, $toEntity, 
$summary );
+   return $this->attemptSaveMerge( $fromEntity, $toEntity, 
$summary, $bot );
}
 
private function loadEntity( EntityId $entityId ) {
@@ -207,27 +208,33 @@
 * @param Item $fromItem
 * @param Item $toItem
 * @param string|null $summary
+* @param bool $bot
 *
 * @return array A list of exactly two EntityRevision objects. The 
first one represents
 * the modified source item, the second one represents the modified 
target item.
 */
-   private function attemptSaveMerge( Item $fromItem, Item $toItem, 
$summary = null ) {
+   private function attemptSaveMerge( Item $fromItem, Item $toItem, 
$summary, $bot ) {
$toSummary = $this->getSummary( 'to', $toItem->getId(), 
$summary );
-   $fromRev = $this->saveEntity( $fromItem, $toSummary );
+   $fromRev = $this->saveEntity( $fromItem, $toSummary, $bot );
 
$fromSummary = $this->getSummary( 'from', $fromItem->getId(), 
$summary );
-   $toRev = $this->saveEntity( $toItem, $fromSummary );
+   $toRev = $this->saveEntity( $toItem, $fromSummary, $bot );
 
return array( $fromRev, $toRev );
}
 
-   private function saveEntity( Entity $entity, Summary $summary ) {
+   private function saveEntity( Entity $entity, Summary $summary, $bot ) {
+   $flags = EDIT_UPDATE;
+   if ( $bot && $this->user->isAllowed( 'bot' ) ) {
+   $flags |= EDIT_FORCE_BOT;
+   }
+
try {
return $this->entityStore->saveEntity(
$entity,
$this->summaryFormatter->formatSummary( 
$summary ),
$this->user,
-   EDIT_UPDATE
+   $flags
);
} catch ( StorageException $ex ) {
throw new ItemMergeException( $ex->getMessage(), 
'failed-save', $ex );
diff --git a/repo/includes/api/MergeItems.php b/repo/includes/api/MergeItems.php
index d237786..b4b61a1 100644
--- a/repo/includes/api/MergeItems.php
+++ b/repo/includes/api/MergeItems.php
@@ -125,8 +125,9 @@
if ( $ignoreConflicts === null ) {
$ignoreConflicts = array();
}
+   $bot = isset( $params['bot'] );
 
-   $this->mergeItems( $fromId, $toId, $ignoreConflicts, 
$summary );
+   $this->mergeItems( $fromId, $toId, $ignoreConflicts, 
$summary, $bot );
} catch ( EntityIdParsingException $ex ) {
$this->errorReporter->dieException( $ex, 
'invalid-entity-id' );
} catch ( ItemMergeException $ex ) {
@@ -139,9 +140,10 @@
 * @param ItemId $toId
 * @param array $ignoreConflicts
 * @param string $summary
+* @param bool $bot
 */
-   private function me

[MediaWiki-commits] [Gerrit] Build for both PHP<< 5.5 and PHP and HHVM - change (mediawiki...luasandbox)

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

Change subject: Build for both PHP<< 5.5 and PHP and HHVM
..


Build for both PHP<< 5.5 and PHP and HHVM

Allow on build time detection of HHVM existence, allowing the luasandbox
to be built for non HHVM-enabled distributions as well. Achieve this by
detecting HHVM via the presence of hphpize binary and define the already
split split in this patch makefile's targets accordingly. In order to achieve
Debian package build dependency satisfaction, use boolean algebra rules
to break down the:
PHP5.3 or (HHVM - and dependenies - and PHP5.5)
expression to the equivalent ones. The | (or) operator takes precedence
when calculating dependencies so this installs either PHP5 versions less
than 5.5 (precise has 5.3) or PHP5 5.5 and HHVM and dependencies.

Bug: T88798

Change-Id: I445fc75f66c470da5dbe32fd8a4f8c2c7606bada
---
M debian/control
M debian/rules
2 files changed, 48 insertions(+), 17 deletions(-)

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



diff --git a/debian/control b/debian/control
index 7b1760c..7c3b82a 100644
--- a/debian/control
+++ b/debian/control
@@ -5,14 +5,14 @@
 Build-Depends: debhelper (>= 9),
liblua5.1-0-dev,
pkg-config,
-   php5-dev,
-   hhvm-dev,
-   cmake,
-   libboost-dev,
-   libgoogle-glog-dev,
-   libdouble-conversion-dev,
-   libjemalloc-dev,
-   libtbb-dev
+   php5-dev (<< 5.5) | php5-dev (>= 5.5),
+   php5-dev (<< 5.5) | hhvm-dev,
+   php5-dev (<< 5.5) | cmake,
+   php5-dev (<< 5.5) | libboost-dev,
+   php5-dev (<< 5.5) | libgoogle-glog-dev,
+   php5-dev (<< 5.5) | libdouble-conversion-dev,
+   php5-dev (<< 5.5) | libjemalloc-dev,
+   php5-dev (<< 5.5) | libtbb-dev
 Standards-Version: 3.9.5
 Homepage: https://www.mediawiki.org/wiki/Extension:Scribunto
 
diff --git a/debian/rules b/debian/rules
index 303bffb..b99b488 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,15 +1,34 @@
 #!/usr/bin/make -f
 
+HHVM=$(shell test -f /usr/bin/hphpize && echo "HHVM")
+
+ifeq ($(HHVM), HHVM)
+   configure_targets = php_configure hhvm_configure
+   build_targets = php_build hhvm_build
+   install_targets = php_install hhvm_install
+   gencontrol_targets =  php_gencontrol hhvm_gencontrol
+else
+   configure_targets = php_configure
+   build_targets = php_build
+   install_targets = php_install
+   gencontrol_targets =  php_gencontrol hhvm_gencontrol
+endif
+
 %:
dh $@
 
-override_dh_auto_configure:
-   mkdir -p debian/build-php debian/build-hhvm
+override_dh_auto_configure: $(configure_targets)
+
+php_configure:
+   mkdir -p debian/build-php
## PHP
tar -cf - --exclude=debian/build* --exclude=.pc . \
| tar -xf - -C debian/build-php
cd debian/build-php && /usr/bin/phpize && dh_auto_configure
+
+hhvm_configure:
## HHVM
+   mkdir -p debian/build-hhvm
tar -cf - --exclude=debian/build* --exclude=.pc . \
| tar -xf - -C debian/build-hhvm
cd debian/build-hhvm && /usr/bin/hphpize
@@ -22,24 +41,36 @@
-DLUA_USE_CPP=1
cd debian/build-hhvm && dh_auto_configure
 
-override_dh_auto_build:
+override_dh_auto_build: $(build_targets)
+
+php_build:
cd debian/build-php  && dh_auto_build
+
+hhvm_build:
cd debian/build-hhvm && dh_auto_build
 
 override_dh_auto_test:
 
-override_dh_auto_install:
+override_dh_auto_install: $(install_targets)
+
+php_install:
INSTALL_ROOT=$(CURDIR)/debian/php-luasandbox make -C debian/build-php 
install
+
+hhvm_install:
DESTDIR=$(CURDIR)/debian/hhvm-luasandbox make -C debian/build-hhvm 
install
 
-override_dh_gencontrol:
-   echo "php:Depends=phpapi-$(shell php-config5 --phpapi)" >> 
debian/php-luasandbox.substvars
-   # HHVM does *not* ensure binary compatibility
-   echo "hhvm:ApiVersion=hhvm-api-$(shell /usr/bin/hhvm --version | sed 
-ne 's/^Extension API:\ //p')" >> debian/hhvm-luasandbox.substvars
+override_dh_gencontrol: $(gencontrol_targets)
dh_gencontrol
 
+php_gencontrol:
+   echo "php:Depends=phpapi-$(shell php-config5 --phpapi)" >> 
debian/php-luasandbox.substvars
+
+hhvm_gencontrol:
+   # HHVM does *not* ensure binary compatibility
+   echo "hhvm:ApiVersion=hhvm-api-$(shell /usr/bin/hhvm --version | sed 
-ne 's/^Extension API:\ //p')" >> debian/hhvm-luasandbox.substvars
+
 override_dh_auto_clean:
-   -rm -r debian/build*
+   rm -rf debian/build*
dh_auto_clean
 
 .PHONY: override_dh_auto_configure override_dh_auto_build 
override_dh_auto_test override_dh_auto_install override_dh_gencontrol

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I445fc75f66c470da5dbe32fd8a4f8c2c7606bada
Gerrit-PatchSet: 

[MediaWiki-commits] [Gerrit] Typo fix for Iaba1aee51: apache::mod::headers, not header - change (operations/puppet)

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

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

Change subject: Typo fix for Iaba1aee51: apache::mod::headers, not header
..

Typo fix for Iaba1aee51: apache::mod::headers, not header

Change-Id: I9b76b424f62e7622ec97c6a365a2e440b2d8771a
---
M manifests/role/performance.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/97/212497/1

diff --git a/manifests/role/performance.pp b/manifests/role/performance.pp
index 8787e67..c2202ba 100644
--- a/manifests/role/performance.pp
+++ b/manifests/role/performance.pp
@@ -5,7 +5,7 @@
 #
 class role::performance {
 include ::apache
-include ::apache::mod::header
+include ::apache::mod::headers
 include ::apache::mod::proxy
 include ::apache::mod::rewrite
 include ::apache::mod::uwsgi

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b76b424f62e7622ec97c6a365a2e440b2d8771a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Typo fix for Iaba1aee51: apache::mod::headers, not header - change (operations/puppet)

2015-05-20 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Typo fix for Iaba1aee51: apache::mod::headers, not header
..


Typo fix for Iaba1aee51: apache::mod::headers, not header

Change-Id: I9b76b424f62e7622ec97c6a365a2e440b2d8771a
---
M manifests/role/performance.pp
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/manifests/role/performance.pp b/manifests/role/performance.pp
index 8787e67..c2202ba 100644
--- a/manifests/role/performance.pp
+++ b/manifests/role/performance.pp
@@ -5,7 +5,7 @@
 #
 class role::performance {
 include ::apache
-include ::apache::mod::header
+include ::apache::mod::headers
 include ::apache::mod::proxy
 include ::apache::mod::rewrite
 include ::apache::mod::uwsgi

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9b76b424f62e7622ec97c6a365a2e440b2d8771a
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Make performance.wikimedia.org HTTPS-only - change (operations/puppet)

2015-05-20 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Make performance.wikimedia.org HTTPS-only
..


Make performance.wikimedia.org HTTPS-only

With a 301 redirect from http://, as is the norm.

Change-Id: Iaba1aee512dee1a54d0a7330d48789d2fec4ff7e
---
M manifests/role/performance.pp
M templates/apache/sites/performance.wikimedia.org.erb
2 files changed, 9 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/manifests/role/performance.pp b/manifests/role/performance.pp
index 88d343b..8787e67 100644
--- a/manifests/role/performance.pp
+++ b/manifests/role/performance.pp
@@ -5,7 +5,9 @@
 #
 class role::performance {
 include ::apache
+include ::apache::mod::header
 include ::apache::mod::proxy
+include ::apache::mod::rewrite
 include ::apache::mod::uwsgi
 
 class { '::coal':
diff --git a/templates/apache/sites/performance.wikimedia.org.erb 
b/templates/apache/sites/performance.wikimedia.org.erb
index 4d1d43e..cefffbd 100644
--- a/templates/apache/sites/performance.wikimedia.org.erb
+++ b/templates/apache/sites/performance.wikimedia.org.erb
@@ -5,6 +5,13 @@
 
 DocumentRoot /var/www/performance
 
+RewriteEngine On
+RewriteCond %{HTTP:X-Forwarded-Proto} !https
+RewriteCond %{REQUEST_URI} !^/status$
+RewriteRule ^/(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} 
[R=301,E=ProtoRedirect]
+Header always merge Vary X-Forwarded-Proto env=ProtoRedirect
+Header always set Strict-Transport-Security "max-age=604800"
+
 
 Order allow,deny
 Allow from all

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaba1aee512dee1a54d0a7330d48789d2fec4ff7e
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Make performance.wikimedia.org HTTPS-only - change (operations/puppet)

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

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

Change subject: Make performance.wikimedia.org HTTPS-only
..

Make performance.wikimedia.org HTTPS-only

With a 301 redirect from http://, as is the norm.

Change-Id: Iaba1aee512dee1a54d0a7330d48789d2fec4ff7e
---
M manifests/role/performance.pp
M templates/apache/sites/performance.wikimedia.org.erb
2 files changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/96/212496/1

diff --git a/manifests/role/performance.pp b/manifests/role/performance.pp
index 88d343b..8787e67 100644
--- a/manifests/role/performance.pp
+++ b/manifests/role/performance.pp
@@ -5,7 +5,9 @@
 #
 class role::performance {
 include ::apache
+include ::apache::mod::header
 include ::apache::mod::proxy
+include ::apache::mod::rewrite
 include ::apache::mod::uwsgi
 
 class { '::coal':
diff --git a/templates/apache/sites/performance.wikimedia.org.erb 
b/templates/apache/sites/performance.wikimedia.org.erb
index 4d1d43e..cefffbd 100644
--- a/templates/apache/sites/performance.wikimedia.org.erb
+++ b/templates/apache/sites/performance.wikimedia.org.erb
@@ -5,6 +5,13 @@
 
 DocumentRoot /var/www/performance
 
+RewriteEngine On
+RewriteCond %{HTTP:X-Forwarded-Proto} !https
+RewriteCond %{REQUEST_URI} !^/status$
+RewriteRule ^/(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} 
[R=301,E=ProtoRedirect]
+Header always merge Vary X-Forwarded-Proto env=ProtoRedirect
+Header always set Strict-Transport-Security "max-age=604800"
+
 
 Order allow,deny
 Allow from all

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaba1aee512dee1a54d0a7330d48789d2fec4ff7e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Made LoadBalancer debug log entries use "localhost" instead ... - change (mediawiki/core)

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

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

Change subject: Made LoadBalancer debug log entries use "localhost" instead of 
""
..

Made LoadBalancer debug log entries use "localhost" instead of ""

Change-Id: I44b0c1ed31c854990c0e7d81a710f456907b8081
---
M includes/db/LoadBalancer.php
1 file changed, 11 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/95/212495/1

diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php
index 2ea2487..99c9a14 100644
--- a/includes/db/LoadBalancer.php
+++ b/includes/db/LoadBalancer.php
@@ -291,8 +291,8 @@
return false;
}
 
-   wfDebugLog( 'connect', __METHOD__ .
-   ": Using reader #$i: 
{$this->mServers[$i]['host']}..." );
+   $serverName = $this->getServerName( $i );
+   wfDebugLog( 'connect', __METHOD__ . ": Using reader 
#$i: $serverName..." );
 
$conn = $this->openConnection( $i, $wiki );
if ( !$conn ) {
@@ -462,7 +462,7 @@
 
if ( $result == -1 || is_null( $result ) ) {
# Timed out waiting for slave, use master instead
-   $server = $this->mServers[$index]['host'];
+   $server = $server = $this->getServerName( $index );
$msg = __METHOD__ . ": Timed out waiting on $server pos 
{$this->mWaitForPos}";
wfDebug( "$msg\n" );
wfDebugLog( 'DBPerformance', "$msg:\n" . wfBacktrace( 
true ) );
@@ -660,11 +660,12 @@
$server = $this->mServers[$i];
$server['serverIndex'] = $i;
$conn = $this->reallyOpenConnection( $server, false );
+   $serverName = $this->getServerName( $i );
if ( $conn->isOpen() ) {
-   wfDebug( "Connected to database $i at 
{$this->mServers[$i]['host']}\n" );
+   wfDebug( "Connected to database $i at 
$serverName\n" );
$this->mConns['local'][$i][0] = $conn;
} else {
-   wfDebug( "Failed to connect to database $i at 
{$this->mServers[$i]['host']}\n" );
+   wfDebug( "Failed to connect to database $i at 
$serverName\n" );
$this->mErrorConnection = $conn;
$conn = false;
}
@@ -888,12 +889,14 @@
 */
public function getServerName( $i ) {
if ( isset( $this->mServers[$i]['hostName'] ) ) {
-   return $this->mServers[$i]['hostName'];
+   $name = $this->mServers[$i]['hostName'];
} elseif ( isset( $this->mServers[$i]['host'] ) ) {
-   return $this->mServers[$i]['host'];
+   $name = $this->mServers[$i]['host'];
} else {
-   return '';
+   $name = '';
}
+
+   return ( $name != '' ) ? $name : 'localhost';
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44b0c1ed31c854990c0e7d81a710f456907b8081
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] bind popstate to initQuery so the back button works - change (wikidata...rdf)

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

Change subject: bind popstate to initQuery so the back button works
..


bind popstate to initQuery so the back button works

Change-Id: I7169a9c916d122ca2b47f5bca31e65bd1bdd0ae3
---
M gui/gui.js
1 file changed, 7 insertions(+), 3 deletions(-)

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



diff --git a/gui/gui.js b/gui/gui.js
index f2a6bc6..485f8f4 100644
--- a/gui/gui.js
+++ b/gui/gui.js
@@ -2,7 +2,7 @@
 window.EDITOR = {};
 
 (function($, mw) {
-   var SERVICE = '/bigdata/namespace/wdq/sparql',
+   var SERVICE = 
'http://wdqs-beta.wmflabs.org/bigdata/namespace/wdq/sparql',
SHORTURL = 'http://tinyurl.com/create.php?url=',
NAMESPACE_SHORTCUTS = {
'Wikidata' : {
@@ -39,7 +39,7 @@
'hint' : 'http://www.bigdata.com/queryHints#'
}
},
-   STANDARD_PREFIXES = [
+   STANDARD_PREFIXES =[
'PREFIX wd: ',
'PREFIX wdt: 
',
'PREFIX wikibase: ',
@@ -62,6 +62,7 @@
EDITOR.save();
 
var query = $('#query-form').serialize(),
+   hash = encodeURIComponent(EDITOR.getValue()),
url = SERVICE + "?" + query,
settings = {
headers : {
@@ -75,7 +76,9 @@
$('#total').hide();
$('#query-error').show();
$('#query-error').text('Running query...');
-   window.location.hash = encodeURIComponent(EDITOR.getValue());
+   if (window.location.hash !== hash) {
+   window.location.hash = hash;
+   }
QUERY_START = Date.now();
$.ajax(url, settings);
}
@@ -340,5 +343,6 @@
$(document).ready(function() {
startGUI();
});
+   $(window).on('popstate', initQuery);
 })(jQuery, mediaWiki);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7169a9c916d122ca2b47f5bca31e65bd1bdd0ae3
Gerrit-PatchSet: 3
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 
Gerrit-Reviewer: Jdouglas 
Gerrit-Reviewer: Smalyshev 
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 a little indentation to index.html - change (wikidata...rdf)

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

Change subject: Add a little indentation to index.html
..


Add a little indentation to index.html

Change-Id: I13f1aaba57827a0ececace5c593be9afa72f88c5
---
M gui/index.html
1 file changed, 39 insertions(+), 40 deletions(-)

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



diff --git a/gui/index.html b/gui/index.html
index 3215bec..2ff9106 100644
--- a/gui/index.html
+++ b/gui/index.html
@@ -15,47 +15,46 @@
 
 
   
-  Welcome to Wikidata Query Service Beta!
-  Please enter your query below.
-  
-  See also: [hide]
-  
-  
-   https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format";>RDF 
data model
-  (https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format#Full_list_of_prefixes";>prefixes
 list)
-   https://github.com/wikimedia/wikidata-query-rdf/blob/master/docs/exploring-linked-data.md";>Exploring
 Linked Data
-   https://www.mediawiki.org/wiki/Wikibase/Indexing/SPARQL_Query_Examples";>SPARQL
 query examples
-   http://tools.wmflabs.org/wdq2sparql/w2s.php";>WDQ syntax 
translator
-  
-Sample query:
-
-  -
-
-  
-  
-  
-  
-  
-  
-  
-
-  
-  
-
-
-
+Welcome to Wikidata Query Service Beta!
+Please enter your query below.
+
+  See also: [hide]
+  
+
+   https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format";>RDF 
data model
+  (https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format#Full_list_of_prefixes";>prefixes
 list)
+   https://github.com/wikimedia/wikidata-query-rdf/blob/master/docs/exploring-linked-data.md";>Exploring
 Linked Data
+   https://www.mediawiki.org/wiki/Wikibase/Indexing/SPARQL_Query_Examples";>SPARQL
 query examples
+   http://tools.wmflabs.org/wdq2sparql/w2s.php";>WDQ 
syntax translator
+  
+Sample query:
+
+  -
+
+  
+  
+
   
-
-
-  
-  
-  Total results: , duration: 
 ms.
-  Click on * to explore.
-  Hide explorer
-  Generate short URL.
-  
-  
-  
+  
+  
+
+  
+  
+
+
+
+  
+
+
+  
+  
+  Total results: , 
duration:  ms.
+  Click on * to explore.
+  Hide explorer
+  Generate short URL.
+
+
+
   
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I13f1aaba57827a0ececace5c593be9afa72f88c5
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 
Gerrit-Reviewer: Jdouglas 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Slightly safer element construction - change (wikidata...rdf)

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

Change subject: Slightly safer element construction
..


Slightly safer element construction

Its generally discouraged to build html elements through text concatenation
in the browser.  Clean that up a bit.  Also avoid adding javascript: href's,
just bind the click event and call the function we want.

Change-Id: I551cf63c7e6e1de44c1e20f11c8f1e711c4305ba
---
M gui/gui.js
M gui/style.css
2 files changed, 36 insertions(+), 22 deletions(-)

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



diff --git a/gui/gui.js b/gui/gui.js
index 354c42b..864610b 100644
--- a/gui/gui.js
+++ b/gui/gui.js
@@ -95,7 +95,7 @@
}
 
function showQueryResults(data) {
-   var results, thead, i, tr, j, binding, title,
+   var results, thead, i, tr, td, linkText, j, binding, title,
table = $('').appendTo($('#query-result'));
$('#query-error').hide();
$('#query-result').show();
@@ -107,8 +107,8 @@
}
 
results = data.results.bindings.length;
-   $('#total-results').html(results);
-   $('#query-time').html(Date.now() - QUERY_START);
+   $('#total-results').text(results);
+   $('#query-time').text(Date.now() - QUERY_START);
$('#total').show();
$('#shorturl').attr("href", 
SHORTURL+encodeURIComponent(window.location));
 
@@ -123,43 +123,52 @@
for (i = 0; i < results; i++) {
tr = $('');
for (j = 0; j < data.head.vars.length; j++) {
+   td = $('');
if (data.head.vars[j] in 
data.results.bindings[i]) {
binding = 
data.results.bindings[i][data.head.vars[j]];
text = binding.value;
if (binding.type == 'uri') {
text = abbreviate(text);
}
-   linkText = 
escapeHTML(text).replace(/\n/g, '');
+   linkText = $('').text(text.trim());
if (binding.type == 'typed-literal') {
-   tdData = ' class="literal" 
data-datatype="' +
-   
binding.datatype + '"';
+   td.attr({
+   "class": "literal",
+   "data-datatype": 
binding.datatype
+   }).append(linkText);
} else {
+   td.attr('class', binding.type);
if (binding.type == 'uri') {
-   text = '' +
-   
linkText + '';
+   td.append($('')
+   .attr("href", 
binding.value)
+   
.append(linkText)
+   );

if(binding.value.match(/http:\/\/www.wikidata.org\/entity\//)) {
-   text += '*';
+   
td.append($('')
+   
.attr("href", '#')
+   
.bind('click', exploreURL.bind(undefined, binding.value))
+   
.text('*')
+   );
}
+   } else {
+   td.append(linkText);
}
-   tdData = ' class="' + 
binding.type + '"';
+
if (binding['xml:lang']) {
-   title = text + "@" + 
binding['xml:lang'];
-   tdData += ' 
data-lang="' + binding['xml:lang'] +
-   '" 
title="' + title + '"';
+

[MediaWiki-commits] [Gerrit] Clean up a variety of jshint errors - change (wikidata...rdf)

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

Change subject: Clean up a variety of jshint errors
..


Clean up a variety of jshint errors

Just a general style cleanup to begin passing a linting process.

Change-Id: I750513feb24050322c789633c32f61449e3ff3bb
---
M gui/gui.js
1 file changed, 139 insertions(+), 138 deletions(-)

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



diff --git a/gui/gui.js b/gui/gui.js
index be4cf6f..354c42b 100644
--- a/gui/gui.js
+++ b/gui/gui.js
@@ -1,81 +1,75 @@
-var jQuery = $;
-var mediaWiki = {};
+window.mediaWiki = window.mediaWiki || {};
+window.EDITOR = {};
 
-var EDITOR = {};
-
-$(function() {
-   var SERVICE = '/bigdata/namespace/wdq/sparql';
-
-   var SHORTURL = 'http://tinyurl.com/create.php?url=';
-
-   var NAMESPACE_SHORTCUTS = {
-   'Wikidata' : {
-   'wikibase' : 'http://wikiba.se/ontology#',
-   'wdata' : 
'http://wikidata.org/wiki/Special:EntityData/',
-   'wd' : 'http://wikidata.org/entity/',
-   'wdt' : 'http://wikidata.org/prop/direct/',
-   'wds' : 'http://wikidata.org/entity/statement/',
-   'p' : 'http://wikidata.org/prop/',
-   'wdref' : 'http://wikidata.org/reference/',
-   'wdv' : 'http://wikidata.org/value/',
-   'ps' : 'http://wikidata.org/prop/statement/',
-   'psv' : 'http://wikidata.org/prop/statement/value/',
-   'pq' : 'http://wikidata.org/prop/qualifier/',
-   'pqv' : 'http://wikidata.org/prop/qualifier/value/',
-   'pr' : 'http://wikidata.org/prop/reference/',
-   'prv' : 'http://wikidata.org/prop/reference/value/',
-   'wdno' : 'http://wikidata.org/prop/novalue/'
+(function($, mw) {
+   var SERVICE = '/bigdata/namespace/wdq/sparql',
+   SHORTURL = 'http://tinyurl.com/create.php?url=',
+   NAMESPACE_SHORTCUTS = {
+   'Wikidata' : {
+   'wikibase' : 'http://wikiba.se/ontology#',
+   'wdata' : 
'http://wikidata.org/wiki/Special:EntityData/',
+   'wd' : 'http://wikidata.org/entity/',
+   'wdt' : 'http://wikidata.org/prop/direct/',
+   'wds' : 'http://wikidata.org/entity/statement/',
+   'p' : 'http://wikidata.org/prop/',
+   'wdref' : 'http://wikidata.org/reference/',
+   'wdv' : 'http://wikidata.org/value/',
+   'ps' : 'http://wikidata.org/prop/statement/',
+   'psv' : 
'http://wikidata.org/prop/statement/value/',
+   'pq' : 'http://wikidata.org/prop/qualifier/',
+   'pqv' : 
'http://wikidata.org/prop/qualifier/value/',
+   'pr' : 'http://wikidata.org/prop/reference/',
+   'prv' : 
'http://wikidata.org/prop/reference/value/',
+   'wdno' : 'http://wikidata.org/prop/novalue/'
+   },
+   'W3C' : {
+   'rdf' : 
'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
+   'rdfs' : 
'http://www.w3.org/2000/01/rdf-schema#',
+   'owl' : 'http://www.w3.org/2002/07/owl#',
+   'skos' : 'http://www.w3.org/2004/02/skos/core#',
+   'xsd' : 'http://www.w3.org/2001/XMLSchema#'
+   },
+   'Social/Other' : {
+   'schema' : 'http://schema.org/',
+   },
+   'Blazegraph' : {
+   'bd' : 'http://www.bigdata.com/rdf#',
+   'bds' : 'http://www.bigdata.com/rdf/search#',
+   'gas' : 'http://www.bigdata.com/rdf/gas#',
+   'hint' : 'http://www.bigdata.com/queryHints#'
+   }
},
-   'W3C' : {
-   'rdf' : 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
-   'rdfs' : 'http://www.w3.org/2000/01/rdf-schema#',
-   'owl' : 'http://www.w3.org/2002/07/owl#',
-   'skos' : 'http://www.w3.org/2004/02/skos/core#',
-   'xsd' : 'http://www.w3.org/2001/XMLSchema#'
+   STANDARD_PREFIXES = [
+   'PREFIX wd: ',
+   'PREFIX wdt: 
',
+   

[MediaWiki-commits] [Gerrit] Blank parameters should be preserved - change (mediawiki...parsoid)

2015-05-20 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review.

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

Change subject: Blank parameters should be preserved
..

Blank parameters should be preserved

 * The comment seems to think otherwise but that can't be true.

 * Maybe that was the case in 2012 when it was added in
   2195c31abff9319b951e149f048dcb0b27fcee9b but it certainly isn't
   anymore.

Change-Id: Iba52b5a942e3c2d0b5573cf1620f2a035b3fa5a4
---
M lib/pegTokenizer.pegjs.txt
M tests/parserTests.txt
2 files changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/94/212494/1

diff --git a/lib/pegTokenizer.pegjs.txt b/lib/pegTokenizer.pegjs.txt
index 47bcbdd..884ea52 100644
--- a/lib/pegTokenizer.pegjs.txt
+++ b/lib/pegTokenizer.pegjs.txt
@@ -728,8 +728,6 @@
 
 template_param
   = name:template_param_name
-// MW accepts |foo | = bar | as a single param..
-(p:'|' sp:space_or_newline* &'=' { return [p, sp]; })?
 val:(
 kEndPos:({return peg$currPos;})
 optionalSpaceToken
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index f89cd61..52361df 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -2738,6 +2738,17 @@
 {{{1}}}
 !! end
 
+!! test
+Templates: Preserve blank parameter names in other positions
+!! wikitext
+{{echo|bar|=foo}}
+!! html/php
+bar
+
+!! html/parsoid
+bar
+!! end
+
 ###
 ### Parsoid-centric tests for testing RT edge cases for pre
 ###

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba52b5a942e3c2d0b5573cf1620f2a035b3fa5a4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra 

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


[MediaWiki-commits] [Gerrit] Create pages instead of messing with MessageCache in SpamBla... - change (mediawiki...Flow)

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

Change subject: Create pages instead of messing with MessageCache in 
SpamBlacklist tests
..


Create pages instead of messing with MessageCache in SpamBlacklist tests

Bug: T99857
Change-Id: I1ddb32aaf0779221fc3c395a3e30394e4a9babfb
---
M tests/phpunit/SpamFilter/SpamBlacklistTest.php
1 file changed, 5 insertions(+), 10 deletions(-)

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



diff --git a/tests/phpunit/SpamFilter/SpamBlacklistTest.php 
b/tests/phpunit/SpamFilter/SpamBlacklistTest.php
index 584d78b..599efaa 100644
--- a/tests/phpunit/SpamFilter/SpamBlacklistTest.php
+++ b/tests/phpunit/SpamFilter/SpamBlacklistTest.php
@@ -76,12 +76,10 @@
'files' => array(),
) );
 
-   // local spam lists are read from spam-blacklist & 
spam-whitelist
-   // messages, so change them for this test
-   $msgCache = \MessageCache::singleton();
-   $msgCache->enable();
-   $msgCache->replace( 'Spam-blacklist', implode( "\n", 
$this->blacklist ) );
-   $msgCache->replace( 'Spam-whitelist', implode( "\n", 
$this->whitelist ) );
+   \MessageCache::singleton()->enable();
+   $this->insertPage( 'MediaWiki:Spam-blacklist', implode( "\n", 
$this->blacklist ) );
+   $this->insertPage( 'MediaWiki:Spam-whitelist', implode( "\n", 
$this->whitelist ) );
+
// That only works if the spam blacklist is really reset
$instance = BaseBlacklist::getInstance( 'spam' );
$reflProp = new \ReflectionProperty( $instance, 'regexes' );
@@ -90,10 +88,7 @@
}
 
protected function tearDown() {
-   // we don't have to restore the original messages, disable() 
will make
-   // sure they're ignored
-   $msgCache = \MessageCache::singleton();
-   $msgCache->disable();
+   \MessageCache::singleton()->disable();
parent::tearDown();
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1ddb32aaf0779221fc3c395a3e30394e4a9babfb
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] [WIP] - change (mediawiki...Flow)

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

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

Change subject: [WIP]
..

[WIP]

Change-Id: I1ddb32aaf0779221fc3c395a3e30394e4a9babfb
---
M tests/phpunit/SpamFilter/SpamBlacklistTest.php
1 file changed, 3 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/93/212493/1

diff --git a/tests/phpunit/SpamFilter/SpamBlacklistTest.php 
b/tests/phpunit/SpamFilter/SpamBlacklistTest.php
index 584d78b..66bd4f4 100644
--- a/tests/phpunit/SpamFilter/SpamBlacklistTest.php
+++ b/tests/phpunit/SpamFilter/SpamBlacklistTest.php
@@ -76,24 +76,13 @@
'files' => array(),
) );
 
-   // local spam lists are read from spam-blacklist & 
spam-whitelist
-   // messages, so change them for this test
-   $msgCache = \MessageCache::singleton();
-   $msgCache->enable();
-   $msgCache->replace( 'Spam-blacklist', implode( "\n", 
$this->blacklist ) );
-   $msgCache->replace( 'Spam-whitelist', implode( "\n", 
$this->whitelist ) );
+   $this->insertPage( 'MediaWiki:Spam-blacklist', implode( "\n", 
$this->blacklist ) );
+   $this->insertPage( 'MediaWiki:Spam-whitelist', implode( "\n", 
$this->whitelist ) );
+
// That only works if the spam blacklist is really reset
$instance = BaseBlacklist::getInstance( 'spam' );
$reflProp = new \ReflectionProperty( $instance, 'regexes' );
$reflProp->setAccessible( true );
$reflProp->setValue( $instance, false );
-   }
-
-   protected function tearDown() {
-   // we don't have to restore the original messages, disable() 
will make
-   // sure they're ignored
-   $msgCache = \MessageCache::singleton();
-   $msgCache->disable();
-   parent::tearDown();
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ddb32aaf0779221fc3c395a3e30394e4a9babfb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] Use setMwApi instead of setInterwiki - change (mediawiki...deploy)

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

Change subject: Use setMwApi instead of setInterwiki
..


Use setMwApi instead of setInterwiki

 * Follows the changes in I05e2e1bf63ba1249b53be9666d3d8a2fcc435a39

 * Bump the src to match the necessary commit.

Change-Id: I7e19144606d07ca82715381235d093bf8ff16a0f
---
M conf/wmf/betalabs.localsettings.js
M src
2 files changed, 32 insertions(+), 32 deletions(-)

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



diff --git a/conf/wmf/betalabs.localsettings.js 
b/conf/wmf/betalabs.localsettings.js
index f4e65f1..442c2e2 100644
--- a/conf/wmf/betalabs.localsettings.js
+++ b/conf/wmf/betalabs.localsettings.js
@@ -1,38 +1,38 @@
 "use strict";
-exports.setup = function( parsoidConfig ) {
+exports.setup = function(parsoidConfig) {
parsoidConfig.loadWMF = false;
 
-   parsoidConfig.setInterwiki( 'aawiki', 
'http://aa.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'arwiki', 
'http://aa.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'cawiki', 
'http://aa.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'commonswiki', 
'http://commons.wikimedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'dewiki', 
'http://de.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'en_rtlwiki', 
'http://en-rtl.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'enwiki', 
'http://en.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'enwikibooks', 
'http://en.wikibooks.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'enwikinews', 
'http://en.wikinews.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'enwikiquote', 
'http://en.wikiquote.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'enwikisource', 
'http://en.wikisource.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'enwikiversity', 
'http://en.wikiversity.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'enwiktionary', 
'http://en.wikitionary.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'eowiki', 
'http://eo.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'eswiki', 
'http://es.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'fawiki', 
'http://fa.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'hewiki', 
'http://he.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'hiwiki', 
'http://hi.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'jawiki', 
'http://ja.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'kowiki', 
'http://ko.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'labs', 
'http://deployment.wikimedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'loginwiki', 
'http://login.wikimedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'metawiki', 
'http://meta.wikimedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'ruwiki', 
'http://ru.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'simplewiki', 
'http://simple.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'sqwiki', 
'http://sq.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'testwiki', 
'http://test.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'ukwiki', 
'http://uk.wikipedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'wikidatawiki', 
'http://wikidata.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'zerowiki', 
'http://zero.wikimedia.beta.wmflabs.org/w/api.php' );
-   parsoidConfig.setInterwiki( 'zhwiki', 
'http://zh.wikipedia.beta.wmflabs.org/w/api.php' );
+   parsoidConfig.setMwApi('aawiki', { uri: 
'http://aa.wikipedia.beta.wmflabs.org/w/api.php' });
+   parsoidConfig.setMwApi('arwiki', { uri: 
'http://aa.wikipedia.beta.wmflabs.org/w/api.php' });
+   parsoidConfig.setMwApi('cawiki', { uri: 
'http://aa.wikipedia.beta.wmflabs.org/w/api.php' });
+   parsoidConfig.setMwApi('commonswiki', { uri: 
'http://commons.wikimedia.beta.wmflabs.org/w/api.php' });
+   parsoidConfig.setMwApi('dewiki', { uri: 
'http://de.wikipedia.beta.wmflabs.org/w/api.php' });
+   parsoidConfig.setMwApi('en_rtlwiki', { uri: 
'http://en-rtl.wikipedia.beta.wmflabs.org/w/api.php' });
+   parsoidConfig.setMwApi('enwiki', { uri: 
'http://en.wikipedia.beta.wmflabs.org/w/api.php' });
+   parsoidConfig.setMwApi('enwikibooks', { uri: 
'http://en.wikibooks.beta.wmflabs.org/w/api.php' });
+   parsoidConfig.setMwApi('enwikinews', { uri: 
'http://en.w

[MediaWiki-commits] [Gerrit] Cherry-pick b4853c7633f0cd9 from master - change (mediawiki...SyntaxHighlight_GeSHi)

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

Change subject: Cherry-pick b4853c7633f0cd9 from master
..


Cherry-pick b4853c7633f0cd9 from master

Change-Id: Iae0806e06a95b2d8932b3d9e078e6135dd6750a3
---
M SyntaxHighlight_GeSHi.class.php
1 file changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index 0ba0aa0..732f219 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -38,7 +38,12 @@
die( 'This version of SyntaxHighlight GeSHi requires 
MediaWiki 1.25' );
}
 
-   require_once __DIR__ . '/SyntaxHighlight_GeSHi.langs.php';
+   global $wgGeSHiSupportedLanguages;
+   if ( !$wgGeSHiSupportedLanguages ) {
+   // If not set already, load it (@see 
ExtensionRegistry::exportExtractedData)
+   require_once __DIR__ . 
'/SyntaxHighlight_GeSHi.langs.php';
+   }
+   // @fixme we shouldn't be loading this on ever request
require_once __DIR__ . '/geshi/geshi.php';
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iae0806e06a95b2d8932b3d9e078e6135dd6750a3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi
Gerrit-Branch: REL1_25
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Cherry-pick b4853c7633f0cd9 from master - change (mediawiki...SyntaxHighlight_GeSHi)

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

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

Change subject: Cherry-pick b4853c7633f0cd9 from master
..

Cherry-pick b4853c7633f0cd9 from master

Change-Id: Iae0806e06a95b2d8932b3d9e078e6135dd6750a3
---
M SyntaxHighlight_GeSHi.class.php
1 file changed, 6 insertions(+), 1 deletion(-)


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

diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index 0ba0aa0..732f219 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -38,7 +38,12 @@
die( 'This version of SyntaxHighlight GeSHi requires 
MediaWiki 1.25' );
}
 
-   require_once __DIR__ . '/SyntaxHighlight_GeSHi.langs.php';
+   global $wgGeSHiSupportedLanguages;
+   if ( !$wgGeSHiSupportedLanguages ) {
+   // If not set already, load it (@see 
ExtensionRegistry::exportExtractedData)
+   require_once __DIR__ . 
'/SyntaxHighlight_GeSHi.langs.php';
+   }
+   // @fixme we shouldn't be loading this on ever request
require_once __DIR__ . '/geshi/geshi.php';
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae0806e06a95b2d8932b3d9e078e6135dd6750a3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi
Gerrit-Branch: REL1_25
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] bind popstate to initQuery so the back button works - change (wikidata...rdf)

2015-05-20 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: bind popstate to initQuery so the back button works
..

bind popstate to initQuery so the back button works

Change-Id: I7169a9c916d122ca2b47f5bca31e65bd1bdd0ae3
---
M gui/gui.js
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/91/212491/1

diff --git a/gui/gui.js b/gui/gui.js
index f2a6bc6..0a9483b 100644
--- a/gui/gui.js
+++ b/gui/gui.js
@@ -62,6 +62,7 @@
EDITOR.save();
 
var query = $('#query-form').serialize(),
+   hash = encodeURIComponent(EDITOR.getValue()),
url = SERVICE + "?" + query,
settings = {
headers : {
@@ -75,7 +76,9 @@
$('#total').hide();
$('#query-error').show();
$('#query-error').text('Running query...');
-   window.location.hash = encodeURIComponent(EDITOR.getValue());
+   if (window.location.hash !== hash) {
+   window.location.hash = 
encodeURIComponent(EDITOR.getValue());
+   }
QUERY_START = Date.now();
$.ajax(url, settings);
}
@@ -340,5 +343,6 @@
$(document).ready(function() {
startGUI();
});
+   $(window).on('popstate', initQuery);
 })(jQuery, mediaWiki);
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7169a9c916d122ca2b47f5bca31e65bd1bdd0ae3
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 

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


[MediaWiki-commits] [Gerrit] Pass a message key to MalformedTitleException constructor - change (mediawiki/core)

2015-05-20 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Pass a message key to MalformedTitleException constructor
..


Pass a message key to MalformedTitleException constructor

'badtitletext' seems to be equivalent to the situation before I4da8ecb4,
so let's go with that.

Bug: T99818
Change-Id: Ifdf66d2806df3ae7d2d378343491dd8976c31981
(cherry picked from commit f0b510f9d94742a6da57e1aebbee914808b3f4a3)
---
M includes/MediaWiki.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 62ab667..58c49f4 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -114,7 +114,7 @@
// If we get here, we definitely don't have a valid 
title; throw an exception.
// Try to get detailed invalid title exception first, 
fall back to MalformedTitleException.
Title::newFromTextThrow( $title );
-   throw new MalformedTitleException( null, $title );
+   throw new MalformedTitleException( 'badtitletext', 
$title );
}
 
return $ret;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifdf66d2806df3ae7d2d378343491dd8976c31981
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Pass a message key to MalformedTitleException constructor - change (mediawiki/core)

2015-05-20 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Pass a message key to MalformedTitleException constructor
..


Pass a message key to MalformedTitleException constructor

'badtitletext' seems to be equivalent to the situation before I4da8ecb4,
so let's go with that.

Bug: T99818
Change-Id: Ifdf66d2806df3ae7d2d378343491dd8976c31981
(cherry picked from commit f0b510f9d94742a6da57e1aebbee914808b3f4a3)
---
M includes/MediaWiki.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 62ab667..58c49f4 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -114,7 +114,7 @@
// If we get here, we definitely don't have a valid 
title; throw an exception.
// Try to get detailed invalid title exception first, 
fall back to MalformedTitleException.
Title::newFromTextThrow( $title );
-   throw new MalformedTitleException( null, $title );
+   throw new MalformedTitleException( 'badtitletext', 
$title );
}
 
return $ret;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifdf66d2806df3ae7d2d378343491dd8976c31981
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Pass a message key to MalformedTitleException constructor - change (mediawiki/core)

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

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

Change subject: Pass a message key to MalformedTitleException constructor
..

Pass a message key to MalformedTitleException constructor

'badtitletext' seems to be equivalent to the situation before I4da8ecb4,
so let's go with that.

Bug: T99818
Change-Id: Ifdf66d2806df3ae7d2d378343491dd8976c31981
(cherry picked from commit f0b510f9d94742a6da57e1aebbee914808b3f4a3)
---
M includes/MediaWiki.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/90/212490/1

diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 62ab667..58c49f4 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -114,7 +114,7 @@
// If we get here, we definitely don't have a valid 
title; throw an exception.
// Try to get detailed invalid title exception first, 
fall back to MalformedTitleException.
Title::newFromTextThrow( $title );
-   throw new MalformedTitleException( null, $title );
+   throw new MalformedTitleException( 'badtitletext', 
$title );
}
 
return $ret;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifdf66d2806df3ae7d2d378343491dd8976c31981
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Anomie 

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


[MediaWiki-commits] [Gerrit] Add a little indentation to index.html - change (wikidata...rdf)

2015-05-20 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Add a little indentation to index.html
..

Add a little indentation to index.html

Change-Id: I13f1aaba57827a0ececace5c593be9afa72f88c5
---
M gui/index.html
1 file changed, 39 insertions(+), 40 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/88/212488/1

diff --git a/gui/index.html b/gui/index.html
index 3215bec..2ff9106 100644
--- a/gui/index.html
+++ b/gui/index.html
@@ -15,47 +15,46 @@
 
 
   
-  Welcome to Wikidata Query Service Beta!
-  Please enter your query below.
-  
-  See also: [hide]
-  
-  
-   https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format";>RDF 
data model
-  (https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format#Full_list_of_prefixes";>prefixes
 list)
-   https://github.com/wikimedia/wikidata-query-rdf/blob/master/docs/exploring-linked-data.md";>Exploring
 Linked Data
-   https://www.mediawiki.org/wiki/Wikibase/Indexing/SPARQL_Query_Examples";>SPARQL
 query examples
-   http://tools.wmflabs.org/wdq2sparql/w2s.php";>WDQ syntax 
translator
-  
-Sample query:
-
-  -
-
-  
-  
-  
-  
-  
-  
-  
-
-  
-  
-
-
-
+Welcome to Wikidata Query Service Beta!
+Please enter your query below.
+
+  See also: [hide]
+  
+
+   https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format";>RDF 
data model
+  (https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format#Full_list_of_prefixes";>prefixes
 list)
+   https://github.com/wikimedia/wikidata-query-rdf/blob/master/docs/exploring-linked-data.md";>Exploring
 Linked Data
+   https://www.mediawiki.org/wiki/Wikibase/Indexing/SPARQL_Query_Examples";>SPARQL
 query examples
+   http://tools.wmflabs.org/wdq2sparql/w2s.php";>WDQ 
syntax translator
+  
+Sample query:
+
+  -
+
+  
+  
+
   
-
-
-  
-  
-  Total results: , duration: 
 ms.
-  Click on * to explore.
-  Hide explorer
-  Generate short URL.
-  
-  
-  
+  
+  
+
+  
+  
+
+
+
+  
+
+
+  
+  
+  Total results: , 
duration:  ms.
+  Click on * to explore.
+  Hide explorer
+  Generate short URL.
+
+
+
   
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I13f1aaba57827a0ececace5c593be9afa72f88c5
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 

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


[MediaWiki-commits] [Gerrit] Pass a message key to MalformedTitleException constructor - change (mediawiki/core)

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

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

Change subject: Pass a message key to MalformedTitleException constructor
..

Pass a message key to MalformedTitleException constructor

'badtitletext' seems to be equivalent to the situation before I4da8ecb4,
so let's go with that.

Bug: T99818
Change-Id: Ifdf66d2806df3ae7d2d378343491dd8976c31981
(cherry picked from commit f0b510f9d94742a6da57e1aebbee914808b3f4a3)
---
M includes/MediaWiki.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/87/212487/1

diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 62ab667..58c49f4 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -114,7 +114,7 @@
// If we get here, we definitely don't have a valid 
title; throw an exception.
// Try to get detailed invalid title exception first, 
fall back to MalformedTitleException.
Title::newFromTextThrow( $title );
-   throw new MalformedTitleException( null, $title );
+   throw new MalformedTitleException( 'badtitletext', 
$title );
}
 
return $ret;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifdf66d2806df3ae7d2d378343491dd8976c31981
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Anomie 

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


[MediaWiki-commits] [Gerrit] Revert "Undefer push() in lazyPush() temporarily" - change (mediawiki/core)

2015-05-20 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Revert "Undefer push() in lazyPush() temporarily"
..


Revert "Undefer push() in lazyPush() temporarily"

This reverts commit ed9fda366ac25282efccd93f7a85a71918b62a2a.

Change-Id: I5b9336067c1f161d0b385c4d22d4a0c6be1fa2e7
---
M includes/jobqueue/JobQueueGroup.php
1 file changed, 0 insertions(+), 3 deletions(-)

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



diff --git a/includes/jobqueue/JobQueueGroup.php 
b/includes/jobqueue/JobQueueGroup.php
index 776433d..3d2393e 100644
--- a/includes/jobqueue/JobQueueGroup.php
+++ b/includes/jobqueue/JobQueueGroup.php
@@ -147,9 +147,6 @@
 * @since 1.26
 */
public function lazyPush( $jobs ) {
-   $this->push( $jobs ); // hack
-   return;
-
if ( PHP_SAPI === 'cli' ) {
$this->push( $jobs );
return;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5b9336067c1f161d0b385c4d22d4a0c6be1fa2e7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Flush lazy jobs in load.php and api.php too - change (mediawiki/core)

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

Change subject: Flush lazy jobs in load.php and api.php too
..


Flush lazy jobs in load.php and api.php too

* A more proper solution will have one method for all this stuff

Bug: T99775
Bug: T99849
Change-Id: I16a32b260386a85504eb85ea58f1156b4e581a83
(cherry picked from commit e58e4b498dcccdc8ce98373e04c27cdfbd4b3a04)
---
M api.php
M load.php
2 files changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/api.php b/api.php
index 7775158..9721c4f 100644
--- a/api.php
+++ b/api.php
@@ -94,6 +94,8 @@
fastcgi_finish_request();
 }
 
+JobQueueGroup::pushLazyJobs();
+
 // Execute any deferred updates
 DeferredUpdates::doUpdates();
 
diff --git a/load.php b/load.php
index ef2df31..d77a689 100644
--- a/load.php
+++ b/load.php
@@ -43,6 +43,8 @@
 $resourceLoader = new ResourceLoader( $configFactory->makeConfig( 'main' ) );
 $resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, 
$wgRequest ) );
 
+JobQueueGroup::pushLazyJobs();
+
 Profiler::instance()->setTemplated( true );
 wfLogProfilingData();
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I16a32b260386a85504eb85ea58f1156b4e581a83
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] registration: Notify of problems before filemtime, not after - change (mediawiki/core)

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

Change subject: registration: Notify of problems before filemtime, not after
..


registration: Notify of problems before filemtime, not after

Without this several lines of warning are emitted before the final error 
indicating the cause.

Bug: T99846
Change-Id: Ic1b9d9a80ed995273c56c447c8b044285a8843a7
(cherry picked from commit 6fb86c5d80e5d525bc335a6b16336744a50bf454)
---
M includes/registration/ExtensionRegistry.php
1 file changed, 12 insertions(+), 4 deletions(-)

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



diff --git a/includes/registration/ExtensionRegistry.php 
b/includes/registration/ExtensionRegistry.php
index 230934a..2558f7e 100644
--- a/includes/registration/ExtensionRegistry.php
+++ b/includes/registration/ExtensionRegistry.php
@@ -70,10 +70,18 @@
 */
public function queue( $path ) {
global $wgExtensionInfoMTime;
-   if ( $wgExtensionInfoMTime !== false ) {
-   $mtime = $wgExtensionInfoMTime;
-   } else {
-   $mtime = filemtime( $path );
+
+   $mtime = $wgExtensionInfoMTime;
+   if ( $mtime === false ) {
+   if ( file_exists( $path ) ) {
+   $mtime = filemtime( $path );
+   } else {
+   throw new Exception( "$path does not exist!" );
+   }
+   if ( !$mtime ) {
+   $err = error_get_last();
+   throw new Exception( "Couldn't stat $path: 
{$err['message']}" );
+   }
}
$this->queued[$path] = $mtime;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic1b9d9a80ed995273c56c447c8b044285a8843a7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_25
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: MarkAHershberger 
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 HHVM mysql connection timeout to 3s on canary servers - change (operations/puppet)

2015-05-20 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Set HHVM mysql connection timeout to 3s on canary servers
..


Set HHVM mysql connection timeout to 3s on canary servers

Use hiera to configure the hhvm.mysql.connect_timeout setting on canary
app and api servers to be 3 seconds instead of the default 1 second in
an attempt to reduce the number of aborted database connections seen in
the HHVM error logs.

Bug: T98489
Change-Id: Id4dd19222b6187e903a267c32f05f47c46f6b45c
---
M hieradata/role/common/mediawiki/appserver/canary_api.yaml
M hieradata/role/common/mediawiki/canary_appserver.yaml
2 files changed, 16 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/role/common/mediawiki/appserver/canary_api.yaml 
b/hieradata/role/common/mediawiki/appserver/canary_api.yaml
index 97dbcb1..50c6402 100644
--- a/hieradata/role/common/mediawiki/appserver/canary_api.yaml
+++ b/hieradata/role/common/mediawiki/appserver/canary_api.yaml
@@ -5,3 +5,11 @@
 admin::groups:
   - deployment
 mediawiki::users::web: www-data
+hhvm::fcgi_settings:
+  hhvm:
+mysql:
+  connect_timeout: 3000
+hhvm::cli_settings:
+  hhvm:
+mysql:
+  connect_timeout: 3000
diff --git a/hieradata/role/common/mediawiki/canary_appserver.yaml 
b/hieradata/role/common/mediawiki/canary_appserver.yaml
index adb2438..d6bfa67 100644
--- a/hieradata/role/common/mediawiki/canary_appserver.yaml
+++ b/hieradata/role/common/mediawiki/canary_appserver.yaml
@@ -5,3 +5,11 @@
 mediawiki::users::web: www-data
 admin::groups:
   - deployment
+hhvm::fcgi_settings:
+  hhvm:
+mysql:
+  connect_timeout: 3000
+hhvm::cli_settings:
+  hhvm:
+mysql:
+  connect_timeout: 3000

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id4dd19222b6187e903a267c32f05f47c46f6b45c
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: BBlack 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: Springle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Flush lazy jobs in load.php and api.php too - change (mediawiki/core)

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

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

Change subject: Flush lazy jobs in load.php and api.php too
..

Flush lazy jobs in load.php and api.php too

* A more proper solution will have one method for all this stuff

Bug: T99775
Bug: T99849
Change-Id: I16a32b260386a85504eb85ea58f1156b4e581a83
(cherry picked from commit e58e4b498dcccdc8ce98373e04c27cdfbd4b3a04)
---
M api.php
M load.php
2 files changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/86/212486/1

diff --git a/api.php b/api.php
index 7775158..9721c4f 100644
--- a/api.php
+++ b/api.php
@@ -94,6 +94,8 @@
fastcgi_finish_request();
 }
 
+JobQueueGroup::pushLazyJobs();
+
 // Execute any deferred updates
 DeferredUpdates::doUpdates();
 
diff --git a/load.php b/load.php
index ef2df31..d77a689 100644
--- a/load.php
+++ b/load.php
@@ -43,6 +43,8 @@
 $resourceLoader = new ResourceLoader( $configFactory->makeConfig( 'main' ) );
 $resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, 
$wgRequest ) );
 
+JobQueueGroup::pushLazyJobs();
+
 Profiler::instance()->setTemplated( true );
 wfLogProfilingData();
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16a32b260386a85504eb85ea58f1156b4e581a83
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] Flush lazy jobs in load.php and api.php too - change (mediawiki/core)

2015-05-20 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Flush lazy jobs in load.php and api.php too
..


Flush lazy jobs in load.php and api.php too

* A more proper solution will have one method for all this stuff

Bug: T99775
Bug: T99849
Change-Id: I16a32b260386a85504eb85ea58f1156b4e581a83
(cherry picked from commit e58e4b498dcccdc8ce98373e04c27cdfbd4b3a04)
---
M api.php
M load.php
2 files changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/api.php b/api.php
index 7775158..9721c4f 100644
--- a/api.php
+++ b/api.php
@@ -94,6 +94,8 @@
fastcgi_finish_request();
 }
 
+JobQueueGroup::pushLazyJobs();
+
 // Execute any deferred updates
 DeferredUpdates::doUpdates();
 
diff --git a/load.php b/load.php
index ef2df31..d77a689 100644
--- a/load.php
+++ b/load.php
@@ -43,6 +43,8 @@
 $resourceLoader = new ResourceLoader( $configFactory->makeConfig( 'main' ) );
 $resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, 
$wgRequest ) );
 
+JobQueueGroup::pushLazyJobs();
+
 Profiler::instance()->setTemplated( true );
 wfLogProfilingData();
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I16a32b260386a85504eb85ea58f1156b4e581a83
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Refactored entry points to have uniform shutdown handling - change (mediawiki/core)

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

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

Change subject: Refactored entry points to have uniform shutdown handling
..

Refactored entry points to have uniform shutdown handling

* Added doPreSendCommit() and doPostSendShutdown()

Change-Id: Ibc7e768fd483389a01847f08cdeba4058c853d3f
---
M api.php
M img_auth.php
M includes/MediaWiki.php
M load.php
M thumb.php
5 files changed, 51 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/85/212485/1

diff --git a/api.php b/api.php
index 9721c4f..70dd2c7 100644
--- a/api.php
+++ b/api.php
@@ -90,19 +90,8 @@
$processor->execute();
 }
 
-if ( function_exists( 'fastcgi_finish_request' ) ) {
-   fastcgi_finish_request();
-}
-
-JobQueueGroup::pushLazyJobs();
-
-// Execute any deferred updates
-DeferredUpdates::doUpdates();
-
 // Log what the user did, for book-keeping purposes.
 $endtime = microtime( true );
-
-wfLogProfilingData();
 
 // Log the request
 if ( $wgAPIRequestLog ) {
@@ -132,7 +121,6 @@
wfDebug( "Logged API request to $wgAPIRequestLog\n" );
 }
 
-// Shut down the database.  foo()->bar() syntax is not supported in PHP4: we 
won't ever actually
-// get here to worry about whether this should be = or =&, but the file has to 
parse properly.
-$lb = wfGetLBFactory();
-$lb->shutdown();
+$mediawiki = new MediaWiki();
+$mediawiki->doPreSendCommit();
+$mediawiki->doPostSendShutdown( 'fast' );
\ No newline at end of file
diff --git a/img_auth.php b/img_auth.php
index 22fd401..f825c47 100644
--- a/img_auth.php
+++ b/img_auth.php
@@ -46,11 +46,10 @@
 $wgActionPaths = array( "$wgUploadPath/" );
 
 wfImageAuthMain();
-wfLogProfilingData();
-// Commit and close up!
-$factory = wfGetLBFactory();
-$factory->commitMasterChanges();
-$factory->shutdown();
+
+$mediawiki = new MediaWiki();
+$mediawiki->doPreSendCommit();
+$mediawiki->doPostSendShutdown();
 
 function wfImageAuthMain() {
global $wgImgAuthUrlPathMap;
diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 58c49f4..de43fdf 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -440,27 +440,53 @@
MWExceptionHandler::handleException( $e );
}
 
-   if ( function_exists( 'register_postsend_function' ) ) {
-   // https://github.com/facebook/hhvm/issues/1230
-   register_postsend_function( array( $this, 
'postSendUpdates' ) );
-   } elseif ( function_exists( 'fastcgi_finish_request' ) ) {
-   fastcgi_finish_request();
-   $this->postSendUpdates();
-   } else {
-   $this->postSendUpdates();
-   }
+   $this->doPostSendShutdown();
+   }
+
+   /**
+* This function commits all DB changes as needed before
+* the user can receive a response (in case commit fails)
+*
+* @since 1.26
+*/
+   public function doPreSendCommit() {
+   wfGetLBFactory()->commitMasterChanges();
}
 
/**
 * This function does work that can be done *after* the
 * user gets the HTTP response so they don't block on it
 *
+* @param string $mode Use 'fast' to always skip job running
 * @since 1.26
 */
-   public function postSendUpdates() {
+   public function doPostSendShutdown( $mode = 'normal' ) {
+   if ( function_exists( 'register_postsend_function' ) ) {
+   // https://github.com/facebook/hhvm/issues/1230
+   $that = $this;
+   register_postsend_function( function() use ( $that, 
$mode ) {
+   $that->doPostSendShutdownInternal( $mode );
+   } );
+   } else {
+   if ( function_exists( 'fastcgi_finish_request' ) ) {
+   fastcgi_finish_request();
+   }
+
+   $this->doPostSendShutdownInternal( $mode );
+   }
+   }
+
+   /**
+* This method should not be called from outside classes
+*
+* @param string $mode Use 'fast' to skip job running
+*/
+   public function doPostSendShutdownInternal( $mode ) {
try {
JobQueueGroup::pushLazyJobs();
-   $this->triggerJobs();
+   if ( $mode === 'normal' ) {
+   $this->triggerJobs();
+   }
$this->restInPeace();
} catch ( Exception $e ) {
MWExceptionHandler::handleException( $e );
@@ -607,7 +633,7 @@
ignore_user_abort( true );
// Now commit any transactions, so that unreported errors afte

[MediaWiki-commits] [Gerrit] registration: Notify of problems before filemtime, not after - change (mediawiki/core)

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

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

Change subject: registration: Notify of problems before filemtime, not after
..

registration: Notify of problems before filemtime, not after

Without this several lines of warning are emitted before the final error 
indicating the cause.

Bug: T99846
Change-Id: Ic1b9d9a80ed995273c56c447c8b044285a8843a7
(cherry picked from commit 6fb86c5d80e5d525bc335a6b16336744a50bf454)
---
M includes/registration/ExtensionRegistry.php
1 file changed, 12 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/84/212484/1

diff --git a/includes/registration/ExtensionRegistry.php 
b/includes/registration/ExtensionRegistry.php
index 230934a..2558f7e 100644
--- a/includes/registration/ExtensionRegistry.php
+++ b/includes/registration/ExtensionRegistry.php
@@ -70,10 +70,18 @@
 */
public function queue( $path ) {
global $wgExtensionInfoMTime;
-   if ( $wgExtensionInfoMTime !== false ) {
-   $mtime = $wgExtensionInfoMTime;
-   } else {
-   $mtime = filemtime( $path );
+
+   $mtime = $wgExtensionInfoMTime;
+   if ( $mtime === false ) {
+   if ( file_exists( $path ) ) {
+   $mtime = filemtime( $path );
+   } else {
+   throw new Exception( "$path does not exist!" );
+   }
+   if ( !$mtime ) {
+   $err = error_get_last();
+   throw new Exception( "Couldn't stat $path: 
{$err['message']}" );
+   }
}
$this->queued[$path] = $mtime;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic1b9d9a80ed995273c56c447c8b044285a8843a7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_25
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: MarkAHershberger 

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


[MediaWiki-commits] [Gerrit] registration: Notify of problems before filemtime, not after - change (mediawiki/core)

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

Change subject: registration: Notify of problems before filemtime, not after
..


registration: Notify of problems before filemtime, not after

Without this several lines of warning are emitted before the final error 
indicating the cause.

Bug: T99846
Change-Id: Ic1b9d9a80ed995273c56c447c8b044285a8843a7
---
M includes/registration/ExtensionRegistry.php
1 file changed, 12 insertions(+), 4 deletions(-)

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



diff --git a/includes/registration/ExtensionRegistry.php 
b/includes/registration/ExtensionRegistry.php
index 4cad259..ac39699 100644
--- a/includes/registration/ExtensionRegistry.php
+++ b/includes/registration/ExtensionRegistry.php
@@ -70,10 +70,18 @@
 */
public function queue( $path ) {
global $wgExtensionInfoMTime;
-   if ( $wgExtensionInfoMTime !== false ) {
-   $mtime = $wgExtensionInfoMTime;
-   } else {
-   $mtime = filemtime( $path );
+
+   $mtime = $wgExtensionInfoMTime;
+   if ( $mtime === false ) {
+   if ( file_exists( $path ) ) {
+   $mtime = filemtime( $path );
+   } else {
+   throw new Exception( "$path does not exist!" );
+   }
+   if ( !$mtime ) {
+   $err = error_get_last();
+   throw new Exception( "Couldn't stat $path: 
{$err['message']}" );
+   }
}
$this->queued[$path] = $mtime;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic1b9d9a80ed995273c56c447c8b044285a8843a7
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MarkAHershberger 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: MarkAHershberger 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Use __DIR__ - change (mediawiki...WikimediaIncubator)

2015-05-20 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Use __DIR__
..

Use __DIR__

Change-Id: I32ea012dbdf61ee60e09fda05f5e8ba04589bbc3
(cherry picked from commit d1ca8e36ec51e2dd40c155fdec6b18de9ab0c449)
---
M WikimediaIncubator.php
1 file changed, 14 insertions(+), 15 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaIncubator 
refs/changes/83/212483/1

diff --git a/WikimediaIncubator.php b/WikimediaIncubator.php
index a637bc7..4eb1ea2 100644
--- a/WikimediaIncubator.php
+++ b/WikimediaIncubator.php
@@ -24,7 +24,6 @@
 
 /* General (globals and/or configuration) */
 $wmincPref = 'incubatortestwiki'; // Name of the preference
-$dir = __DIR__ . '/';
 
 # only one-letter codes can be used for projects
 $wmincProjects = array(
@@ -76,12 +75,12 @@
 $wgRemoveGroups['bureaucrat'][] = 'test-sysop';
 
 $wgMessagesDirs['WikimediaIncubator'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['WikimediaIncubator'] = $dir . 
'WikimediaIncubator.i18n.php';
-$wgExtensionMessagesFiles['WikimediaIncubatorAlias'] = $dir . 
'WikimediaIncubator.alias.php';
-$wgExtensionMessagesFiles['WikimediaIncubatorMagic'] = $dir . 
'WikimediaIncubator.i18n.magic.php';
+$wgExtensionMessagesFiles['WikimediaIncubator'] = __DIR__ . 
'/WikimediaIncubator.i18n.php';
+$wgExtensionMessagesFiles['WikimediaIncubatorAlias'] = __DIR__ . 
'/WikimediaIncubator.alias.php';
+$wgExtensionMessagesFiles['WikimediaIncubatorMagic'] = __DIR__ . 
'/WikimediaIncubator.i18n.magic.php';
 
 /* Special:ViewUserLang */
-$wgAutoloadClasses['SpecialViewUserLang'] = $dir . 'SpecialViewUserLang.php';
+$wgAutoloadClasses['SpecialViewUserLang'] = __DIR__ . 
'/SpecialViewUserLang.php';
 $wgSpecialPages['ViewUserLang'] = 'SpecialViewUserLang';
 $wgSpecialPageGroups['ViewUserLang'] = 'users';
 $wgAvailableRights[] = 'viewuserlang';
@@ -90,14 +89,14 @@
 $wgGroupPermissions['sysop']['viewuserlang'] = true;
 
 /* TestWiki preference */
-$wgAutoloadClasses['WikimediaIncubator'] = $dir . 
'WikimediaIncubator.class.php';
+$wgAutoloadClasses['WikimediaIncubator'] = __DIR__ . 
'/WikimediaIncubator.class.php';
 $wgHooks['GetPreferences'][] = 'WikimediaIncubator::onGetPreferences';
 $wgHooks['UserGetDefaultOptions'][] = 
'WikimediaIncubator::onUserGetDefaultOptions';
 $wgHooks['MagicWordwgVariableIDs'][] = 'WikimediaIncubator::magicWordVariable';
 $wgHooks['ParserGetVariableValueSwitch'][] = 
'WikimediaIncubator::magicWordValue';
 
 /* Special:MyMainPage (depending on your test wiki preference) */
-$wgAutoloadClasses['SpecialMyMainPage'] = $dir . 'SpecialMyMainPage.php';
+$wgAutoloadClasses['SpecialMyMainPage'] = __DIR__ . '/SpecialMyMainPage.php';
 $wgSpecialPages['MyMainPage'] = 'SpecialMyMainPage';
 
 /* Create/move page permissions */
@@ -106,17 +105,17 @@
 $wgHooks['AbortMove'][] = 'WikimediaIncubator::checkPrefixMovePermissions';
 
 /* Recent Changes */
-$wgAutoloadClasses['TestWikiRC'] = $dir . 'TestWikiRC.php';
+$wgAutoloadClasses['TestWikiRC'] = __DIR__ . '/TestWikiRC.php';
 $wgHooks['SpecialRecentChangesQuery'][] = 'TestWikiRC::onRcQuery';
 $wgHooks['SpecialRecentChangesPanel'][] = 'TestWikiRC::onRcForm';
 
 /* Automatic pref on account creation */
-$wgAutoloadClasses['AutoTestWiki'] = $dir . 'CreateAccountTestWiki.php';
+$wgAutoloadClasses['AutoTestWiki'] = __DIR__ . '/CreateAccountTestWiki.php';
 $wgHooks['UserCreateForm'][] = 'AutoTestWiki::onUserCreateForm';
 $wgHooks['AddNewAccount'][] = 'AutoTestWiki::onAddNewAccount';
 
 /* Random page by test */
-$wgAutoloadClasses['SpecialRandomByTest'] = $dir . 'SpecialRandomByTest.php';
+$wgAutoloadClasses['SpecialRandomByTest'] = __DIR__ . 
'/SpecialRandomByTest.php';
 $wgSpecialPages['RandomByTest'] = 'SpecialRandomByTest';
 
 /* support for automatic checking in a list of databases if a wiki exists */
@@ -136,7 +135,7 @@
 $wmincClosedWikis = false;
 
 /* Wx/xx[x] info page */
-$wgAutoloadClasses['InfoPage'] = $dir . 'InfoPage.php';
+$wgAutoloadClasses['InfoPage'] = __DIR__ . '/InfoPage.php';
 $wgHooks['ShowMissingArticle'][] = 'WikimediaIncubator::onShowMissingArticle';
 $wgHooks['EditFormPreloadText'][] = 
'WikimediaIncubator::onEditFormPreloadText';
 $wgHooks['MediaWikiPerformAction'][] = 
'WikimediaIncubator::onMediaWikiPerformAction';
@@ -145,7 +144,7 @@
 
 $wgResourceModules['WikimediaIncubator.InfoPage'] = array(
'styles' => 'InfoPage.css',
-   'localBasePath' => dirname(__FILE__),
+   'localBasePath' => __DIR__,
'remoteExtPath' => 'WikimediaIncubator',
 );
 
@@ -156,7 +155,7 @@
 $wgHooks['PageContentLanguage'][] = 
'WikimediaIncubator::onPageContentLanguage';
 
 /* List of users */
-$wgAutoloadClasses['ListUsersTestWiki'] = $dir . 'ListUsersTestWiki.php';
+$wgAutoloadClasses['ListUsersTestWiki'] = __DIR__ . '/ListUsersTestWiki.php';
 $wgHooks['SpecialListusersHeaderForm'][] = 
'ListUsersTestWiki::onSpecialListusersHeaderForm';
 $wgHooks['Special

[MediaWiki-commits] [Gerrit] Fix doc and public should be infront of static - change (mediawiki...WikimediaIncubator)

2015-05-20 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Fix doc and public should be infront of static
..

Fix doc and public should be infront of static

Change-Id: Ica53b8dc66904b684b8737c95793d7e02dc5d2e1
(cherry picked from commit 6aa9c2796bf91edf7db6b36dd4ed1aed9b3f8642)
---
M InfoPage.php
M WikimediaIncubator.class.php
2 files changed, 13 insertions(+), 13 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaIncubator 
refs/changes/82/212482/1

diff --git a/InfoPage.php b/InfoPage.php
index b6e345d..9b154bd 100644
--- a/InfoPage.php
+++ b/InfoPage.php
@@ -1,18 +1,18 @@
 https://gerrit.wikimedia.org/r/212482
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica53b8dc66904b684b8737c95793d7e02dc5d2e1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaIncubator
Gerrit-Branch: REL1_25
Gerrit-Owner: Paladox 

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


[MediaWiki-commits] [Gerrit] Do not count in SiteLinksView - change (mediawiki...Wikibase)

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

Change subject: Do not count in SiteLinksView
..


Do not count in SiteLinksView

The actual number of elements is irrelevant, counting them only wastes
time.

Change-Id: I707d84182fa004f9052102bd3cff9a0f21d6e6ad
---
M view/src/SiteLinksView.php
1 file changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/view/src/SiteLinksView.php b/view/src/SiteLinksView.php
index 3fff9a7..fee5265 100644
--- a/view/src/SiteLinksView.php
+++ b/view/src/SiteLinksView.php
@@ -98,7 +98,7 @@
public function getHtml( array $siteLinks, ItemId $itemId = null, array 
$groups ) {
$html = '';
 
-   if ( count( $groups ) === 0 ) {
+   if ( empty( $groups ) ) {
return $html;
}
 
@@ -192,6 +192,8 @@
$sortOk = usort(
$siteLinksForTable,
function( array $a, array $b ) {
+   /** @var SiteLink[] $a */
+   /** @var SiteLink[] $b */
return strcmp( $a['siteLink']->getSiteId(), 
$b['siteLink']->getSiteId() );
}
);
@@ -290,7 +292,7 @@
// FIXME: No need for separate template; Use 
'wikibase-sitelinkview' template.
return $this->templateFactory->render( 
'wikibase-sitelinkview-unknown',
htmlspecialchars( $siteLink->getSiteId() ),
-   htmlspecialchars(  $siteLink->getPageName() )
+   htmlspecialchars( $siteLink->getPageName() )
);
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I707d84182fa004f9052102bd3cff9a0f21d6e6ad
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: JanZerebecki 
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 "Undefer push() in lazyPush() temporarily" - change (mediawiki/core)

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

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

Change subject: Revert "Undefer push() in lazyPush() temporarily"
..

Revert "Undefer push() in lazyPush() temporarily"

This reverts commit ed9fda366ac25282efccd93f7a85a71918b62a2a.

Change-Id: I5b9336067c1f161d0b385c4d22d4a0c6be1fa2e7
---
M includes/jobqueue/JobQueueGroup.php
1 file changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/81/212481/1

diff --git a/includes/jobqueue/JobQueueGroup.php 
b/includes/jobqueue/JobQueueGroup.php
index 04ebc51..72d2537 100644
--- a/includes/jobqueue/JobQueueGroup.php
+++ b/includes/jobqueue/JobQueueGroup.php
@@ -147,9 +147,6 @@
 * @since 1.26
 */
public function lazyPush( $jobs ) {
-   $this->push( $jobs ); // hack
-   return;
-
if ( PHP_SAPI === 'cli' ) {
$this->push( $jobs );
return;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b9336067c1f161d0b385c4d22d4a0c6be1fa2e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Add a way to provide one-click query examples - change (wikidata...rdf)

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

Change subject: Add a way to provide one-click query examples
..


Add a way to provide one-click query examples

Change-Id: I0ee7bab9d919f118aabdc80e0155130905c4951a
---
M gui/gui.js
M gui/index.html
2 files changed, 43 insertions(+), 3 deletions(-)

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



diff --git a/gui/gui.js b/gui/gui.js
index 8d06bbe..be4cf6f 100644
--- a/gui/gui.js
+++ b/gui/gui.js
@@ -1,6 +1,8 @@
 var jQuery = $;
 var mediaWiki = {};
 
+var EDITOR = {};
+
 $(function() {
var SERVICE = '/bigdata/namespace/wdq/sparql';
 
@@ -59,7 +61,6 @@
mode : "sparql",
};
 
-   var EDITOR = {};
var ERROR_LINE_MARKER = null;
var ERROR_CHARACTER_MARKER = null;
 
@@ -273,19 +274,52 @@
$('#show-explorer').show();
}
 
+   function setupExamples() {
+   var exampleQueries = document.getElementById('exampleQueries');
+   exampleQueries.add(new Option('US presidents and wives',
+   'PREFIX wd:  \n' +
+   'PREFIX wdt: \n' +
+   'PREFIX rdfs: 
\n' +
+   'PREFIX p: \n' +
+   'PREFIX v: \n' 
+
+   'SELECT ?p ?w ?l ?wl WHERE {\n' +
+   '   wd:Q30 p:P6/v:P6 ?p .\n' +
+   '   ?p wdt:P26 ?w .\n' +
+   '   OPTIONAL  {  \n' +
+   ' ?p rdfs:label ?l FILTER (LANG(?l) = "en") . \n' +
+   '   }\n' +
+   '   OPTIONAL {\n' +
+   ' ?w rdfs:label ?wl FILTER (LANG(?wl) = "en"). \n' +
+   '   }\n' +
+   ' }'
+ ));
+   }
+
+   function pasteExample() {
+   var text = this.value;
+   this.selectedIndex = 0;
+   if(!text || !text.trim()) {
+   return;
+   }
+EDITOR.setValue(text);
+}
+
function setupHandlers() {
$('#query-form').submit(submitQuery);
$('.namespace-shortcuts').on('change', 'select', 
selectNamespace);
+   $('.exampleQueries').on('change', pasteExample);
$('#prefixes-button').click(addPrefixes);
$('#showhide').click(showHideHelp);
$('#hide-explorer').click(hideExlorer);
+   $('#clear-button').click(function () { EDITOR.setValue("") });
 
}
 
function startGUI() {
-   setupHandlers();
setupEditor();
+   setupExamples();
populateNamespaceShortcuts();
+   setupHandlers();
initQuery();
}
 
diff --git a/gui/index.html b/gui/index.html
index a2a26e0..3215bec 100644
--- a/gui/index.html
+++ b/gui/index.html
@@ -26,6 +26,12 @@
https://github.com/wikimedia/wikidata-query-rdf/blob/master/docs/exploring-linked-data.md";>Exploring
 Linked Data
https://www.mediawiki.org/wiki/Wikibase/Indexing/SPARQL_Query_Examples";>SPARQL
 query examples
http://tools.wmflabs.org/wdq2sparql/w2s.php";>WDQ syntax 
translator
+  
+Sample query:
+
+  -
+
+  
   
   
   
@@ -36,7 +42,7 @@
   
   
 
-
+
 
   
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0ee7bab9d919f118aabdc80e0155130905c4951a
Gerrit-PatchSet: 2
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Jdouglas 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Jdouglas 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Beta: updated graphoid to the new api endpoint - change (operations/mediawiki-config)

2015-05-20 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: Beta: updated graphoid to the new api endpoint
..

Beta: updated graphoid to the new api endpoint

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


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

diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 45e5e54..88cf5d1 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -1087,7 +1087,7 @@
),
 
'wmgGraphImgServiceUrl' => array(
-   'default' => 
"//graphoid-beta.wmflabs.org/%1\$s/v1/png/%2\$s/%3\$s/%4\$s.png",
+   'default' => 
"/api/rest_v1/page/graph/png/%2\$s/%3\$s/%4\$s.png",
'private' => false,
),
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib22ceecba73e058d116ee4a403043847a7be4dc5
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Yurik 

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


[MediaWiki-commits] [Gerrit] Slightly safer element construction - change (wikidata...rdf)

2015-05-20 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Slightly safer element construction
..

Slightly safer element construction

Its generally discouraged to build html elements through text concatenation
in the browser.  Clean that up a bit.  Also avoid adding javascript: href's,
just bind the click event and call the function we want.

Change-Id: I551cf63c7e6e1de44c1e20f11c8f1e711c4305ba
---
M gui/gui.js
M gui/style.css
2 files changed, 36 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/79/212479/1

diff --git a/gui/gui.js b/gui/gui.js
index ec81ebb..9d50178 100644
--- a/gui/gui.js
+++ b/gui/gui.js
@@ -95,7 +95,7 @@
}
 
function showQueryResults(data) {
-   var results, thead, i, tr, j, binding, title,
+   var results, thead, i, tr, td, linkText, j, binding, title,
table = $('').appendTo($('#query-result'));
$('#query-error').hide();
$('#query-result').show();
@@ -108,8 +108,8 @@
}
 
results = data.results.bindings.length;
-   $('#total-results').html(results);
-   $('#query-time').html(Date.now() - QUERY_START);
+   $('#total-results').text(results);
+   $('#query-time').text(Date.now() - QUERY_START);
$('#total').show();
$('#shorturl').attr("href", 
SHORTURL+encodeURIComponent(window.location));
 
@@ -124,43 +124,52 @@
for (i = 0; i < results; i++) {
tr = $('');
for (j = 0; j < data.head.vars.length; j++) {
+   td = $('');
if (data.head.vars[j] in 
data.results.bindings[i]) {
binding = 
data.results.bindings[i][data.head.vars[j]];
text = binding.value;
if (binding.type == 'uri') {
text = abbreviate(text);
}
-   linkText = 
escapeHTML(text).replace(/\n/g, '');
+   linkText = $('').text(text.trim());
if (binding.type == 'typed-literal') {
-   tdData = ' class="literal" 
data-datatype="' +
-   
binding.datatype + '"';
+   td.attr({
+   "class": "literal",
+   "data-datatype": 
binding.datatype
+   }).append(linkText);
} else {
+   td.attr('class', binding.type);
if (binding.type == 'uri') {
-   text = '' +
-   
linkText + '';
+   td.append($('')
+   .attr("href", 
binding.value)
+   
.append(linkText)
+   );

if(binding.value.match(/http:\/\/www.wikidata.org\/entity\//)) {
-   text += '*';
+   
td.append($('')
+   
.attr("href", '#')
+   
.bind('click', exploreURL.bind(undefined, binding.value))
+   
.text('*')
+   );
}
+   } else {
+   td.append(linkText);
}
-   tdData = ' class="' + 
binding.type + '"';
+
if (binding['xml:lang']) {
-   title = text + "@" + 
binding['xml:lang'];
-   tdData += ' 
data-lang="' + binding['xml:lang'] +
-   '"

[MediaWiki-commits] [Gerrit] Clean up a variety of jshint errors - change (wikidata...rdf)

2015-05-20 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Clean up a variety of jshint errors
..

Clean up a variety of jshint errors

Just a general style cleanup to begin passing a linting process.

Change-Id: I750513feb24050322c789633c32f61449e3ff3bb
---
M gui/gui.js
1 file changed, 122 insertions(+), 118 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/78/212478/1

diff --git a/gui/gui.js b/gui/gui.js
index 8d06bbe..ec81ebb 100644
--- a/gui/gui.js
+++ b/gui/gui.js
@@ -1,80 +1,75 @@
-var jQuery = $;
-var mediaWiki = {};
+window.mediaWiki = window.mediaWiki || {};
 
-$(function() {
-   var SERVICE = '/bigdata/namespace/wdq/sparql';
-
-   var SHORTURL = 'http://tinyurl.com/create.php?url=';
-
-   var NAMESPACE_SHORTCUTS = {
-   'Wikidata' : {
-   'wikibase' : 'http://wikiba.se/ontology#',
-   'wdata' : 
'http://wikidata.org/wiki/Special:EntityData/',
-   'wd' : 'http://wikidata.org/entity/',
-   'wdt' : 'http://wikidata.org/prop/direct/',
-   'wds' : 'http://wikidata.org/entity/statement/',
-   'p' : 'http://wikidata.org/prop/',
-   'wdref' : 'http://wikidata.org/reference/',
-   'wdv' : 'http://wikidata.org/value/',
-   'ps' : 'http://wikidata.org/prop/statement/',
-   'psv' : 'http://wikidata.org/prop/statement/value/',
-   'pq' : 'http://wikidata.org/prop/qualifier/',
-   'pqv' : 'http://wikidata.org/prop/qualifier/value/',
-   'pr' : 'http://wikidata.org/prop/reference/',
-   'prv' : 'http://wikidata.org/prop/reference/value/',
-   'wdno' : 'http://wikidata.org/prop/novalue/'
+(function($, mw) {
+   var SERVICE = '/bigdata/namespace/wdq/sparql',
+   SHORTURL = 'http://tinyurl.com/create.php?url=',
+   NAMESPACE_SHORTCUTS = {
+   'Wikidata' : {
+   'wikibase' : 'http://wikiba.se/ontology#',
+   'wdata' : 
'http://wikidata.org/wiki/Special:EntityData/',
+   'wd' : 'http://wikidata.org/entity/',
+   'wdt' : 'http://wikidata.org/prop/direct/',
+   'wds' : 'http://wikidata.org/entity/statement/',
+   'p' : 'http://wikidata.org/prop/',
+   'wdref' : 'http://wikidata.org/reference/',
+   'wdv' : 'http://wikidata.org/value/',
+   'ps' : 'http://wikidata.org/prop/statement/',
+   'psv' : 
'http://wikidata.org/prop/statement/value/',
+   'pq' : 'http://wikidata.org/prop/qualifier/',
+   'pqv' : 
'http://wikidata.org/prop/qualifier/value/',
+   'pr' : 'http://wikidata.org/prop/reference/',
+   'prv' : 
'http://wikidata.org/prop/reference/value/',
+   'wdno' : 'http://wikidata.org/prop/novalue/'
+   },
+   'W3C' : {
+   'rdf' : 
'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
+   'rdfs' : 
'http://www.w3.org/2000/01/rdf-schema#',
+   'owl' : 'http://www.w3.org/2002/07/owl#',
+   'skos' : 'http://www.w3.org/2004/02/skos/core#',
+   'xsd' : 'http://www.w3.org/2001/XMLSchema#'
+   },
+   'Social/Other' : {
+   'schema' : 'http://schema.org/',
+   },
+   'Blazegraph' : {
+   'bd' : 'http://www.bigdata.com/rdf#',
+   'bds' : 'http://www.bigdata.com/rdf/search#',
+   'gas' : 'http://www.bigdata.com/rdf/gas#',
+   'hint' : 'http://www.bigdata.com/queryHints#'
+   }
},
-   'W3C' : {
-   'rdf' : 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
-   'rdfs' : 'http://www.w3.org/2000/01/rdf-schema#',
-   'owl' : 'http://www.w3.org/2002/07/owl#',
-   'skos' : 'http://www.w3.org/2004/02/skos/core#',
-   'xsd' : 'http://www.w3.org/2001/XMLSchema#'
+   STANDARD_PREFIXES = [
+   'PREFIX wd: ',
+   'PREFIX wdt: 
',
+ 

[MediaWiki-commits] [Gerrit] Flush lazy jobs in load.php and api.php too - change (mediawiki/core)

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

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

Change subject: Flush lazy jobs in load.php and api.php too
..

Flush lazy jobs in load.php and api.php too

* A more proper solution will have one method for all this stuff

Bug: T99775
Bug: T99849
Change-Id: I16a32b260386a85504eb85ea58f1156b4e581a83
(cherry picked from commit e58e4b498dcccdc8ce98373e04c27cdfbd4b3a04)
---
M api.php
M load.php
2 files changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/77/212477/1

diff --git a/api.php b/api.php
index 7775158..9721c4f 100644
--- a/api.php
+++ b/api.php
@@ -94,6 +94,8 @@
fastcgi_finish_request();
 }
 
+JobQueueGroup::pushLazyJobs();
+
 // Execute any deferred updates
 DeferredUpdates::doUpdates();
 
diff --git a/load.php b/load.php
index ef2df31..d77a689 100644
--- a/load.php
+++ b/load.php
@@ -43,6 +43,8 @@
 $resourceLoader = new ResourceLoader( $configFactory->makeConfig( 'main' ) );
 $resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, 
$wgRequest ) );
 
+JobQueueGroup::pushLazyJobs();
+
 Profiler::instance()->setTemplated( true );
 wfLogProfilingData();
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16a32b260386a85504eb85ea58f1156b4e581a83
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] Updated param doc - change (mediawiki...restbase)

2015-05-20 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: Updated param doc
..

Updated param doc

Change-Id: I51dd93357c8b0370b3482ba60c3cf5fa6a1af217
---
M specs/mediawiki_v1_graphoid.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/restbase 
refs/changes/76/212476/1

diff --git a/specs/mediawiki_v1_graphoid.yaml b/specs/mediawiki_v1_graphoid.yaml
index 3aa6149..bfd1e48 100644
--- a/specs/mediawiki_v1_graphoid.yaml
+++ b/specs/mediawiki_v1_graphoid.yaml
@@ -24,7 +24,7 @@
   required: true
 - name: revision
   in: path
-  description: The page revision
+  description: The page revision, or 0 if unknown
   type: integer
   required: true
 - name: graph_id

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I51dd93357c8b0370b3482ba60c3cf5fa6a1af217
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/restbase
Gerrit-Branch: master
Gerrit-Owner: Yurik 

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


[MediaWiki-commits] [Gerrit] Add a script to disable Puppet temporarily - change (operations/puppet)

2015-05-20 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Add a script to disable Puppet temporarily
..


Add a script to disable Puppet temporarily

I am surely not alone in occasionally leaving Puppet disabled for longer than I
had intended. This script provides a means of disabling Puppet temporarily. It
does so by creating a detached screen session which sleeps for the desired
amount of time and then re-enables Puppet. It also leaves a better paper trail
by setting a default reason which includes the name of the user disabling
Puppet and the time it was disabled.

Usage: puppet-disable [DURATION] [REASON]

DURATION - Disable Puppet for this much time. Defaults to 1h.
REASON   - Reason for disabling Puppet. Defaults to a generic message.

Examples:

Disable Puppet for a day, no reason given:
$ puppet-disable 1d

Disable Puppet for 30 minutes, with reason:
$ puppet-disable 30m "experimenting with HHVM config"

Change-Id: I3f89fd339aacac862903974a149b6493cfefb8c9
---
M modules/admin/files/home/ori/.bash_profile
A modules/admin/files/home/ori/.binned/disable-puppet
2 files changed, 64 insertions(+), 1 deletion(-)

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



diff --git a/modules/admin/files/home/ori/.bash_profile 
b/modules/admin/files/home/ori/.bash_profile
index 2246aa6..e192d2c 100644
--- a/modules/admin/files/home/ori/.bash_profile
+++ b/modules/admin/files/home/ori/.bash_profile
@@ -31,6 +31,8 @@
 export PYTHONSTARTUP="${HOME}/.pythonrc"
 export PROMPT_COMMAND="history -a; history -n"
 export HHVM="$(pidof -s /usr/bin/hhvm 2>/dev/null)"
+export LC_COLLATE="C"
+export LESS="FIKMNQRX"
 
 
 
@@ -59,11 +61,14 @@
 psmem()  { sudo "$HOME/.bin/ps_mem.py" "${@}"; }
 where()  { find . -iname \*"$*"\* ; }
 reqs()   { curl -s 127.0.0.1/server-status | grep -Po '\d+(?= requests 
currently being processed)'; }
+service(){ sudo service "$@"; }
 perf()   { sudo perf "$@"; }
 gdbh()   { sudo gdb -p "$(pidof -s hhvm)"; }
-redis-cli()  { redis-cli -a "$(grep -Po '(?<=masterauth )\S+' 
/etc/redis/redis.conf)" "$@"; }
+redis-cli()  { command redis-cli -a "$(grep -Po '(?<=masterauth )\S+' 
/etc/redis/redis.conf)" "$@"; }
 fields() { awk 'END { for (i = 1; i <= NF; i++) printf("%s : %s\n", i, $i) 
}' "$@"; }
 field()  { awk -v field="$1" '{print $(field)}'; }
+lat(){ ls -lat "$@" | head; }
+sudo()   { command sudo -E "$@"; }
 
 ptop()   {
   args=( top )
diff --git a/modules/admin/files/home/ori/.binned/disable-puppet 
b/modules/admin/files/home/ori/.binned/disable-puppet
new file mode 100755
index 000..ff83cee
--- /dev/null
+++ b/modules/admin/files/home/ori/.binned/disable-puppet
@@ -0,0 +1,58 @@
+#!/bin/bash
+# -*- coding: utf-8 -*-
+#
+# disable-puppet - disable Puppet temporarily.
+#
+# Usage: disable-puppet [DURATION] [REASON]
+#
+#   DURATION - Disable Puppet for this much time. Defaults to 1h.
+#   REASON   - Reason for disabling Puppet. Defaults to a generic
+#  message.
+#
+# Examples:
+#
+#   Disable Puppet for a day, no reason given:
+#   $ disable-puppet 1d
+#
+#   Disable Puppet for 30 minutes, with reason:
+#   $ disable-puppet 30m "experimenting with HHVM config"
+#
+#
+case "$1" in
+  [0-9]*)
+DURATION="$1"
+shift
+;;
+  -h|--help)
+SCRIPT="$(basename "$0")"
+echo >&2 "${SCRIPT} - disable Puppet temporarily. "
+echo >&2
+echo >&2 "Usage: ${SCRIPT} [DURATION] [REASON]"
+echo >&2
+echo >&2 "  DURATION - Disable Puppet for this much time. Defaults to 1h. "
+echo >&2 "  REASON   - Reason for disabling Puppet. Defaults to a generic "
+echo >&2 " message.   "
+echo >&2
+echo >&2 "Examples:   "
+echo >&2
+echo >&2 "  Disable Puppet for a day, no reason given:"
+echo >&2 "  $ ${SCRIPT} 1d"
+echo >&2 ""
+echo >&2 "  Disable Puppet for 30 minutes, with reason:   "
+echo >&2 "  $ ${SCRIPT} 30m \"experimenting with HHVM config\""
+echo >&2
+exit 0
+;;
+esac
+
+test -f /var/lib/puppet/state/agent_disabled.lock && {
+  echo >&2 "puppet agent is already disabled!"
+  exit 1
+}
+
+TIMESTAMP="$(/bin/date --rfc-3339=seconds --utc)"
+DURATION="${DURATION:-1h}"
+REASON="${*:-Disabled by ${USER} for ${DURATION} at ${TIMESTAMP}}"
+echo "Disabling Puppet for ${DURATION} with reason: \"${REASON}\"."
+/usr/bin/sudo /usr/bin/puppet agent --verbose --disable "$REASON"
+/usr/bin/screen -d -m /usr/bin/sudo -n /bin/bash -c "/bin/sleep $DURATION ; 
/usr/bin/puppet agent --enable"

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

[MediaWiki-commits] [Gerrit] Flush lazy jobs in load.php and api.php too - change (mediawiki/core)

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

Change subject: Flush lazy jobs in load.php and api.php too
..


Flush lazy jobs in load.php and api.php too

* A more proper solution will have one method for all this stuff

Bug: T99775
Bug: T99849
Change-Id: I16a32b260386a85504eb85ea58f1156b4e581a83
---
M api.php
M load.php
2 files changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/api.php b/api.php
index 7775158..9721c4f 100644
--- a/api.php
+++ b/api.php
@@ -94,6 +94,8 @@
fastcgi_finish_request();
 }
 
+JobQueueGroup::pushLazyJobs();
+
 // Execute any deferred updates
 DeferredUpdates::doUpdates();
 
diff --git a/load.php b/load.php
index ef2df31..d77a689 100644
--- a/load.php
+++ b/load.php
@@ -43,6 +43,8 @@
 $resourceLoader = new ResourceLoader( $configFactory->makeConfig( 'main' ) );
 $resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, 
$wgRequest ) );
 
+JobQueueGroup::pushLazyJobs();
+
 Profiler::instance()->setTemplated( true );
 wfLogProfilingData();
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I16a32b260386a85504eb85ea58f1156b4e581a83
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Update SyntaxHighlight_GeSHi to 1.26wmf7 HEAD - change (mediawiki/core)

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

Change subject: Update SyntaxHighlight_GeSHi to 1.26wmf7 HEAD
..


Update SyntaxHighlight_GeSHi to 1.26wmf7 HEAD

Change-Id: Ie930fa62819b9a0b9468902c3d21624cd0514e9e
---
M extensions/SyntaxHighlight_GeSHi
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/extensions/SyntaxHighlight_GeSHi b/extensions/SyntaxHighlight_GeSHi
index 58860a0..400714d 16
--- a/extensions/SyntaxHighlight_GeSHi
+++ b/extensions/SyntaxHighlight_GeSHi
-Subproject commit 58860a0b0c5f7e093b2326e18f707a72ee88c2a4
+Subproject commit 400714d8b26e9150b33a38810970eb1205362c95

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie930fa62819b9a0b9468902c3d21624cd0514e9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Use __DIR__ - change (mediawiki...WikimediaIncubator)

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

Change subject: Use __DIR__
..


Use __DIR__

Change-Id: I32ea012dbdf61ee60e09fda05f5e8ba04589bbc3
---
M WikimediaIncubator.php
1 file changed, 14 insertions(+), 15 deletions(-)

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



diff --git a/WikimediaIncubator.php b/WikimediaIncubator.php
index d7f189b..9ee2e20 100644
--- a/WikimediaIncubator.php
+++ b/WikimediaIncubator.php
@@ -24,7 +24,6 @@
 
 /* General (globals and/or configuration) */
 $wmincPref = 'incubatortestwiki'; // Name of the preference
-$dir = __DIR__ . '/';
 
 # only one-letter codes can be used for projects
 $wmincProjects = array(
@@ -76,12 +75,12 @@
 $wgRemoveGroups['bureaucrat'][] = 'test-sysop';
 
 $wgMessagesDirs['WikimediaIncubator'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['WikimediaIncubator'] = $dir . 
'WikimediaIncubator.i18n.php';
-$wgExtensionMessagesFiles['WikimediaIncubatorAlias'] = $dir . 
'WikimediaIncubator.alias.php';
-$wgExtensionMessagesFiles['WikimediaIncubatorMagic'] = $dir . 
'WikimediaIncubator.i18n.magic.php';
+$wgExtensionMessagesFiles['WikimediaIncubator'] = __DIR__ . 
'/WikimediaIncubator.i18n.php';
+$wgExtensionMessagesFiles['WikimediaIncubatorAlias'] = __DIR__ . 
'/WikimediaIncubator.alias.php';
+$wgExtensionMessagesFiles['WikimediaIncubatorMagic'] = __DIR__ . 
'/WikimediaIncubator.i18n.magic.php';
 
 /* Special:ViewUserLang */
-$wgAutoloadClasses['SpecialViewUserLang'] = $dir . 'SpecialViewUserLang.php';
+$wgAutoloadClasses['SpecialViewUserLang'] = __DIR__ . 
'/SpecialViewUserLang.php';
 $wgSpecialPages['ViewUserLang'] = 'SpecialViewUserLang';
 $wgAvailableRights[] = 'viewuserlang';
 $wgHooks['ContributionsToolLinks'][] = 
'WikimediaIncubator::efLoadViewUserLangLink';
@@ -89,14 +88,14 @@
 $wgGroupPermissions['sysop']['viewuserlang'] = true;
 
 /* TestWiki preference */
-$wgAutoloadClasses['WikimediaIncubator'] = $dir . 
'WikimediaIncubator.class.php';
+$wgAutoloadClasses['WikimediaIncubator'] = __DIR__ . 
'/WikimediaIncubator.class.php';
 $wgHooks['GetPreferences'][] = 'WikimediaIncubator::onGetPreferences';
 $wgHooks['UserGetDefaultOptions'][] = 
'WikimediaIncubator::onUserGetDefaultOptions';
 $wgHooks['MagicWordwgVariableIDs'][] = 'WikimediaIncubator::magicWordVariable';
 $wgHooks['ParserGetVariableValueSwitch'][] = 
'WikimediaIncubator::magicWordValue';
 
 /* Special:MyMainPage (depending on your test wiki preference) */
-$wgAutoloadClasses['SpecialMyMainPage'] = $dir . 'SpecialMyMainPage.php';
+$wgAutoloadClasses['SpecialMyMainPage'] = __DIR__ . '/SpecialMyMainPage.php';
 $wgSpecialPages['MyMainPage'] = 'SpecialMyMainPage';
 
 /* Create/move page permissions */
@@ -105,17 +104,17 @@
 $wgHooks['AbortMove'][] = 'WikimediaIncubator::checkPrefixMovePermissions';
 
 /* Recent Changes */
-$wgAutoloadClasses['TestWikiRC'] = $dir . 'TestWikiRC.php';
+$wgAutoloadClasses['TestWikiRC'] = __DIR__ . '/TestWikiRC.php';
 $wgHooks['SpecialRecentChangesQuery'][] = 'TestWikiRC::onRcQuery';
 $wgHooks['SpecialRecentChangesPanel'][] = 'TestWikiRC::onRcForm';
 
 /* Automatic pref on account creation */
-$wgAutoloadClasses['AutoTestWiki'] = $dir . 'CreateAccountTestWiki.php';
+$wgAutoloadClasses['AutoTestWiki'] = __DIR__ . '/CreateAccountTestWiki.php';
 $wgHooks['UserCreateForm'][] = 'AutoTestWiki::onUserCreateForm';
 $wgHooks['AddNewAccount'][] = 'AutoTestWiki::onAddNewAccount';
 
 /* Random page by test */
-$wgAutoloadClasses['SpecialRandomByTest'] = $dir . 'SpecialRandomByTest.php';
+$wgAutoloadClasses['SpecialRandomByTest'] = __DIR__ . 
'/SpecialRandomByTest.php';
 $wgSpecialPages['RandomByTest'] = 'SpecialRandomByTest';
 
 /* support for automatic checking in a list of databases if a wiki exists */
@@ -135,7 +134,7 @@
 $wmincClosedWikis = false;
 
 /* Wx/xx[x] info page */
-$wgAutoloadClasses['InfoPage'] = $dir . 'InfoPage.php';
+$wgAutoloadClasses['InfoPage'] = __DIR__ . '/InfoPage.php';
 $wgHooks['ShowMissingArticle'][] = 'WikimediaIncubator::onShowMissingArticle';
 $wgHooks['EditFormPreloadText'][] = 
'WikimediaIncubator::onEditFormPreloadText';
 $wgHooks['MediaWikiPerformAction'][] = 
'WikimediaIncubator::onMediaWikiPerformAction';
@@ -145,7 +144,7 @@
 $wgResourceModules['WikimediaIncubator.InfoPage'] = array(
'position' => 'top',
'styles' => 'InfoPage.css',
-   'localBasePath' => dirname(__FILE__),
+   'localBasePath' => __DIR__,
'remoteExtPath' => 'WikimediaIncubator',
 );
 
@@ -156,7 +155,7 @@
 $wgHooks['PageContentLanguage'][] = 
'WikimediaIncubator::onPageContentLanguage';
 
 /* List of users */
-$wgAutoloadClasses['ListUsersTestWiki'] = $dir . 'ListUsersTestWiki.php';
+$wgAutoloadClasses['ListUsersTestWiki'] = __DIR__ . '/ListUsersTestWiki.php';
 $wgHooks['SpecialListusersHeaderForm'][] = 
'ListUsersTestWiki::onSpecialListusersHeaderForm';
 $wgHooks['SpecialListusersQueryInfo'][] = 
'ListUsersTestWiki::onSpecialListusersQueryInfo

[MediaWiki-commits] [Gerrit] Disable WikiGrok in WMF production - change (operations/mediawiki-config)

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

Change subject: Disable WikiGrok in WMF production
..


Disable WikiGrok in WMF production

Also: Remove unneded config vars.

Bug: T98142
Change-Id: Idadfcffeb925ae73b65f55b1e3e74f74a5e1a28b
---
M wmf-config/InitialiseSettings.php
M wmf-config/mobile.php
2 files changed, 0 insertions(+), 14 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  Kaldari: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 9cc33ad..122cc76 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12947,7 +12947,6 @@
'default' => false,
'test2wiki' => true,
'testwiki' => true,
-   'enwiki' => true,
'wikidatawiki' => true,
'testwikidatawiki' => true,
 ),
@@ -13147,13 +13146,11 @@
'default' => false,
'testwiki' => true,
'test2wiki' => true,
-   'enwiki' => true,
 ),
 'wmgWikiGrokUIEnableForAnons' => array(
'default' => false,
'testwiki' => true,
'test2wiki' => true,
-   'enwiki' => true,
 ),
 'wmgWikiGrokUIEnableOnAllDevices' => array(
'default' => false,
@@ -13165,19 +13162,10 @@
'testwiki' => true,
'test2wiki' => true,
 ),
-// Remove this when 1.25wmf18 is gone
-'wmgMFEnableWikiGrok' => array(
-   'default' => false,
-),
-// Remove this when 1.25wmf18 is gone
-'wmgMFEnableWikiGrokForAnons' => array(
-   'default' => false,
-),
 'wmgWikiGrokDebug' => array(
'default' => false,
'testwiki' => true,
'test2wiki' => true,
-   'enwiki' => true,
 ),
 'wmgMFUseWikibaseDescription' => array(
'default' => false,
diff --git a/wmf-config/mobile.php b/wmf-config/mobile.php
index 2dea7fb..32e159f 100644
--- a/wmf-config/mobile.php
+++ b/wmf-config/mobile.php
@@ -10,8 +10,6 @@
$wgMFNearby = $wmgMFNearby && $wmgEnableGeoData;
$wgMFPhotoUploadEndpoint = $wmgMFPhotoUploadEndpoint;
$wgMFUseCentralAuthToken = $wmgMFUseCentralAuthToken;
-   $wgMFEnableWikiGrok = $wmgMFEnableWikiGrok; // Remove this when 
1.25wmf18 is gone
-   $wgMFEnableWikiGrokForAnons = $wmgMFEnableWikiGrokForAnons; // Remove 
this when 1.25wmf18 is gone
$wgMFPhotoUploadWiki = $wmgMFPhotoUploadWiki;
$wgMFContentNamespace = $wmgMFContentNamespace;
$wgMFPhotoUploadAppendToDesc = $wmgMFPhotoUploadAppendToDesc;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idadfcffeb925ae73b65f55b1e3e74f74a5e1a28b
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow 
Gerrit-Reviewer: Kaldari 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Phuedx 
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 a script to disable Puppet temporarily - change (operations/puppet)

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

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

Change subject: Add a script to disable Puppet temporarily
..

Add a script to disable Puppet temporarily

I am surely not alone in occasionally leaving Puppet disabled for longer than I
had intended. This script provides a means of disabling Puppet temporarily. It
does so by creating a detached screen session which sleeps for the desired
amount of time and then re-enables Puppet. It also leaves a better paper trail
by setting a default reason which includes the name of the user disabling
Puppet and the time it was disabled.

Usage: puppet-disable [DURATION] [REASON]

DURATION - Disable Puppet for this much time. Defaults to 1h.
REASON   - Reason for disabling Puppet. Defaults to a generic message.

Examples:

Disable Puppet for a day, no reason given:
$ puppet-disable 1d

Disable Puppet for 30 minutes, with reason:
$ puppet-disable 30m "experimenting with HHVM config"

Change-Id: I3f89fd339aacac862903974a149b6493cfefb8c9
---
A modules/base/files/puppet/puppet-disable
M modules/base/manifests/puppet.pp
2 files changed, 65 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/75/212475/1

diff --git a/modules/base/files/puppet/puppet-disable 
b/modules/base/files/puppet/puppet-disable
new file mode 100755
index 000..0cd882c
--- /dev/null
+++ b/modules/base/files/puppet/puppet-disable
@@ -0,0 +1,58 @@
+#!/bin/bash
+# -*- coding: utf-8 -*-
+#
+# puppet-disable - disable Puppet temporarily.
+#
+# Usage: puppet-disable [DURATION] [REASON]
+#
+#   DURATION - Disable Puppet for this much time. Defaults to 1h.
+#   REASON   - Reason for disabling Puppet. Defaults to a generic
+#  message.
+#
+# Examples:
+#
+#   Disable Puppet for a day, no reason given:
+#   $ puppet-disable 1d
+#
+#   Disable Puppet for 30 minutes, with reason:
+#   $ puppet-disable 30m "experimenting with HHVM config"
+#
+# 
+case "$1" in
+  [0-9]*)
+DURATION="$1"
+shift
+;;
+  -h|--help)
+SCRIPT="$(basename "$0")"
+echo >&2 "${SCRIPT} - disable Puppet temporarily. "
+echo >&2
+echo >&2 "Usage: ${SCRIPT} [DURATION] [REASON]"
+echo >&2
+echo >&2 "  DURATION - Disable Puppet for this much time. Defaults to 1h. "
+echo >&2 "  REASON   - Reason for disabling Puppet. Defaults to a generic "
+echo >&2 " message.   "
+echo >&2
+echo >&2 "Examples:   "
+echo >&2
+echo >&2 "  Disable Puppet for a day, no reason given:"
+echo >&2 "  $ ${SCRIPT} 1d"
+echo >&2 ""
+echo >&2 "  Disable Puppet for 30 minutes, with reason:   "
+echo >&2 "  $ ${SCRIPT} 30m \"experimenting with HHVM config\""
+echo >&2
+exit 0
+;;
+esac
+
+test -f /var/lib/puppet/state/agent_disabled.lock && {
+  echo >&2 "puppet agent is already disabled!"
+  exit 1
+}
+
+TIMESTAMP="$(/bin/date --rfc-3339=seconds --utc)"
+DURATION="${DURATION:-1h}"
+REASON="${*:-Disabled by ${USER} for ${DURATION} at ${TIMESTAMP}}"
+echo "Disabling Puppet for ${DURATION} with reason: \"${REASON}\"."
+/usr/bin/sudo /usr/bin/puppet agent --verbose --disable "$REASON"
+/usr/bin/screen -d -m /usr/bin/sudo -n /bin/bash -c "/bin/sleep $DURATION ; 
/usr/bin/puppet agent --enable"
diff --git a/modules/base/manifests/puppet.pp b/modules/base/manifests/puppet.pp
index 9889f69..352bdc3 100644
--- a/modules/base/manifests/puppet.pp
+++ b/modules/base/manifests/puppet.pp
@@ -79,6 +79,13 @@
 source  => 'puppet:///modules/base/puppet/puppet-run',
 }
 
+file { '/usr/local/sbin/puppet-disable':
+source  => 'puppet:///modules/base/puppet/puppet-run',
+mode=> '0555',
+owner   => 'root',
+group   => 'root',
+}
+
 file { '/etc/cron.d/puppet':
 mode=> '0444',
 owner   => 'root',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f89fd339aacac862903974a149b6493cfefb8c9
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Fix doc and public should be infront of static - change (mediawiki...WikimediaIncubator)

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

Change subject: Fix doc and public should be infront of static
..


Fix doc and public should be infront of static

Change-Id: Ica53b8dc66904b684b8737c95793d7e02dc5d2e1
---
M InfoPage.php
M WikimediaIncubator.class.php
2 files changed, 13 insertions(+), 13 deletions(-)

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



diff --git a/InfoPage.php b/InfoPage.php
index b6e345d..9b154bd 100644
--- a/InfoPage.php
+++ b/InfoPage.php
@@ -1,18 +1,18 @@
 https://gerrit.wikimedia.org/r/212330
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ica53b8dc66904b684b8737c95793d7e02dc5d2e1
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/WikimediaIncubator
Gerrit-Branch: master
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: Umherirrender 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Flush lazy jobs in load.php and api.php too - change (mediawiki/core)

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

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

Change subject: Flush lazy jobs in load.php and api.php too
..

Flush lazy jobs in load.php and api.php too

* A more proper solution will have one method for all this stuff

Bug: T99775
Bug: T99849
Change-Id: I16a32b260386a85504eb85ea58f1156b4e581a83
---
M api.php
M load.php
2 files changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/212473/1

diff --git a/api.php b/api.php
index 7775158..9721c4f 100644
--- a/api.php
+++ b/api.php
@@ -94,6 +94,8 @@
fastcgi_finish_request();
 }
 
+JobQueueGroup::pushLazyJobs();
+
 // Execute any deferred updates
 DeferredUpdates::doUpdates();
 
diff --git a/load.php b/load.php
index ef2df31..d77a689 100644
--- a/load.php
+++ b/load.php
@@ -43,6 +43,8 @@
 $resourceLoader = new ResourceLoader( $configFactory->makeConfig( 'main' ) );
 $resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, 
$wgRequest ) );
 
+JobQueueGroup::pushLazyJobs();
+
 Profiler::instance()->setTemplated( true );
 wfLogProfilingData();
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16a32b260386a85504eb85ea58f1156b4e581a83
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] [roundtrip-test] Improve handling of newline-only diff scena... - change (mediawiki...parsoid)

2015-05-20 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review.

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

Change subject: [roundtrip-test] Improve handling of newline-only diff scenarios
..

[roundtrip-test] Improve handling of newline-only diff scenarios

* Expand HTML context for newline only diffs to handle some
  scenarios where the diff context might otherwise straddle a
  template boundary only in one of old/new wikitext.

* Eliminates spurious semantic diff reports for newline only
  diff on eswiki:Distrito_17

Change-Id: I18e1388f8bc1a9077fb3570382324011974cbc54
---
M tests/roundtrip-test.js
1 file changed, 34 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/74/212474/1

diff --git a/tests/roundtrip-test.js b/tests/roundtrip-test.js
index 6f8eca2..7481d42 100755
--- a/tests/roundtrip-test.js
+++ b/tests/roundtrip-test.js
@@ -281,7 +281,12 @@
return elts;
 };
 
-var getMatchingHTML = function(env, body, offsetRange) {
+var getMatchingHTML = function(env, body, offsetRange, numNLs) {
+   // Expand the HTML context by (1 char before/after the newline diff)
+   if (numNLs !== null) {
+   offsetRange = [offsetRange[0] - (numNLs+1), offsetRange[0] + 
(numNLs+1)];
+   }
+
var html = '';
var out = findMatchingNodes(env, body, offsetRange);
for (var i = 0; i < out.length; i++) {
@@ -289,8 +294,14 @@
html += DU.serializeNode(out[i], { smartQuote: false }).str;
}
html = DU.formatHTML(DU.normalizeOut(html));
-   // Normalize away 's added by Parsoid because of newlines in 
wikitext
-   return html.replace(/\s*\s*/g, '').replace(/<\/p>/g, 
'').replace(/(^\s+|\s+$)/g, '');
+
+   if (numNLs !== null) {
+   // This is a newline-only diff.
+   // Normalize away 's added by Parsoid because of newlines 
in wikitext.
+   return html.replace(/\s*\s*/g, 
'').replace(/<\/p>/g, '').replace(/(^\s+|\s+$)/g, '');
+   } else {
+   return html;
+   }
 };
 
 var normalizeWikitext = function(str) {
@@ -376,9 +387,27 @@
thisResult.type = 'skip';
thisResult.wtDiff = formatDiff(oldWt, newWt, offset, 0);
 
+   // Is this a newline separator diff?
+   //
+   // Count # of newlines in old/new wikitext and use that
+   // to fetch slighly expanded HTML context.
+   //
+   // This helps with  scenarios where the diff context straddles
+   // a template boundary where in one case, the HTML context
+   // includes the template content and in the other doesn't.
+   //
+   // This happens because our P-wrapping code occasionally
+   // swallows newlines into template context.
+   // See https://phabricator.wikimedia.org/T89628
+   var oldStr = oldWt.substring(offset[0].start, offset[0].end);
+   var newStr = newWt.substring(offset[1].start, offset[1].end);
+   var wsOnly = /^\s*$/.test(oldStr) && /^\s*$/.test(newStr);
+   var oldNLs = wsOnly ? oldStr.split(/\n/).length - 1 : null;
+   var newNLs = wsOnly ? newStr.split(/\n/).length - 1 : null;
+
// Check if this is really a semantic diff
-   var oldHTML = getMatchingHTML(env, oldBody, offset[0]);
-   var newHTML = getMatchingHTML(env, newBody, offset[1]);
+   var oldHTML = getMatchingHTML(env, oldBody, offset[0], oldNLs);
+   var newHTML = getMatchingHTML(env, newBody, offset[1], newNLs);
var diff = Diff.htmlDiff(oldHTML, newHTML, false, true, true);
if (diff.length > 0) {
// Normalize wts to check if we really have a semantic 
diff

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I18e1388f8bc1a9077fb3570382324011974cbc54
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry 

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


[MediaWiki-commits] [Gerrit] Update SyntaxHighlight_GeSHi to 1.26wmf7 HEAD - change (mediawiki/core)

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

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

Change subject: Update SyntaxHighlight_GeSHi to 1.26wmf7 HEAD
..

Update SyntaxHighlight_GeSHi to 1.26wmf7 HEAD

Change-Id: Ie930fa62819b9a0b9468902c3d21624cd0514e9e
---
M extensions/SyntaxHighlight_GeSHi
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/71/212471/1

diff --git a/extensions/SyntaxHighlight_GeSHi b/extensions/SyntaxHighlight_GeSHi
index 58860a0..400714d 16
--- a/extensions/SyntaxHighlight_GeSHi
+++ b/extensions/SyntaxHighlight_GeSHi
-Subproject commit 58860a0b0c5f7e093b2326e18f707a72ee88c2a4
+Subproject commit 400714d8b26e9150b33a38810970eb1205362c95

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie930fa62819b9a0b9468902c3d21624cd0514e9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] Revert "Revert "Add extension.json, empty PHP entry point"" - change (mediawiki...SyntaxHighlight_GeSHi)

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

Change subject: Revert "Revert "Add extension.json, empty PHP entry point""
..


Revert "Revert "Add extension.json, empty PHP entry point""

Try #2. Our last attempt loaded $wgGeSHiSupportedLanguages late, and
would override anything if it was already set. We still load it late, but
only if it is not already set.

This reverts commit 033ca20746432d34ae52540b169a78e070c5ea9b.

Bug: T88063
Change-Id: Iae0806e06a95b2d8932b3d9e078e6135dd6750a3
(cherry picked from commit b4853c7633f0cd9aa5c37653c6d3698cfa12384b)
---
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.langs.php
M SyntaxHighlight_GeSHi.php
A extension.json
M maintenance/updateLanguageList.php
5 files changed, 134 insertions(+), 118 deletions(-)

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



diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index ddaea80..c4f0d0c 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -30,6 +30,37 @@
private static $languages = null;
 
/**
+* Executed after processing extension.json
+* @todo we should figure out how to make this a real config setting.
+*/
+   public static function registerExtension() {
+   global $wgVersion;
+   if ( version_compare( $wgVersion, '1.25', '<' ) ) {
+   die( 'This version of SyntaxHighlight GeSHi requires 
MediaWiki 1.25' );
+   }
+
+   global $wgGeSHiSupportedLanguages;
+   if ( !$wgGeSHiSupportedLanguages ) {
+   // If not set already, load it (@see 
ExtensionRegistry::exportExtractedData)
+   require_once __DIR__ . 
'/SyntaxHighlight_GeSHi.langs.php';
+   }
+   // @fixme we shouldn't be loading this on every request
+   require_once __DIR__ . '/geshi/geshi.php';
+   }
+
+   /**
+* Register parser hook
+*
+* @param $parser Parser
+* @return bool
+*/
+   public static function configureParser( &$parser ) {
+   $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 
'parserHook' ) );
+   $parser->setHook( 'syntaxhighlight', array( 
'SyntaxHighlight_GeSHi', 'parserHook' ) );
+   return true;
+   }
+
+   /**
 * Parser hook
 *
 * @param string $text
@@ -45,7 +76,7 @@
$text = preg_replace( '/^\n+/', '', $text );
 
// Validate language
-   if( isset( $args['lang'] ) && $args['lang'] ) {
+   if ( isset( $args['lang'] ) && $args['lang'] ) {
$lang = $args['lang'];
} else {
// language is not specified. Check if default exists, 
if yes, use it.
@@ -57,12 +88,12 @@
}
}
$lang = strtolower( $lang );
-   if( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
+   if ( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
$error = self::formatLanguageError( $text );
return $error;
}
$geshi = self::prepare( $text, $lang );
-   if( !$geshi instanceof GeSHi ) {
+   if ( !$geshi instanceof GeSHi ) {
$error = self::formatLanguageError( $text );
return $error;
}
@@ -70,23 +101,23 @@
$enclose = self::getEncloseType( $args );
 
// Line numbers
-   if( isset( $args['line'] ) ) {
+   if ( isset( $args['line'] ) ) {
$geshi->enable_line_numbers( GESHI_FANCY_LINE_NUMBERS );
}
// Highlighting specific lines
-   if( isset( $args['highlight'] ) ) {
+   if ( isset( $args['highlight'] ) ) {
$lines = self::parseHighlightLines( $args['highlight'] 
);
if ( count( $lines ) ) {
$geshi->highlight_lines_extra( $lines );
}
}
// Starting line number
-   if( isset( $args['start'] ) ) {
+   if ( isset( $args['start'] ) ) {
$geshi->start_line_numbers_at( $args['start'] );
}
$geshi->set_header_type( $enclose );
// Strict mode
-   if( isset( $args['strict'] ) ) {
+   if ( isset( $args['strict'] ) ) {
$geshi->enable_strict_mode();
}
// Format
@@ -97,19 +128,19 @@
return $error;
}
$err = $geshi->error();
-   if( $err ) {
+   if ( $e

[MediaWiki-commits] [Gerrit] Revert "Revert "Add extension.json, empty PHP entry point"" - change (mediawiki...SyntaxHighlight_GeSHi)

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

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

Change subject: Revert "Revert "Add extension.json, empty PHP entry point""
..

Revert "Revert "Add extension.json, empty PHP entry point""

Try #2. Our last attempt loaded $wgGeSHiSupportedLanguages late, and
would override anything if it was already set. We still load it late, but
only if it is not already set.

This reverts commit 033ca20746432d34ae52540b169a78e070c5ea9b.

Bug: T88063
Change-Id: Iae0806e06a95b2d8932b3d9e078e6135dd6750a3
(cherry picked from commit b4853c7633f0cd9aa5c37653c6d3698cfa12384b)
---
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.langs.php
M SyntaxHighlight_GeSHi.php
A extension.json
M maintenance/updateLanguageList.php
5 files changed, 134 insertions(+), 118 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/70/212470/1

diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index ddaea80..c4f0d0c 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -30,6 +30,37 @@
private static $languages = null;
 
/**
+* Executed after processing extension.json
+* @todo we should figure out how to make this a real config setting.
+*/
+   public static function registerExtension() {
+   global $wgVersion;
+   if ( version_compare( $wgVersion, '1.25', '<' ) ) {
+   die( 'This version of SyntaxHighlight GeSHi requires 
MediaWiki 1.25' );
+   }
+
+   global $wgGeSHiSupportedLanguages;
+   if ( !$wgGeSHiSupportedLanguages ) {
+   // If not set already, load it (@see 
ExtensionRegistry::exportExtractedData)
+   require_once __DIR__ . 
'/SyntaxHighlight_GeSHi.langs.php';
+   }
+   // @fixme we shouldn't be loading this on every request
+   require_once __DIR__ . '/geshi/geshi.php';
+   }
+
+   /**
+* Register parser hook
+*
+* @param $parser Parser
+* @return bool
+*/
+   public static function configureParser( &$parser ) {
+   $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 
'parserHook' ) );
+   $parser->setHook( 'syntaxhighlight', array( 
'SyntaxHighlight_GeSHi', 'parserHook' ) );
+   return true;
+   }
+
+   /**
 * Parser hook
 *
 * @param string $text
@@ -45,7 +76,7 @@
$text = preg_replace( '/^\n+/', '', $text );
 
// Validate language
-   if( isset( $args['lang'] ) && $args['lang'] ) {
+   if ( isset( $args['lang'] ) && $args['lang'] ) {
$lang = $args['lang'];
} else {
// language is not specified. Check if default exists, 
if yes, use it.
@@ -57,12 +88,12 @@
}
}
$lang = strtolower( $lang );
-   if( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
+   if ( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
$error = self::formatLanguageError( $text );
return $error;
}
$geshi = self::prepare( $text, $lang );
-   if( !$geshi instanceof GeSHi ) {
+   if ( !$geshi instanceof GeSHi ) {
$error = self::formatLanguageError( $text );
return $error;
}
@@ -70,23 +101,23 @@
$enclose = self::getEncloseType( $args );
 
// Line numbers
-   if( isset( $args['line'] ) ) {
+   if ( isset( $args['line'] ) ) {
$geshi->enable_line_numbers( GESHI_FANCY_LINE_NUMBERS );
}
// Highlighting specific lines
-   if( isset( $args['highlight'] ) ) {
+   if ( isset( $args['highlight'] ) ) {
$lines = self::parseHighlightLines( $args['highlight'] 
);
if ( count( $lines ) ) {
$geshi->highlight_lines_extra( $lines );
}
}
// Starting line number
-   if( isset( $args['start'] ) ) {
+   if ( isset( $args['start'] ) ) {
$geshi->start_line_numbers_at( $args['start'] );
}
$geshi->set_header_type( $enclose );
// Strict mode
-   if( isset( $args['strict'] ) ) {
+   if ( isset( $args['strict'] ) ) {
$geshi->enable_strict_mode();
}
// Format
@@ -97,19 +128,19 @@
return $error;
}
$err = 

[MediaWiki-commits] [Gerrit] Remove lonely reNamespace from page.py - change (pywikibot/core)

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

Change subject: Remove lonely reNamespace from page.py
..


Remove lonely reNamespace from page.py

Only occurrence of this variable in the library.

$ git grep reNamespace
pywikibot/page.py:68:reNamespace = re.compile("^(.+?) *: *(.*)$")

Change-Id: Ifee61a713b9b1fadc54607167b4f8655781e4749
---
M pywikibot/page.py
1 file changed, 0 insertions(+), 3 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  Ricordisamoa: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/pywikibot/page.py b/pywikibot/page.py
index 587e991..3f9c93a 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -64,9 +64,6 @@
 
 logger = logging.getLogger("pywiki.wiki.page")
 
-# Pre-compile re expressions
-reNamespace = re.compile("^(.+?) *: *(.*)$")
-
 
 # Note: Link objects (defined later on) represent a wiki-page's title, while
 # Page objects (defined here) represent the page itself, including its 
contents.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifee61a713b9b1fadc54607167b4f8655781e4749
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: Merlijn van Deen 
Gerrit-Reviewer: Ricordisamoa 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] [roundtrip-test] Convert \r to \n while diffing - change (mediawiki...parsoid)

2015-05-20 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review.

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

Change subject: [roundtrip-test] Convert \r to \n while diffing
..

[roundtrip-test] Convert \r to \n while diffing

* Eliminates useless whitespace only diffs without other hacks
  in the roundtrip testing diff classification code.

Change-Id: Iaef1455532efa82b0f7e9b6127ddcb513a22d4d3
---
M lib/mediawiki.Diff.js
1 file changed, 1 insertion(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/69/212469/1

diff --git a/lib/mediawiki.Diff.js b/lib/mediawiki.Diff.js
index 81d1434..1b5eb87 100644
--- a/lib/mediawiki.Diff.js
+++ b/lib/mediawiki.Diff.js
@@ -225,14 +225,7 @@
var retLines = [];
var lines = value.split(/^/m);
for (var i = 0; i < lines.length; i++) {
-   var line = lines[i];
-   var lastLine = lines[i - 1];
-   // Merge lines that may contain windows new lines
-   if (line === '\n' && lastLine && 
lastLine[lastLine.length - 1] === '\r') {
-   retLines[retLines.length - 1] += '\n';
-   } else if (line) {
-   retLines.push(line);
-   }
+   retLines.push(lines[i].replace(/\r/g, '\n'));
}
return retLines;
};

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaef1455532efa82b0f7e9b6127ddcb513a22d4d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry 

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


[MediaWiki-commits] [Gerrit] Made MessageCache::replace() ignore messages with content la... - change (mediawiki/core)

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

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

Change subject: Made MessageCache::replace() ignore messages with content 
language suffixes
..

Made MessageCache::replace() ignore messages with content language suffixes

* This should not be used, and load() does not see them

Change-Id: Ie4b6b356bd309814dd4a88040a29a7ebd509712a
---
M includes/cache/MessageCache.php
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/68/212468/1

diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index 31ee487..d5c97a1 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -514,14 +514,17 @@
 * @param mixed $text New contents of the page.
 */
public function replace( $title, $text ) {
-   global $wgMaxMsgCacheEntrySize;
+   global $wgMaxMsgCacheEntrySize, $wgLanguageCode;
 
if ( $this->mDisable ) {
-
return;
}
 
list( $msg, $code ) = $this->figureMessage( $title );
+   if ( strpos( $title, '/' ) !== false && $code === 
$wgLanguageCode ) {
+   # Content language overrides do not use the / 
suffix
+   return;
+   }
 
$cacheKey = wfMemcKey( 'messages', $code );
$this->load( $code );
@@ -1087,6 +1090,7 @@
 */
public function figureMessage( $key ) {
global $wgLanguageCode;
+
$pieces = explode( '/', $key );
if ( count( $pieces ) < 2 ) {
return array( $key, $wgLanguageCode );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4b6b356bd309814dd4a88040a29a7ebd509712a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] Update style and remove caching on wikimetrics api - change (analytics/dashiki)

2015-05-20 Thread Milimetric (Code Review)
Milimetric has uploaded a new change for review.

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

Change subject: Update style and remove caching on wikimetrics api
..

Update style and remove caching on wikimetrics api

Change-Id: I78af1ee817ece3677d0030e1a1a0835fb11d3315
---
M src/app/apis/wikimetrics.js
M test/app/apis.js
2 files changed, 19 insertions(+), 44 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/dashiki 
refs/changes/67/212467/1

diff --git a/src/app/apis/wikimetrics.js b/src/app/apis/wikimetrics.js
index 152a637..57b59b4 100644
--- a/src/app/apis/wikimetrics.js
+++ b/src/app/apis/wikimetrics.js
@@ -2,8 +2,15 @@
  * This module returns an instance of an object that knows how to get
  * reports run by WikimetricsBot on wikimetrics.  Methods commented inline
  */
-define(['config', 'dataConverterFactory', 'uri/URI', 'uri/URITemplate', 
'logger'], function (siteConfig, dataConverterFactory, uri) {
+define(function (require) {
 'use strict';
+
+var siteConfig = require('config'),
+dataConverterFactory = require('dataConverterFactory'),
+uri = require('uri/URI');
+
+require('uri/URITemplate');
+require('logger');
 
 function WikimetricsApi(config) {
 this.root = config.wikimetricsApi.endpoint;
@@ -12,12 +19,6 @@
 // in the context of the metric
 this.dataConverter = 
dataConverterFactory.getDataConverter(config.wikimetricsApi.format);
 }
-
-// only fetch certain things once per app life and keep their promise
-var promiseDefaults,
-promiseMetrics,
-promiseLanguagesAndProjects;
-
 
 function ProjectOption(data, prettyNames) {
 // no need for these to be observables as they are fixed values
@@ -60,15 +61,14 @@
 
 this._getJSON(address)
 .done(function (data) {
-var converter = this.getDataConverter(),
-submetrics = {};
+var submetrics = {};
 
 submetrics[metric.name] = metric.submetric || 
metric.defaultSubmetric;
 var opt = {
 defaultSubmetrics: submetrics
 };
 
-deferred.resolve(converter(opt, data));
+deferred.resolve(this.dataConverter(opt, data));
 }.bind(this))
 .fail(function (error) {
 // resolve as done with empty results and log the error
@@ -86,13 +86,10 @@
  **/
 WikimetricsApi.prototype.getProjectAndLanguageChoices = function 
(callback) {
 
-if (!promiseLanguagesAndProjects) {
-var url = this.config.wikimetricsApi.urlProjectLanguageChoices;
-promiseLanguagesAndProjects = this._getJSON(url)
-.pipe(this._convertJSON.bind(this));
-}
-
-return promiseLanguagesAndProjects.done(callback);
+var url = this.config.wikimetricsApi.urlProjectLanguageChoices;
+return this._getJSON(url)
+.pipe(this._convertSiteMap.bind(this))
+.done(callback);
 };
 
 /**
@@ -106,7 +103,7 @@
 });
 };
 
-WikimetricsApi.prototype._convertJSON = function (json) {
+WikimetricsApi.prototype._convertSiteMap = function (json) {
 var map = Array.prototype.map;
 var self = this,
 databases = Object.getOwnPropertyNames(json.reverse),
@@ -143,10 +140,6 @@
 });
 
 return self;
-};
-
-WikimetricsApi.prototype.getDataConverter = function () {
-return this.dataConverter;
 };
 
 return new WikimetricsApi(siteConfig);
diff --git a/test/app/apis.js b/test/app/apis.js
index 6391362..6d5eec7 100644
--- a/test/app/apis.js
+++ b/test/app/apis.js
@@ -9,22 +9,23 @@
 $ = require('jquery');
 
 describe('Wikimetrics API', function () {
+var converter;
 
 beforeEach(function () {
 sinon.stub($, 'ajax');
+converter = wikimetrics.dataConverter;
+wikimetrics.dataConverter = function () {return;};
 });
 
 afterEach(function () {
 $.ajax.restore();
+wikimetrics.dataConverter = converter;
 });
 
 it('should fetch the correct URL', function () {
 var deferred = new $.Deferred();
 deferred.resolveWith(null, ['not important']);
 $.ajax.returns(deferred);
-
-sinon.stub(wikimetrics, 'getDataConverter')
-.returns(function () {return;});
 
 wikimetrics.root = 'something';
 var expected = 
'https://something/static/public/datafiles/metric/project.json';
@@ -33,8 +34,6 @@
 };
 wikimetrics.getData(metric, 'project');
 expect($.ajax.getCalls()[0].args[0].url).toBe(expected);
-
-wikimetrics.getDataConverter.restore();
 });
 
 it('should return empty list if getting data fails', function (done) {
@@ -47,23

[MediaWiki-commits] [Gerrit] Notify of problems before filemtime, not after - change (mediawiki/core)

2015-05-20 Thread MarkAHershberger (Code Review)
MarkAHershberger has uploaded a new change for review.

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

Change subject: Notify of problems before filemtime, not after
..

Notify of problems before filemtime, not after

Without this several lines of warning are emitted before the final error 
indicating the cause.

Bug: T99846
Change-Id: Ic1b9d9a80ed995273c56c447c8b044285a8843a7
---
M includes/registration/ExtensionRegistry.php
1 file changed, 12 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/66/212466/1

diff --git a/includes/registration/ExtensionRegistry.php 
b/includes/registration/ExtensionRegistry.php
index 4cad259..de73396 100644
--- a/includes/registration/ExtensionRegistry.php
+++ b/includes/registration/ExtensionRegistry.php
@@ -70,10 +70,18 @@
 */
public function queue( $path ) {
global $wgExtensionInfoMTime;
-   if ( $wgExtensionInfoMTime !== false ) {
-   $mtime = $wgExtensionInfoMTime;
-   } else {
-   $mtime = filemtime( $path );
+
+   $mtime = $wgExtensionInfoMTime;
+   if ( $mtime === false ) {
+   if ( file_exists( $path ) ) {
+   $mtime = filemtime( $path );
+   } else {
+   throw new Exception( "$path does not exist!" );
+   }
+   if ( !$mtime ) {
+   $err = error_get_last();
+   throw new Exception( "Error reading $path: 
{$err['message']}" );
+   }
}
$this->queued[$path] = $mtime;
}

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

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

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


[MediaWiki-commits] [Gerrit] Revert "Add storage cfg for cp1099 T96873" - change (operations/puppet)

2015-05-20 Thread BBlack (Code Review)
BBlack has submitted this change and it was merged.

Change subject: Revert "Add storage cfg for cp1099 T96873"
..


Revert "Add storage cfg for cp1099 T96873"

cmjohnson put normal 400G disks back into this machine...

This reverts commit 03a4ed1f875d9484bb4de3047080e83e86ceb34c.

Change-Id: Ib0d00246575d823a56a863122bc07723fe7c44e3
---
M modules/role/manifests/cache/2layer.pp
1 file changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/modules/role/manifests/cache/2layer.pp 
b/modules/role/manifests/cache/2layer.pp
index 05d4d57..1ed75d4 100644
--- a/modules/role/manifests/cache/2layer.pp
+++ b/modules/role/manifests/cache/2layer.pp
@@ -23,7 +23,6 @@
 
 $storage_size = $::hostname ? {
 /^cp10(08|4[34])$/  => 117, # Intel X-25M 160G
-/^cp1099$/  => 720, # Intel S3700 800G (one-off)
 /^cp30(0[3-9]|1[0-4])$/ => 460, # Intel M320 600G via H710
 /^cp301[5-8]$/  => 225, # Intel M320 300G via H710
 /^cp[0-9]{4}$/  => 360, # Intel S3700 400G (prod default)
@@ -35,7 +34,6 @@
 # common/current case of 360G storage size on Intel S3700's.
 $backend_scaled_weights = [
 { backend_match => '^cp10(08|4[34])\.',  weight => 32  },
-{ backend_match => '^cp1099\.',  weight => 200 },
 { backend_match => '^cp30(0[3-9]|1[0-4])\.', weight => 128 },
 { backend_match => '^cp301[5-8]\.',  weight => 63  },
 { backend_match => '.',  weight => 100 },

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib0d00246575d823a56a863122bc07723fe7c44e3
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack 
Gerrit-Reviewer: BBlack 
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 "Add storage cfg for cp1099 T96873" - change (operations/puppet)

2015-05-20 Thread BBlack (Code Review)
BBlack has uploaded a new change for review.

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

Change subject: Revert "Add storage cfg for cp1099 T96873"
..

Revert "Add storage cfg for cp1099 T96873"

cmjohnson put normal 400G disks back into this machine...

This reverts commit 03a4ed1f875d9484bb4de3047080e83e86ceb34c.

Change-Id: Ib0d00246575d823a56a863122bc07723fe7c44e3
---
M modules/role/manifests/cache/2layer.pp
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/65/212465/1

diff --git a/modules/role/manifests/cache/2layer.pp 
b/modules/role/manifests/cache/2layer.pp
index 05d4d57..1ed75d4 100644
--- a/modules/role/manifests/cache/2layer.pp
+++ b/modules/role/manifests/cache/2layer.pp
@@ -23,7 +23,6 @@
 
 $storage_size = $::hostname ? {
 /^cp10(08|4[34])$/  => 117, # Intel X-25M 160G
-/^cp1099$/  => 720, # Intel S3700 800G (one-off)
 /^cp30(0[3-9]|1[0-4])$/ => 460, # Intel M320 600G via H710
 /^cp301[5-8]$/  => 225, # Intel M320 300G via H710
 /^cp[0-9]{4}$/  => 360, # Intel S3700 400G (prod default)
@@ -35,7 +34,6 @@
 # common/current case of 360G storage size on Intel S3700's.
 $backend_scaled_weights = [
 { backend_match => '^cp10(08|4[34])\.',  weight => 32  },
-{ backend_match => '^cp1099\.',  weight => 200 },
 { backend_match => '^cp30(0[3-9]|1[0-4])\.', weight => 128 },
 { backend_match => '^cp301[5-8]\.',  weight => 63  },
 { backend_match => '.',  weight => 100 },

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

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

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


[MediaWiki-commits] [Gerrit] wmflib: Move ipresolve function into wmflib - change (operations/puppet)

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

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

Change subject: wmflib: Move ipresolve function into wmflib
..

wmflib: Move ipresolve function into wmflib

Bug: T99833
Change-Id: I3a9af69b73cb10ab90d6030457964159cfc33d7d
---
R modules/wmflib/lib/puppet/parser/functions/ipresolve.rb
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/64/212464/1

diff --git a/modules/strongswan/lib/puppet/parser/functions/ipresolve.rb 
b/modules/wmflib/lib/puppet/parser/functions/ipresolve.rb
similarity index 100%
rename from modules/strongswan/lib/puppet/parser/functions/ipresolve.rb
rename to modules/wmflib/lib/puppet/parser/functions/ipresolve.rb

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

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

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


[MediaWiki-commits] [Gerrit] Remove lonely reNamespace from page.py - change (pywikibot/core)

2015-05-20 Thread Mpaa (Code Review)
Mpaa has uploaded a new change for review.

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

Change subject: Remove lonely reNamespace from page.py
..

Remove lonely reNamespace from page.py

Only occurrence of this variable in the library.

$ git grep reNamespace
pywikibot/page.py:68:reNamespace = re.compile("^(.+?) *: *(.*)$")

Change-Id: Ifee61a713b9b1fadc54607167b4f8655781e4749
---
M pywikibot/page.py
1 file changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/63/212463/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 587e991..3f9c93a 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -64,9 +64,6 @@
 
 logger = logging.getLogger("pywiki.wiki.page")
 
-# Pre-compile re expressions
-reNamespace = re.compile("^(.+?) *: *(.*)$")
-
 
 # Note: Link objects (defined later on) represent a wiki-page's title, while
 # Page objects (defined here) represent the page itself, including its 
contents.

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

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

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


[MediaWiki-commits] [Gerrit] Remove "More information" from image gallery menu - change (apps...wikipedia)

2015-05-20 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

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

Change subject: Remove "More information" from image gallery menu
..

Remove "More information" from image gallery menu

Bug: T86810
Change-Id: Ida441e494cf11bcd7ba8155256011edb54e6fdd6
---
D wikipedia/res/layout/dialog_gallery_details.xml
D wikipedia/res/layout/item_gallery_details.xml
M wikipedia/res/menu/menu_gallery.xml
D wikipedia/src/main/java/org/wikipedia/page/gallery/DetailsDialog.java
M wikipedia/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java
M wikipedia/src/main/java/org/wikipedia/page/gallery/GalleryItemFragment.java
6 files changed, 1 insertion(+), 192 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/62/212462/1

diff --git a/wikipedia/res/layout/dialog_gallery_details.xml 
b/wikipedia/res/layout/dialog_gallery_details.xml
deleted file mode 100644
index 347e11a..000
--- a/wikipedia/res/layout/dialog_gallery_details.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-http://schemas.android.com/apk/res/android";
-android:layout_width="match_parent"
-android:layout_height="wrap_content"
-android:orientation="vertical"
-android:background="@color/nav_background">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/wikipedia/res/layout/item_gallery_details.xml 
b/wikipedia/res/layout/item_gallery_details.xml
deleted file mode 100644
index ae0d3a7..000
--- a/wikipedia/res/layout/item_gallery_details.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-http://schemas.android.com/apk/res/android";
-xmlns:tools="http://schemas.android.com/tools";
-android:layout_width="match_parent"
-android:layout_height="wrap_content"
-android:orientation="vertical"
-android:paddingBottom="8dp"
-android:paddingLeft="@dimen/activity_horizontal_margin"
-android:paddingRight="@dimen/activity_horizontal_margin"
-android:paddingTop="8dp">
-
-
-
diff --git a/wikipedia/res/menu/menu_gallery.xml 
b/wikipedia/res/menu/menu_gallery.xml
index 2d91141..f324624 100644
--- a/wikipedia/res/menu/menu_gallery.xml
+++ b/wikipedia/res/menu/menu_gallery.xml
@@ -7,9 +7,6 @@
 android:title="@string/gallery_menu_share"
 android:icon="@drawable/ic_share_dark"
 app:showAsAction="ifRoom"/>
-
 
diff --git 
a/wikipedia/src/main/java/org/wikipedia/page/gallery/DetailsDialog.java 
b/wikipedia/src/main/java/org/wikipedia/page/gallery/DetailsDialog.java
deleted file mode 100644
index ad059c9..000
--- a/wikipedia/src/main/java/org/wikipedia/page/gallery/DetailsDialog.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.wikipedia.page.gallery;
-
-import android.content.Context;
-import android.text.Html;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.FrameLayout;
-import android.widget.ListView;
-import android.widget.TextView;
-import org.wikipedia.R;
-import org.wikipedia.Utils;
-import org.wikipedia.page.BottomDialog;
-import org.wikipedia.page.LinkMovementMethodExt;
-
-public class DetailsDialog extends BottomDialog {
-private GalleryItem item;
-private LinkMovementMethodExt linkMovementMethod;
-
-public DetailsDialog(Context context, GalleryItem item, 
LinkMovementMethodExt linkMovementMethod, int height) {
-super(context, R.layout.dialog_gallery_details);
-this.item = item;
-this.linkMovementMethod = linkMovementMethod;
-
-View parentView = getDialogLayout();
-View closeButton = parentView.findViewById(R.id.dialog_details_close);
-closeButton.setOnClickListener(new View.OnClickListener() {
-@Override
-public void onClick(View v) {
-dismiss();
-}
-});
-
-parentView.setLayoutParams(
-new 
FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, height));
-
-ListView infoList = (ListView) 
parentView.findViewById(R.id.dialog_details_list);
-infoList.setAdapter(new 
DetailsListAdapter(item.getMetadata().keySet().toArray()));
-}
-
-class DetailsListAdapter extends ArrayAdapter {
-private final Object[] keys;
-private ViewHolder holder;
-
-public DetailsListAdapter(Object[] items) {
-super(DetailsDialog.this.getContext(), 0, items);
-this.keys = items;
-}
-
-class ViewHolder {
-private TextView text;
-private TextView subText;
-}
-
-@Override
-public boolean isEnabled(int position) {
-return false; // don't make it appear clickable
-}
-
-public View getView(int position, View convertView, ViewGroup parent) {
-LayoutInflater inflater = DetailsDialog.this.getLayoutInflater();
-if (convertView 

[MediaWiki-commits] [Gerrit] Alpha, Beta: Make Special:Watchlist and Special:Nearby conte... - change (mediawiki...MobileFrontend)

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

Change subject: Alpha, Beta: Make Special:Watchlist and Special:Nearby contents 
center-aligned
..


Alpha, Beta: Make Special:Watchlist and Special:Nearby contents center-aligned

Bug: T96332
Change-Id: Ice4e5829f697b4be81a4cb37612a1a439d02
---
M includes/Resources.php
M includes/specials/SpecialMobileEditWatchlist.php
M includes/specials/SpecialNearby.php
A resources/mobile.special.nearby.beta.styles/specialNearby.less
A resources/mobile.special.watchlist.beta.styles/specialWatchlist.less
5 files changed, 59 insertions(+), 0 deletions(-)

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



diff --git a/includes/Resources.php b/includes/Resources.php
index 5c83a71..99335f8 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -1528,6 +1528,12 @@
),
),
 
+   'mobile.special.nearby.beta.styles' => 
$wgMFResourceFileModuleBoilerplate + array(
+   'styles' => array(
+   
'resources/mobile.special.nearby.beta.styles/specialNearby.less',
+   ),
+   ),
+
'mobile.special.userlogin.scripts' => 
$wgMFResourceFileModuleBoilerplate + array(
'dependencies' => array(
'mobile.head',
@@ -1659,6 +1665,13 @@
),
),
 
+   'skins.minerva.special.watchlist.beta.styles' => 
$wgMFMobileSpecialPageResourceBoilerplate + array(
+   'position' => 'top',
+   'styles' => array(
+   
'resources/mobile.special.watchlist.beta.styles/specialWatchlist.less',
+   ),
+   ),
+
'skins.minerva.special.watchlist.scripts' => 
$wgMFMobileSpecialPageResourceBoilerplate + array(
'dependencies' => array(
'mobile.loggingSchemas',
diff --git a/includes/specials/SpecialMobileEditWatchlist.php 
b/includes/specials/SpecialMobileEditWatchlist.php
index 6d9a3f4..b176e33 100644
--- a/includes/specials/SpecialMobileEditWatchlist.php
+++ b/includes/specials/SpecialMobileEditWatchlist.php
@@ -214,6 +214,10 @@
'mobile.special.pagefeed.styles'
)
);
+   // add beta styles
+   if ( MobileContext::singleton()->isBetaGroupMember() ) {
+   $out->addModuleStyles( 
'skins.minerva.special.watchlist.beta.styles' );
+   }
}
 
/**
diff --git a/includes/specials/SpecialNearby.php 
b/includes/specials/SpecialNearby.php
index 4218cc6..b4ccddf 100644
--- a/includes/specials/SpecialNearby.php
+++ b/includes/specials/SpecialNearby.php
@@ -27,6 +27,11 @@
 
$output = $this->getOutput();
 
+   // add beta styles
+   if ( MobileContext::singleton()->isBetaGroupMember() ) {
+   $output->addModuleStyles( 
'mobile.special.nearby.beta.styles' );
+   }
+
// set config
$output->addJsConfigVars( 'wgMFNearbyRange', 
$this->getMFConfig()->get( 'MFNearbyRange' ) );
$output->setPageTitle( wfMessage( 
'mobile-frontend-nearby-title' )->escaped() );
diff --git a/resources/mobile.special.nearby.beta.styles/specialNearby.less 
b/resources/mobile.special.nearby.beta.styles/specialNearby.less
new file mode 100644
index 000..28bc122
--- /dev/null
+++ b/resources/mobile.special.nearby.beta.styles/specialNearby.less
@@ -0,0 +1,14 @@
+@import "minerva.variables";
+@import "minerva.mixins";
+
+@media all and (min-width: @wgMFDeviceWidthTablet) {
+   .alpha,
+   .beta {
+   #content_wrapper .pre-content,
+   #mw-mf-nearby {
+   max-width: @contentMaxWidthTablet;
+   margin: 0 auto;
+   padding: 0 @contentPaddingTablet;
+   }
+   }
+}
diff --git 
a/resources/mobile.special.watchlist.beta.styles/specialWatchlist.less 
b/resources/mobile.special.watchlist.beta.styles/specialWatchlist.less
new file mode 100644
index 000..0a417d9
--- /dev/null
+++ b/resources/mobile.special.watchlist.beta.styles/specialWatchlist.less
@@ -0,0 +1,23 @@
+@import "minerva.variables";
+@import "minerva.mixins";
+
+@media all and (min-width: @wgMFDeviceWidthTablet) {
+   .alpha,
+   .beta {
+   #content_wrapper {
+   .content-header,
+   .watchlist.page-list {
+   max-width: @contentMaxWidthTablet;
+   margin: 0 auto;
+   padding: 0 @contentPaddingTablet;
+   }
+   .content-header {
+   border-bottom: none;
+   .button-bar {
+   border-bottom: 1px solid 
@headerBorderBott

[MediaWiki-commits] [Gerrit] Alpha, Beta: Make the header center-aligned on tablet - change (mediawiki...MobileFrontend)

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

Change subject: Alpha, Beta: Make the header center-aligned on tablet
..


Alpha, Beta: Make the header center-aligned on tablet

* Make sure the border line under the header remains full width
  of the screen
* Rename @contentMaxWidth to @contentMaxWidthTablet and make it
  importable

Bug: T96317
Change-Id: If7d5d24b9d42381e269bb35fc01e7c8a0ff61f71
---
M includes/Resources.php
M includes/skins/SkinMinervaAlpha.php
M includes/skins/SkinMinervaBeta.php
M less/minerva.less/minerva.variables.less
A less/tablet/common.alpha.less
A less/tablet/common.beta.less
M less/tablet/common.less
M less/ui.less
8 files changed, 61 insertions(+), 4 deletions(-)

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



diff --git a/includes/Resources.php b/includes/Resources.php
index 976fbda..5c83a71 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -71,6 +71,18 @@
'less/tablet/hacks.less',
),
),
+   'skins.minerva.tablet.beta.styles' => 
$wgMFResourceFileModuleBoilerplate + array(
+   'position' => 'top',
+   'styles' => array(
+   'less/tablet/common.beta.less'
+   ),
+   ),
+   'skins.minerva.tablet.alpha.styles' => 
$wgMFResourceFileModuleBoilerplate + array(
+   'position' => 'top',
+   'styles' => array(
+   'less/tablet/common.alpha.less'
+   ),
+   ),
'skins.minerva.icons.images' => $wgMFResourceFileModuleBoilerplate + 
array(
'class' => 'ResourceLoaderImageModule',
'prefix' => 'mw-ui',
diff --git a/includes/skins/SkinMinervaAlpha.php 
b/includes/skins/SkinMinervaAlpha.php
index 54b56f0..6ea20a9 100644
--- a/includes/skins/SkinMinervaAlpha.php
+++ b/includes/skins/SkinMinervaAlpha.php
@@ -69,6 +69,7 @@
 
$skinStyles[] = 'skins.minerva.alpha.styles';
$skinStyles[] = 'skins.minerva.alpha.images';
+   $skinStyles[] = 'skins.minerva.tablet.alpha.styles';
 
return $skinStyles;
}
diff --git a/includes/skins/SkinMinervaBeta.php 
b/includes/skins/SkinMinervaBeta.php
index 52732bf..b9639e3 100644
--- a/includes/skins/SkinMinervaBeta.php
+++ b/includes/skins/SkinMinervaBeta.php
@@ -147,6 +147,7 @@
$styles = parent::getSkinStyles();
$styles[] = 'skins.minerva.beta.styles';
$styles[] = 'skins.minerva.beta.images';
+   $styles[] = 'skins.minerva.tablet.beta.styles';
 
return $styles;
}
diff --git a/less/minerva.less/minerva.variables.less 
b/less/minerva.less/minerva.variables.less
index e5e5205..eac67cb 100644
--- a/less/minerva.less/minerva.variables.less
+++ b/less/minerva.less/minerva.variables.less
@@ -79,6 +79,7 @@
 
 // custom tablet styling
 @contentPaddingTablet: 3.35em;
+@contentMaxWidthTablet: 1000px;
 
 // calculated values
 @secondaryNavWidth: @headerElementHeight;
diff --git a/less/tablet/common.alpha.less b/less/tablet/common.alpha.less
new file mode 100644
index 000..02436f9
--- /dev/null
+++ b/less/tablet/common.alpha.less
@@ -0,0 +1,11 @@
+@import "minerva.variables";
+@import "mediawiki.ui/variables";
+
+@media all and (min-width: @wgMFDeviceWidthTablet) {
+   .alpha {
+   .header-icon {
+   // so that the icon image is aligned with the content
+   left: -@iconGutterWidth;
+   }
+   }
+}
diff --git a/less/tablet/common.beta.less b/less/tablet/common.beta.less
new file mode 100644
index 000..5ade7ba
--- /dev/null
+++ b/less/tablet/common.beta.less
@@ -0,0 +1,32 @@
+@import "minerva.variables";
+@import "mediawiki.ui/variables";
+
+
+@media all and (min-width: @wgMFDeviceWidthTablet) {
+   .alpha,
+   .beta {
+   // #mw-mf-page-center is needed because there is a .header 
inside the main menu in alpha
+   #mw-mf-page-center .header {
+   max-width: @contentMaxWidthTablet;
+   margin: 0 auto;
+   padding: 0 @contentPaddingTablet;
+   }
+   // stable and beta hamburger icon
+   #mw-mf-main-menu-button {
+   // so that the icon image is aligned with the content
+   left: -@iconGutterWidth;
+   }
+   #secondary-button {
+   // so that the icon image is aligned with the content
+   right: -@iconGutterWidth;
+   }
+   }
+
+   .beta {
+   // Search input in the header
+   #searchInput {
+   // because we're pulling #mw-mf-main-menu-button to the 
left too (see above)
+   margin-left: -@iconGutterWidth;
+

[MediaWiki-commits] [Gerrit] Made pushLazyJobs() handle all queue groups - change (mediawiki/core)

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

Change subject: Made pushLazyJobs() handle all queue groups
..


Made pushLazyJobs() handle all queue groups

* This avoids __destruct() warnings
* Also remove push() code in __destruct() that just made
  more warnings since it's too late

Change-Id: I32a3cfabc94e36b9d2808b45d55209f3df46e47d
(cherry picked from commit 2a176864eb7781599e49a97ce7921262bb8fdcc6)
---
M includes/MediaWiki.php
M includes/jobqueue/JobQueueGroup.php
2 files changed, 8 insertions(+), 8 deletions(-)

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



diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 84001ff..62ab667 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -459,7 +459,7 @@
 */
public function postSendUpdates() {
try {
-   JobQueueGroup::singleton()->pushLazyJobs();
+   JobQueueGroup::pushLazyJobs();
$this->triggerJobs();
$this->restInPeace();
} catch ( Exception $e ) {
@@ -626,7 +626,7 @@
DeferredUpdates::doUpdates( 'commit' );
 
// Make sure any lazy jobs are pushed
-   JobQueueGroup::singleton()->pushLazyJobs();
+   JobQueueGroup::pushLazyJobs();
 
// Log profiling data, e.g. in the database or UDP
wfLogProfilingData();
diff --git a/includes/jobqueue/JobQueueGroup.php 
b/includes/jobqueue/JobQueueGroup.php
index 04ebc51..776433d 100644
--- a/includes/jobqueue/JobQueueGroup.php
+++ b/includes/jobqueue/JobQueueGroup.php
@@ -28,7 +28,7 @@
  * @since 1.21
  */
 class JobQueueGroup {
-   /** @var array */
+   /** @var JobQueueGroup[] */
protected static $instances = array();
 
/** @var ProcessCacheLRU */
@@ -169,10 +169,11 @@
 * @return void
 * @since 1.26
 */
-   public function pushLazyJobs() {
-   $this->push( $this->bufferedJobs );
-
-   $this->bufferedJobs = array();
+   public static function pushLazyJobs() {
+   foreach ( self::$instances as $group ) {
+   $group->push( $group->bufferedJobs );
+   $group->bufferedJobs = array();
+   }
}
 
/**
@@ -419,7 +420,6 @@
$n = count( $this->bufferedJobs );
if ( $n > 0 ) {
trigger_error( __METHOD__ . ": $n buffered job(s) never 
inserted." );
-   $this->pushLazyJobs(); // try to do it now
}
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I32a3cfabc94e36b9d2808b45d55209f3df46e47d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Ori.livneh 
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 "Add extension.json, empty PHP entry point"" - change (mediawiki...SyntaxHighlight_GeSHi)

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

Change subject: Revert "Revert "Add extension.json, empty PHP entry point""
..


Revert "Revert "Add extension.json, empty PHP entry point""

Try #2. Our last attempt loaded $wgGeSHiSupportedLanguages late, and
would override anything if it was already set. We still load it late, but
only if it is not already set.

This reverts commit 033ca20746432d34ae52540b169a78e070c5ea9b.

Bug: T88063
Change-Id: Iae0806e06a95b2d8932b3d9e078e6135dd6750a3
---
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.langs.php
M SyntaxHighlight_GeSHi.php
A extension.json
M maintenance/updateLanguageList.php
5 files changed, 134 insertions(+), 118 deletions(-)

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



diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index ddaea80..c4f0d0c 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -30,6 +30,37 @@
private static $languages = null;
 
/**
+* Executed after processing extension.json
+* @todo we should figure out how to make this a real config setting.
+*/
+   public static function registerExtension() {
+   global $wgVersion;
+   if ( version_compare( $wgVersion, '1.25', '<' ) ) {
+   die( 'This version of SyntaxHighlight GeSHi requires 
MediaWiki 1.25' );
+   }
+
+   global $wgGeSHiSupportedLanguages;
+   if ( !$wgGeSHiSupportedLanguages ) {
+   // If not set already, load it (@see 
ExtensionRegistry::exportExtractedData)
+   require_once __DIR__ . 
'/SyntaxHighlight_GeSHi.langs.php';
+   }
+   // @fixme we shouldn't be loading this on every request
+   require_once __DIR__ . '/geshi/geshi.php';
+   }
+
+   /**
+* Register parser hook
+*
+* @param $parser Parser
+* @return bool
+*/
+   public static function configureParser( &$parser ) {
+   $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 
'parserHook' ) );
+   $parser->setHook( 'syntaxhighlight', array( 
'SyntaxHighlight_GeSHi', 'parserHook' ) );
+   return true;
+   }
+
+   /**
 * Parser hook
 *
 * @param string $text
@@ -45,7 +76,7 @@
$text = preg_replace( '/^\n+/', '', $text );
 
// Validate language
-   if( isset( $args['lang'] ) && $args['lang'] ) {
+   if ( isset( $args['lang'] ) && $args['lang'] ) {
$lang = $args['lang'];
} else {
// language is not specified. Check if default exists, 
if yes, use it.
@@ -57,12 +88,12 @@
}
}
$lang = strtolower( $lang );
-   if( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
+   if ( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
$error = self::formatLanguageError( $text );
return $error;
}
$geshi = self::prepare( $text, $lang );
-   if( !$geshi instanceof GeSHi ) {
+   if ( !$geshi instanceof GeSHi ) {
$error = self::formatLanguageError( $text );
return $error;
}
@@ -70,23 +101,23 @@
$enclose = self::getEncloseType( $args );
 
// Line numbers
-   if( isset( $args['line'] ) ) {
+   if ( isset( $args['line'] ) ) {
$geshi->enable_line_numbers( GESHI_FANCY_LINE_NUMBERS );
}
// Highlighting specific lines
-   if( isset( $args['highlight'] ) ) {
+   if ( isset( $args['highlight'] ) ) {
$lines = self::parseHighlightLines( $args['highlight'] 
);
if ( count( $lines ) ) {
$geshi->highlight_lines_extra( $lines );
}
}
// Starting line number
-   if( isset( $args['start'] ) ) {
+   if ( isset( $args['start'] ) ) {
$geshi->start_line_numbers_at( $args['start'] );
}
$geshi->set_header_type( $enclose );
// Strict mode
-   if( isset( $args['strict'] ) ) {
+   if ( isset( $args['strict'] ) ) {
$geshi->enable_strict_mode();
}
// Format
@@ -97,19 +128,19 @@
return $error;
}
$err = $geshi->error();
-   if( $err ) {
+   if ( $err ) {
// Other unknown error!
   

[MediaWiki-commits] [Gerrit] Bumping lightncandy version from 0.18 to 0.21 - change (mediawiki/core)

2015-05-20 Thread Kaldari (Code Review)
Kaldari has submitted this change and it was merged.

Change subject: Bumping lightncandy version from 0.18 to 0.21
..


Bumping lightncandy version from 0.18 to 0.21

See also change in vendor repo: I0ba740a88b636a9c1

Change-Id: Idbcc356595db2ceb267690570ef23cd08294426e
---
M composer.json
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  BryanDavis: Looks good to me, but someone else must approve
  Kaldari: Verified; Looks good to me, approved



diff --git a/composer.json b/composer.json
index 6dc72e7..88c5140 100644
--- a/composer.json
+++ b/composer.json
@@ -26,7 +26,7 @@
"wikimedia/cdb": "1.0.1",
"wikimedia/composer-merge-plugin": "1.0.0",
"wikimedia/utfnormal": "1.0.2",
-   "zordius/lightncandy": "0.18"
+   "zordius/lightncandy": "0.21"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "~0.8",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idbcc356595db2ceb267690570ef23cd08294426e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Kaldari 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Daniel Friesen 
Gerrit-Reviewer: Kaldari 
Gerrit-Reviewer: Legoktm 

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


[MediaWiki-commits] [Gerrit] Made MessageCache use the WAN cache - change (mediawiki/core)

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

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

Change subject: Made MessageCache use the WAN cache
..

Made MessageCache use the WAN cache

* This makes sure edits to MediaWiki: pages update
  the cache in all DCs

Bug: T99208
Change-Id: I177608729063b800fb97374f31f316779effce15
---
M includes/cache/MessageCache.php
1 file changed, 151 insertions(+), 88 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/61/212461/1

diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index 31ee487..93317a2 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -84,16 +84,21 @@
protected $mLoadedLanguages = array();
 
/**
+* @var bool $mInParser
+*/
+   protected $mInParser = false;
+
+   /** @var BagOStuff */
+   protected $mMemc;
+   /** @var WANObjectCache */
+   protected $wanCache;
+
+   /**
 * Singleton instance
 *
 * @var MessageCache $instance
 */
private static $instance;
-
-   /**
-* @var bool $mInParser
-*/
-   protected $mInParser = false;
 
/**
 * Get the signleton instance of this class
@@ -136,6 +141,8 @@
$this->mMemc = $memCached;
$this->mDisable = !$useDB;
$this->mExpiry = $expiry;
+
+   $this->wanCache = ObjectCache::getMainWANInstance();
}
 
/**
@@ -268,21 +275,23 @@
# Loading code starts
$success = false; # Keep track of success
$staleCache = false; # a cache array with expired data, or 
false if none has been loaded
+   $hashExpired = false; # whether the cluster-local validation 
hash is stale
$where = array(); # Debug info, delayed to avoid spamming debug 
log too much
-   $cacheKey = wfMemcKey( 'messages', $code ); # Key in memc for 
messages
 
# Local cache
# Hash of the contents is stored in memcache, to detect if 
local cache goes
# out of date (e.g. due to replace() on some other server)
if ( $wgUseLocalMessageCache ) {
-
-   $hash = $this->mMemc->get( wfMemcKey( 'messages', 
$code, 'hash' ) );
+   list( $hash, $hashExpired ) = $this->getValidationHash( 
$code );
if ( $hash ) {
$cache = $this->getLocalCache( $hash, $code );
if ( !$cache ) {
$where[] = 'local cache is empty or has 
the wrong hash';
} elseif ( $this->isCacheExpired( $cache ) ) {
$where[] = 'local cache is expired';
+   $staleCache = $cache;
+   } elseif ( $hashExpired ) {
+   $where[] = 'local cache validation key 
is expired';
$staleCache = $cache;
} else {
$where[] = 'got from local cache';
@@ -293,21 +302,29 @@
}
 
if ( !$success ) {
+   $cacheKey = wfMemcKey( 'messages', $code ); # Key in 
memc for messages
# Try the global cache. If it is empty, try to acquire 
a lock. If
# the lock can't be acquired, wait for the other thread 
to finish
# and then try the global cache a second time.
for ( $failedAttempts = 0; $failedAttempts < 2; 
$failedAttempts++ ) {
-   $cache = $this->mMemc->get( $cacheKey );
-   if ( !$cache ) {
-   $where[] = 'global cache is empty';
-   } elseif ( $this->isCacheExpired( $cache ) ) {
-   $where[] = 'global cache is expired';
-   $staleCache = $cache;
+   if ( $hashExpired && $staleCache ) {
+   # Do not bother fetching the whole 
cache blob to avoid I/O.
+   # Instead, just try to get the 
non-blocking $statusKey lock
+   # below, and use the local stale value 
if it was not acquired.
+   $where[] = 'global cache is presumed 
expired';
} else {
-   $where[] = 'got from global cache';
-   $this->mCache[$code] = $cache;
-   $this->saveToCaches( $cache, 
'local-

[MediaWiki-commits] [Gerrit] Made pushLazyJobs() handle all queue groups - change (mediawiki/core)

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

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

Change subject: Made pushLazyJobs() handle all queue groups
..

Made pushLazyJobs() handle all queue groups

* This avoids __destruct() warnings
* Also remove push() code in __destruct() that just made
  more warnings since it's too late

Change-Id: I32a3cfabc94e36b9d2808b45d55209f3df46e47d
(cherry picked from commit 2a176864eb7781599e49a97ce7921262bb8fdcc6)
---
M includes/MediaWiki.php
M includes/jobqueue/JobQueueGroup.php
2 files changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/60/212460/1

diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 84001ff..62ab667 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -459,7 +459,7 @@
 */
public function postSendUpdates() {
try {
-   JobQueueGroup::singleton()->pushLazyJobs();
+   JobQueueGroup::pushLazyJobs();
$this->triggerJobs();
$this->restInPeace();
} catch ( Exception $e ) {
@@ -626,7 +626,7 @@
DeferredUpdates::doUpdates( 'commit' );
 
// Make sure any lazy jobs are pushed
-   JobQueueGroup::singleton()->pushLazyJobs();
+   JobQueueGroup::pushLazyJobs();
 
// Log profiling data, e.g. in the database or UDP
wfLogProfilingData();
diff --git a/includes/jobqueue/JobQueueGroup.php 
b/includes/jobqueue/JobQueueGroup.php
index 04ebc51..776433d 100644
--- a/includes/jobqueue/JobQueueGroup.php
+++ b/includes/jobqueue/JobQueueGroup.php
@@ -28,7 +28,7 @@
  * @since 1.21
  */
 class JobQueueGroup {
-   /** @var array */
+   /** @var JobQueueGroup[] */
protected static $instances = array();
 
/** @var ProcessCacheLRU */
@@ -169,10 +169,11 @@
 * @return void
 * @since 1.26
 */
-   public function pushLazyJobs() {
-   $this->push( $this->bufferedJobs );
-
-   $this->bufferedJobs = array();
+   public static function pushLazyJobs() {
+   foreach ( self::$instances as $group ) {
+   $group->push( $group->bufferedJobs );
+   $group->bufferedJobs = array();
+   }
}
 
/**
@@ -419,7 +420,6 @@
$n = count( $this->bufferedJobs );
if ( $n > 0 ) {
trigger_error( __METHOD__ . ": $n buffered job(s) never 
inserted." );
-   $this->pushLazyJobs(); // try to do it now
}
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I32a3cfabc94e36b9d2808b45d55209f3df46e47d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf6
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] Revert "Revert "Add extension.json, empty PHP entry point"" - change (mediawiki...SyntaxHighlight_GeSHi)

2015-05-20 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Revert "Revert "Add extension.json, empty PHP entry point""
..

Revert "Revert "Add extension.json, empty PHP entry point""

This reverts commit 033ca20746432d34ae52540b169a78e070c5ea9b.

Change-Id: I2c434364eb074b576e8d2c6881d965aa95513f19
---
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.langs.php
M SyntaxHighlight_GeSHi.php
A extension.json
M maintenance/updateLanguageList.php
5 files changed, 128 insertions(+), 118 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/59/212459/1

diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index ddaea80..0ba0aa0 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -30,6 +30,31 @@
private static $languages = null;
 
/**
+* Executed after processing extension.json
+*/
+   public static function registerExtension() {
+   global $wgVersion;
+   if ( version_compare( $wgVersion, '1.25', '<' ) ) {
+   die( 'This version of SyntaxHighlight GeSHi requires 
MediaWiki 1.25' );
+   }
+
+   require_once __DIR__ . '/SyntaxHighlight_GeSHi.langs.php';
+   require_once __DIR__ . '/geshi/geshi.php';
+   }
+
+   /**
+* Register parser hook
+*
+* @param $parser Parser
+* @return bool
+*/
+   public static function configureParser( &$parser ) {
+   $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 
'parserHook' ) );
+   $parser->setHook( 'syntaxhighlight', array( 
'SyntaxHighlight_GeSHi', 'parserHook' ) );
+   return true;
+   }
+
+   /**
 * Parser hook
 *
 * @param string $text
@@ -45,7 +70,7 @@
$text = preg_replace( '/^\n+/', '', $text );
 
// Validate language
-   if( isset( $args['lang'] ) && $args['lang'] ) {
+   if ( isset( $args['lang'] ) && $args['lang'] ) {
$lang = $args['lang'];
} else {
// language is not specified. Check if default exists, 
if yes, use it.
@@ -57,12 +82,12 @@
}
}
$lang = strtolower( $lang );
-   if( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
+   if ( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
$error = self::formatLanguageError( $text );
return $error;
}
$geshi = self::prepare( $text, $lang );
-   if( !$geshi instanceof GeSHi ) {
+   if ( !$geshi instanceof GeSHi ) {
$error = self::formatLanguageError( $text );
return $error;
}
@@ -70,23 +95,23 @@
$enclose = self::getEncloseType( $args );
 
// Line numbers
-   if( isset( $args['line'] ) ) {
+   if ( isset( $args['line'] ) ) {
$geshi->enable_line_numbers( GESHI_FANCY_LINE_NUMBERS );
}
// Highlighting specific lines
-   if( isset( $args['highlight'] ) ) {
+   if ( isset( $args['highlight'] ) ) {
$lines = self::parseHighlightLines( $args['highlight'] 
);
if ( count( $lines ) ) {
$geshi->highlight_lines_extra( $lines );
}
}
// Starting line number
-   if( isset( $args['start'] ) ) {
+   if ( isset( $args['start'] ) ) {
$geshi->start_line_numbers_at( $args['start'] );
}
$geshi->set_header_type( $enclose );
// Strict mode
-   if( isset( $args['strict'] ) ) {
+   if ( isset( $args['strict'] ) ) {
$geshi->enable_strict_mode();
}
// Format
@@ -97,19 +122,19 @@
return $error;
}
$err = $geshi->error();
-   if( $err ) {
+   if ( $err ) {
// Other unknown error!
$error = self::formatError( $err );
return $error;
}
// Armour for Parser::doBlockLevels()
-   if( $enclose === GESHI_HEADER_DIV ) {
+   if ( $enclose === GESHI_HEADER_DIV ) {
$out = str_replace( "\n", '', $out );
}
// HTML Tidy will convert tabs to spaces incorrectly (bug 
30930).
// But the conversion from tab to space occurs while read

[MediaWiki-commits] [Gerrit] Initial commit - change (labs...ptable)

2015-05-20 Thread Ricordisamoa (Code Review)
Ricordisamoa has submitted this change and it was merged.

Change subject: Initial commit
..


Initial commit

Change-Id: Id7f19ca2e89080f8d1000245714be5bdf4d7f706
---
A COPYING
A CREDITS
A app.py
A chemistry.py
A data.py
A requirements.txt
A static/common.css
A static/table.css
A static/toolinfo.json
A templates/api.html
A templates/base.html
A templates/index.html
A templates/license.html
A tox.ini
14 files changed, 1,440 insertions(+), 0 deletions(-)

Approvals:
  Ricordisamoa: Verified; Looks good to me, approved
  Lucie Kaffee: Looks good to me, but someone else must approve



diff --git a/COPYING b/COPYING
new file mode 100644
index 000..94a9ed0
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,674 @@
+GNU GENERAL PUBLIC LICENSE
+   Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. 
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+   TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a

[MediaWiki-commits] [Gerrit] WIP add appeal to mustache data - change (mediawiki...DonationInterface)

2015-05-20 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: WIP add appeal to mustache data
..

WIP add appeal to mustache data

Assumes transcluding a template, not a regular page

Change-Id: I997c469bd0f9afd8c5f0418e248b6d474587e431
---
M DonationInterface.php
M gateway_forms/Form.php
M gateway_forms/Mustache.php
M gateway_forms/RapidHtml.php
4 files changed, 40 insertions(+), 19 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/57/212457/1

diff --git a/DonationInterface.php b/DonationInterface.php
index df4e677..aa374b3 100644
--- a/DonationInterface.php
+++ b/DonationInterface.php
@@ -134,6 +134,12 @@
  */
 $wgDonationInterfaceTemplate = __DIR__ . 
'/gateway_forms/mustache/index.html.mustache';
 
+/**
+ * Title to transclude in form template as {{{ appeal_text }}}.
+ * @appeal and @language will be substituted before transclusion
+ */
+$wgDonationInterfaceAppealWikiPage = 
'LanguageSwitch|2011FR/@appeal/text|@language';
+
 //all of the following variables make sense to override directly,
 //or change "DonationInterface" to the gateway's id to override just for that 
gateway.
 //for instance: To override $wgDonationInterfaceUseSyslog just for 
GlobalCollect, add
diff --git a/gateway_forms/Form.php b/gateway_forms/Form.php
index e88b625..ed4ad65 100644
--- a/gateway_forms/Form.php
+++ b/gateway_forms/Form.php
@@ -153,4 +153,23 @@
protected static function getCountrySpecificMessage( $key, $country, 
$language ) {
return DataValidator::wfLangSpecificFallback( $language, array( 
$key . '-' . strtolower( $country ), $key ) );
}
+
+   /**
+* This function limits the possible characters passed as template keys 
and
+* values to letters, numbers, hyphens and underscores. The function 
also
+* performs standard escaping of the passed values.
+*
+* @param string $string The unsafe string to escape and check for 
invalid characters
+* @param string $default
+* @return string $default A string matching the regex or an empty 
string
+*/
+   function make_safe( $string, $default='' ) {
+   $num = preg_match( '([a-zA-Z0-9_-]+)', $string, $matches );
+
+   if ( $num == 1 ){
+   # theoretically this is overkill, but better safe than 
sorry
+   return wfEscapeWikiText( htmlspecialchars( $matches[0] 
) );
+   }
+   return $default;
+   }
 }
diff --git a/gateway_forms/Mustache.php b/gateway_forms/Mustache.php
index 757d378..6b37c8e 100644
--- a/gateway_forms/Mustache.php
+++ b/gateway_forms/Mustache.php
@@ -36,6 +36,21 @@
$data = $this->gateway->getData_Unstaged_Escaped();
self::$language = $data['language'];
self::$country = $data['country'];
+   
+   $context = RequestContext::getMain();
+   $config = $context->getConfig();
+   $output = $context->getOutput();
+   $request = $context->getRequest();
+
+   $data['script_path'] = $config->get( 'ScriptPath' );
+   $data['verisign_logo'] = $this->getSmallSecureLogo();
+   $data['no_script'] = $this->getNoScript();
+
+   $appealWikiPage = $this->gateway->getGlobal( 'AppealWikiPage' );
+   $appeal = $this->make_safe( $request->getText( 'appeal', 
'Appeal-default' ) );
+   $appealWikiPage = str_replace( '@appeal', $appeal, 
$appealWikiPage );
+   $appealWikiPage = str_replace( '@language', $data['language'], 
$appealWikiPage );
+   $data['appeal_text'] = $output->parse( '{{' . $appealWikiPage . 
'}}' );
 
$config = RequestContext::getMain()->getConfig();
 
diff --git a/gateway_forms/RapidHtml.php b/gateway_forms/RapidHtml.php
index 3e526ae..2e6a63a 100644
--- a/gateway_forms/RapidHtml.php
+++ b/gateway_forms/RapidHtml.php
@@ -531,25 +531,6 @@
}
 
/**
-* This function limits the possible characters passed as template keys 
and
-* values to letters, numbers, hyphens and underscores. The function 
also
-* performs standard escaping of the passed values.
-*
-* @param string $string The unsafe string to escape and check for 
invalid characters
-* @param string $default
-* @return string $default A string matching the regex or an empty 
string
-*/
-   function make_safe( $string, $default='' ) {
-   $num = preg_match( '([a-zA-Z0-9_-]+)', $string, $matches );
-
-   if ( $num == 1 ){
-   # theoretically this is overkill, but better safe than 
sorry
-   return wfEscapeWikiText( htmlspecialchars( $matches[0] 
) );
-   }
-   return $default;

[MediaWiki-commits] [Gerrit] Revert "Revert "Add extension.json, empty PHP entry point"" - change (mediawiki...SyntaxHighlight_GeSHi)

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

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

Change subject: Revert "Revert "Add extension.json, empty PHP entry point""
..

Revert "Revert "Add extension.json, empty PHP entry point""

Try #2.

This reverts commit 033ca20746432d34ae52540b169a78e070c5ea9b.

Change-Id: Iae0806e06a95b2d8932b3d9e078e6135dd6750a3
---
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.langs.php
M SyntaxHighlight_GeSHi.php
A extension.json
M maintenance/updateLanguageList.php
5 files changed, 128 insertions(+), 118 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/56/212456/1

diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index ddaea80..0ba0aa0 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -30,6 +30,31 @@
private static $languages = null;
 
/**
+* Executed after processing extension.json
+*/
+   public static function registerExtension() {
+   global $wgVersion;
+   if ( version_compare( $wgVersion, '1.25', '<' ) ) {
+   die( 'This version of SyntaxHighlight GeSHi requires 
MediaWiki 1.25' );
+   }
+
+   require_once __DIR__ . '/SyntaxHighlight_GeSHi.langs.php';
+   require_once __DIR__ . '/geshi/geshi.php';
+   }
+
+   /**
+* Register parser hook
+*
+* @param $parser Parser
+* @return bool
+*/
+   public static function configureParser( &$parser ) {
+   $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 
'parserHook' ) );
+   $parser->setHook( 'syntaxhighlight', array( 
'SyntaxHighlight_GeSHi', 'parserHook' ) );
+   return true;
+   }
+
+   /**
 * Parser hook
 *
 * @param string $text
@@ -45,7 +70,7 @@
$text = preg_replace( '/^\n+/', '', $text );
 
// Validate language
-   if( isset( $args['lang'] ) && $args['lang'] ) {
+   if ( isset( $args['lang'] ) && $args['lang'] ) {
$lang = $args['lang'];
} else {
// language is not specified. Check if default exists, 
if yes, use it.
@@ -57,12 +82,12 @@
}
}
$lang = strtolower( $lang );
-   if( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
+   if ( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
$error = self::formatLanguageError( $text );
return $error;
}
$geshi = self::prepare( $text, $lang );
-   if( !$geshi instanceof GeSHi ) {
+   if ( !$geshi instanceof GeSHi ) {
$error = self::formatLanguageError( $text );
return $error;
}
@@ -70,23 +95,23 @@
$enclose = self::getEncloseType( $args );
 
// Line numbers
-   if( isset( $args['line'] ) ) {
+   if ( isset( $args['line'] ) ) {
$geshi->enable_line_numbers( GESHI_FANCY_LINE_NUMBERS );
}
// Highlighting specific lines
-   if( isset( $args['highlight'] ) ) {
+   if ( isset( $args['highlight'] ) ) {
$lines = self::parseHighlightLines( $args['highlight'] 
);
if ( count( $lines ) ) {
$geshi->highlight_lines_extra( $lines );
}
}
// Starting line number
-   if( isset( $args['start'] ) ) {
+   if ( isset( $args['start'] ) ) {
$geshi->start_line_numbers_at( $args['start'] );
}
$geshi->set_header_type( $enclose );
// Strict mode
-   if( isset( $args['strict'] ) ) {
+   if ( isset( $args['strict'] ) ) {
$geshi->enable_strict_mode();
}
// Format
@@ -97,19 +122,19 @@
return $error;
}
$err = $geshi->error();
-   if( $err ) {
+   if ( $err ) {
// Other unknown error!
$error = self::formatError( $err );
return $error;
}
// Armour for Parser::doBlockLevels()
-   if( $enclose === GESHI_HEADER_DIV ) {
+   if ( $enclose === GESHI_HEADER_DIV ) {
$out = str_replace( "\n", '', $out );
}
// HTML Tidy will convert tabs to spaces incorrectly (bug 
30930).
// But the conversion from tab to space occurs w

[MediaWiki-commits] [Gerrit] Fix api mapping - change (analytics/dashiki)

2015-05-20 Thread Milimetric (Code Review)
Milimetric has uploaded a new change for review.

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

Change subject: Fix api mapping
..

Fix api mapping

Change-Id: I4c825b3bd139ae6b1794d18c3878158d4692405e
---
M src/app/apis/api-finder.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/dashiki 
refs/changes/54/212454/1

diff --git a/src/app/apis/api-finder.js b/src/app/apis/api-finder.js
index dee067b..4320a32 100644
--- a/src/app/apis/api-finder.js
+++ b/src/app/apis/api-finder.js
@@ -17,7 +17,7 @@
 return function (metric) {
 var mapping = {
 wikimetrics: wikimetricsApi,
-pageview: pageviewApi,
+pageviewApi: pageviewApi,
 datasets: datasetsApi,
 };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c825b3bd139ae6b1794d18c3878158d4692405e
Gerrit-PatchSet: 1
Gerrit-Project: analytics/dashiki
Gerrit-Branch: master
Gerrit-Owner: Milimetric 

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


[MediaWiki-commits] [Gerrit] [WIP] Update to Vega 2.0 (not ready to merge) - change (analytics/dashiki)

2015-05-20 Thread Milimetric (Code Review)
Milimetric has uploaded a new change for review.

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

Change subject: [WIP] Update to Vega 2.0 (not ready to merge)
..

[WIP] Update to Vega 2.0 (not ready to merge)

Change-Id: I6a3afa0ef8f77bbdd9205ef6240431f291bb5ecf
---
M src/app/require.config.js
M src/components/visualizers/vega-timeseries/bindings.js
A src/lib/vega2.js
A src/lib/vega2.min.js
4 files changed, 15,227 insertions(+), 58 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/dashiki 
refs/changes/55/212455/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a3afa0ef8f77bbdd9205ef6240431f291bb5ecf
Gerrit-PatchSet: 1
Gerrit-Project: analytics/dashiki
Gerrit-Branch: master
Gerrit-Owner: Milimetric 

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


[MediaWiki-commits] [Gerrit] Update SyntaxHighlight_GeSHi to 1.26wmf7 HEAD - change (mediawiki/core)

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

Change subject: Update SyntaxHighlight_GeSHi to 1.26wmf7 HEAD
..


Update SyntaxHighlight_GeSHi to 1.26wmf7 HEAD

Change-Id: Ia72cbaeb1ec4a08344f60c38691ed0abec1c390e
---
M extensions/SyntaxHighlight_GeSHi
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/extensions/SyntaxHighlight_GeSHi b/extensions/SyntaxHighlight_GeSHi
index df84625..58860a0 16
--- a/extensions/SyntaxHighlight_GeSHi
+++ b/extensions/SyntaxHighlight_GeSHi
-Subproject commit df84625974ebc7351d40cc208a331c261125ddd7
+Subproject commit 58860a0b0c5f7e093b2326e18f707a72ee88c2a4

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia72cbaeb1ec4a08344f60c38691ed0abec1c390e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Update SyntaxHighlight_GeSHi to 1.26wmf7 HEAD - change (mediawiki/core)

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

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

Change subject: Update SyntaxHighlight_GeSHi to 1.26wmf7 HEAD
..

Update SyntaxHighlight_GeSHi to 1.26wmf7 HEAD

Change-Id: Ia72cbaeb1ec4a08344f60c38691ed0abec1c390e
---
M extensions/SyntaxHighlight_GeSHi
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/53/212453/1

diff --git a/extensions/SyntaxHighlight_GeSHi b/extensions/SyntaxHighlight_GeSHi
index df84625..58860a0 16
--- a/extensions/SyntaxHighlight_GeSHi
+++ b/extensions/SyntaxHighlight_GeSHi
-Subproject commit df84625974ebc7351d40cc208a331c261125ddd7
+Subproject commit 58860a0b0c5f7e093b2326e18f707a72ee88c2a4

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia72cbaeb1ec4a08344f60c38691ed0abec1c390e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] Revert "Add extension.json, empty PHP entry point" - change (mediawiki...SyntaxHighlight_GeSHi)

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

Change subject: Revert "Add extension.json, empty PHP entry point"
..


Revert "Add extension.json, empty PHP entry point"

This reverts commit 72d1e9226365959a7fff1ee429787b9ed52e751c.

Change-Id: I47eab2842f195bf302de0ae3bf15beff1b48290f
(cherry picked from commit 033ca20746432d34ae52540b169a78e070c5ea9b)
---
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.langs.php
M SyntaxHighlight_GeSHi.php
D extension.json
M maintenance/updateLanguageList.php
5 files changed, 118 insertions(+), 128 deletions(-)

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



diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index 0ba0aa0..ddaea80 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -30,31 +30,6 @@
private static $languages = null;
 
/**
-* Executed after processing extension.json
-*/
-   public static function registerExtension() {
-   global $wgVersion;
-   if ( version_compare( $wgVersion, '1.25', '<' ) ) {
-   die( 'This version of SyntaxHighlight GeSHi requires 
MediaWiki 1.25' );
-   }
-
-   require_once __DIR__ . '/SyntaxHighlight_GeSHi.langs.php';
-   require_once __DIR__ . '/geshi/geshi.php';
-   }
-
-   /**
-* Register parser hook
-*
-* @param $parser Parser
-* @return bool
-*/
-   public static function configureParser( &$parser ) {
-   $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 
'parserHook' ) );
-   $parser->setHook( 'syntaxhighlight', array( 
'SyntaxHighlight_GeSHi', 'parserHook' ) );
-   return true;
-   }
-
-   /**
 * Parser hook
 *
 * @param string $text
@@ -70,7 +45,7 @@
$text = preg_replace( '/^\n+/', '', $text );
 
// Validate language
-   if ( isset( $args['lang'] ) && $args['lang'] ) {
+   if( isset( $args['lang'] ) && $args['lang'] ) {
$lang = $args['lang'];
} else {
// language is not specified. Check if default exists, 
if yes, use it.
@@ -82,12 +57,12 @@
}
}
$lang = strtolower( $lang );
-   if ( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
+   if( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
$error = self::formatLanguageError( $text );
return $error;
}
$geshi = self::prepare( $text, $lang );
-   if ( !$geshi instanceof GeSHi ) {
+   if( !$geshi instanceof GeSHi ) {
$error = self::formatLanguageError( $text );
return $error;
}
@@ -95,23 +70,23 @@
$enclose = self::getEncloseType( $args );
 
// Line numbers
-   if ( isset( $args['line'] ) ) {
+   if( isset( $args['line'] ) ) {
$geshi->enable_line_numbers( GESHI_FANCY_LINE_NUMBERS );
}
// Highlighting specific lines
-   if ( isset( $args['highlight'] ) ) {
+   if( isset( $args['highlight'] ) ) {
$lines = self::parseHighlightLines( $args['highlight'] 
);
if ( count( $lines ) ) {
$geshi->highlight_lines_extra( $lines );
}
}
// Starting line number
-   if ( isset( $args['start'] ) ) {
+   if( isset( $args['start'] ) ) {
$geshi->start_line_numbers_at( $args['start'] );
}
$geshi->set_header_type( $enclose );
// Strict mode
-   if ( isset( $args['strict'] ) ) {
+   if( isset( $args['strict'] ) ) {
$geshi->enable_strict_mode();
}
// Format
@@ -122,19 +97,19 @@
return $error;
}
$err = $geshi->error();
-   if ( $err ) {
+   if( $err ) {
// Other unknown error!
$error = self::formatError( $err );
return $error;
}
// Armour for Parser::doBlockLevels()
-   if ( $enclose === GESHI_HEADER_DIV ) {
+   if( $enclose === GESHI_HEADER_DIV ) {
$out = str_replace( "\n", '', $out );
}
// HTML Tidy will convert tabs to spaces incorrectly (bug 
30930).
// But the conversion from tab to space occurs while reading 
the

[MediaWiki-commits] [Gerrit] Revert "Add extension.json, empty PHP entry point" - change (mediawiki...SyntaxHighlight_GeSHi)

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

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

Change subject: Revert "Add extension.json, empty PHP entry point"
..

Revert "Add extension.json, empty PHP entry point"

This reverts commit 72d1e9226365959a7fff1ee429787b9ed52e751c.

Change-Id: I47eab2842f195bf302de0ae3bf15beff1b48290f
(cherry picked from commit 033ca20746432d34ae52540b169a78e070c5ea9b)
---
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.langs.php
M SyntaxHighlight_GeSHi.php
D extension.json
M maintenance/updateLanguageList.php
5 files changed, 118 insertions(+), 128 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/52/212452/1

diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index 0ba0aa0..ddaea80 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -30,31 +30,6 @@
private static $languages = null;
 
/**
-* Executed after processing extension.json
-*/
-   public static function registerExtension() {
-   global $wgVersion;
-   if ( version_compare( $wgVersion, '1.25', '<' ) ) {
-   die( 'This version of SyntaxHighlight GeSHi requires 
MediaWiki 1.25' );
-   }
-
-   require_once __DIR__ . '/SyntaxHighlight_GeSHi.langs.php';
-   require_once __DIR__ . '/geshi/geshi.php';
-   }
-
-   /**
-* Register parser hook
-*
-* @param $parser Parser
-* @return bool
-*/
-   public static function configureParser( &$parser ) {
-   $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 
'parserHook' ) );
-   $parser->setHook( 'syntaxhighlight', array( 
'SyntaxHighlight_GeSHi', 'parserHook' ) );
-   return true;
-   }
-
-   /**
 * Parser hook
 *
 * @param string $text
@@ -70,7 +45,7 @@
$text = preg_replace( '/^\n+/', '', $text );
 
// Validate language
-   if ( isset( $args['lang'] ) && $args['lang'] ) {
+   if( isset( $args['lang'] ) && $args['lang'] ) {
$lang = $args['lang'];
} else {
// language is not specified. Check if default exists, 
if yes, use it.
@@ -82,12 +57,12 @@
}
}
$lang = strtolower( $lang );
-   if ( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
+   if( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
$error = self::formatLanguageError( $text );
return $error;
}
$geshi = self::prepare( $text, $lang );
-   if ( !$geshi instanceof GeSHi ) {
+   if( !$geshi instanceof GeSHi ) {
$error = self::formatLanguageError( $text );
return $error;
}
@@ -95,23 +70,23 @@
$enclose = self::getEncloseType( $args );
 
// Line numbers
-   if ( isset( $args['line'] ) ) {
+   if( isset( $args['line'] ) ) {
$geshi->enable_line_numbers( GESHI_FANCY_LINE_NUMBERS );
}
// Highlighting specific lines
-   if ( isset( $args['highlight'] ) ) {
+   if( isset( $args['highlight'] ) ) {
$lines = self::parseHighlightLines( $args['highlight'] 
);
if ( count( $lines ) ) {
$geshi->highlight_lines_extra( $lines );
}
}
// Starting line number
-   if ( isset( $args['start'] ) ) {
+   if( isset( $args['start'] ) ) {
$geshi->start_line_numbers_at( $args['start'] );
}
$geshi->set_header_type( $enclose );
// Strict mode
-   if ( isset( $args['strict'] ) ) {
+   if( isset( $args['strict'] ) ) {
$geshi->enable_strict_mode();
}
// Format
@@ -122,19 +97,19 @@
return $error;
}
$err = $geshi->error();
-   if ( $err ) {
+   if( $err ) {
// Other unknown error!
$error = self::formatError( $err );
return $error;
}
// Armour for Parser::doBlockLevels()
-   if ( $enclose === GESHI_HEADER_DIV ) {
+   if( $enclose === GESHI_HEADER_DIV ) {
$out = str_replace( "\n", '', $out );
}
// HTML Tidy will convert tabs to spaces incorrectly (bug 
30930).
// But

[MediaWiki-commits] [Gerrit] Add a way to provide one-click query examples - change (wikidata...rdf)

2015-05-20 Thread Jdouglas (Code Review)
Jdouglas has uploaded a new change for review.

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

Change subject: Add a way to provide one-click query examples
..

Add a way to provide one-click query examples

Change-Id: I0ee7bab9d919f118aabdc80e0155130905c4951a
---
M gui/gui.js
M gui/index.html
2 files changed, 33 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/51/212451/1

diff --git a/gui/gui.js b/gui/gui.js
index 8d06bbe..e136304 100644
--- a/gui/gui.js
+++ b/gui/gui.js
@@ -1,6 +1,8 @@
 var jQuery = $;
 var mediaWiki = {};
 
+var EDITOR = {};
+
 $(function() {
var SERVICE = '/bigdata/namespace/wdq/sparql';
 
@@ -59,7 +61,6 @@
mode : "sparql",
};
 
-   var EDITOR = {};
var ERROR_LINE_MARKER = null;
var ERROR_CHARACTER_MARKER = null;
 
diff --git a/gui/index.html b/gui/index.html
index a2a26e0..f9a45ff 100644
--- a/gui/index.html
+++ b/gui/index.html
@@ -26,6 +26,37 @@
https://github.com/wikimedia/wikidata-query-rdf/blob/master/docs/exploring-linked-data.md";>Exploring
 Linked Data
https://www.mediawiki.org/wiki/Wikibase/Indexing/SPARQL_Query_Examples";>SPARQL
 query examples
http://tools.wmflabs.org/wdq2sparql/w2s.php";>WDQ syntax 
translator
+  
+Sample query:
+
+  -
+
+
+  var exampleQueries = document.getElementById('exampleQueries');
+  exampleQueries.add(new Option('US presidents and wives',
+'PREFIX wd: <http://www.wikidata.org/entity/> \n' +
+'PREFIX wdt: <http://www.wikidata.org/prop/direct/>\n' +
+'PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n' +
+'PREFIX p: <http://www.wikidata.org/prop/>\n' +
+'PREFIX v: <http://www.wikidata.org/prop/statement/>\n' +
+'SELECT ?p ?w ?l ?wl WHERE {\n' +
+'   wd:Q30 p:P6/v:P6 ?p .\n' +
+'   ?p wdt:P26 ?w .\n' +
+'   OPTIONAL  {  \n' +
+' ?p rdfs:label ?l FILTER (LANG(?l) = "en") . \n' +
+'   }\n' +
+'   OPTIONAL {\n' +
+' ?w rdfs:label ?wl FILTER (LANG(?wl) = "en"). \n' +
+'   }\n' +
+' }'
+  ));
+  function pasteExample() {
+if (exampleQueries.value.trim().length > 0) {
+  EDITOR.setValue(exampleQueries.value);
+}
+  }
+
+  
   
   
   

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ee7bab9d919f118aabdc80e0155130905c4951a
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Jdouglas 

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


[MediaWiki-commits] [Gerrit] Add some checks to avoid throwing errors on malformed input - change (mediawiki...MadLib)

2015-05-20 Thread Clump (Code Review)
Clump has submitted this change and it was merged.

Change subject: Add some checks to avoid throwing errors on malformed input
..


Add some checks to avoid throwing errors on malformed input

Trim the 2nd parameter, and verify exploded entries are not empty.
Verify a Title object is actually returned before looking for a revision.

Change-Id: I18cd15e01bfda3c596b1af73df9cea91c48e177d
---
M MadLib.php
1 file changed, 9 insertions(+), 5 deletions(-)

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



diff --git a/MadLib.php b/MadLib.php
index d8fc752..3fd430f 100644
--- a/MadLib.php
+++ b/MadLib.php
@@ -32,7 +32,7 @@
 
 // The version of the extension, which will appear on Special:Version.
 // This can be a number or a string.
-'version' => "1.0", 
+'version' => "1.0.1", 
 
 // Your name, which will appear on Special:Version.
 'author' => 'Clark Verbrugge',
@@ -72,11 +72,13 @@
 // first arg is the base text 
 $s = $param1;
 // second arg is a comma-separated list of tags to replace
-$fmt = preg_split("/\s*,\s*/",$param2);
+$fmt = preg_split("/\s*,\s*/",trim($param2));
 // third arg is optional, and is a prefix applied to the matching page 
names of replaced tags
 
 // do a replacement for each of the indicated madlib tags
 foreach($fmt as $f) {
+if ($f === '')
+continue;
 $fs = MadLibExtensionCleanPage(MadLibExtensionGetPage($param3 . $f)); 
// get page of texts for the given tag
 $fa = explode("\n",$fs); // line-separated values
 
@@ -196,8 +198,10 @@
 // Get a page content, or empty string if page not found
 function MadLibExtensionGetPage($t) {
 $title = Title::newFromText($t);
-$r = Revision::newFromTitle($title);
-if(is_object($r))
-return $r->getText();
+if(is_object($title)) {
+$r = Revision::newFromTitle($title);
+if(is_object($r))
+return $r->getText();
+}
 return "";
 }
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I18cd15e01bfda3c596b1af73df9cea91c48e177d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MadLib
Gerrit-Branch: master
Gerrit-Owner: Clump 
Gerrit-Reviewer: Clump 
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 "Add extension.json, empty PHP entry point" - change (mediawiki...SyntaxHighlight_GeSHi)

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

Change subject: Revert "Add extension.json, empty PHP entry point"
..


Revert "Add extension.json, empty PHP entry point"

This reverts commit 72d1e9226365959a7fff1ee429787b9ed52e751c.

Change-Id: I47eab2842f195bf302de0ae3bf15beff1b48290f
---
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.langs.php
M SyntaxHighlight_GeSHi.php
D extension.json
M maintenance/updateLanguageList.php
5 files changed, 118 insertions(+), 128 deletions(-)

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



diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index 0ba0aa0..ddaea80 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -30,31 +30,6 @@
private static $languages = null;
 
/**
-* Executed after processing extension.json
-*/
-   public static function registerExtension() {
-   global $wgVersion;
-   if ( version_compare( $wgVersion, '1.25', '<' ) ) {
-   die( 'This version of SyntaxHighlight GeSHi requires 
MediaWiki 1.25' );
-   }
-
-   require_once __DIR__ . '/SyntaxHighlight_GeSHi.langs.php';
-   require_once __DIR__ . '/geshi/geshi.php';
-   }
-
-   /**
-* Register parser hook
-*
-* @param $parser Parser
-* @return bool
-*/
-   public static function configureParser( &$parser ) {
-   $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 
'parserHook' ) );
-   $parser->setHook( 'syntaxhighlight', array( 
'SyntaxHighlight_GeSHi', 'parserHook' ) );
-   return true;
-   }
-
-   /**
 * Parser hook
 *
 * @param string $text
@@ -70,7 +45,7 @@
$text = preg_replace( '/^\n+/', '', $text );
 
// Validate language
-   if ( isset( $args['lang'] ) && $args['lang'] ) {
+   if( isset( $args['lang'] ) && $args['lang'] ) {
$lang = $args['lang'];
} else {
// language is not specified. Check if default exists, 
if yes, use it.
@@ -82,12 +57,12 @@
}
}
$lang = strtolower( $lang );
-   if ( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
+   if( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
$error = self::formatLanguageError( $text );
return $error;
}
$geshi = self::prepare( $text, $lang );
-   if ( !$geshi instanceof GeSHi ) {
+   if( !$geshi instanceof GeSHi ) {
$error = self::formatLanguageError( $text );
return $error;
}
@@ -95,23 +70,23 @@
$enclose = self::getEncloseType( $args );
 
// Line numbers
-   if ( isset( $args['line'] ) ) {
+   if( isset( $args['line'] ) ) {
$geshi->enable_line_numbers( GESHI_FANCY_LINE_NUMBERS );
}
// Highlighting specific lines
-   if ( isset( $args['highlight'] ) ) {
+   if( isset( $args['highlight'] ) ) {
$lines = self::parseHighlightLines( $args['highlight'] 
);
if ( count( $lines ) ) {
$geshi->highlight_lines_extra( $lines );
}
}
// Starting line number
-   if ( isset( $args['start'] ) ) {
+   if( isset( $args['start'] ) ) {
$geshi->start_line_numbers_at( $args['start'] );
}
$geshi->set_header_type( $enclose );
// Strict mode
-   if ( isset( $args['strict'] ) ) {
+   if( isset( $args['strict'] ) ) {
$geshi->enable_strict_mode();
}
// Format
@@ -122,19 +97,19 @@
return $error;
}
$err = $geshi->error();
-   if ( $err ) {
+   if( $err ) {
// Other unknown error!
$error = self::formatError( $err );
return $error;
}
// Armour for Parser::doBlockLevels()
-   if ( $enclose === GESHI_HEADER_DIV ) {
+   if( $enclose === GESHI_HEADER_DIV ) {
$out = str_replace( "\n", '', $out );
}
// HTML Tidy will convert tabs to spaces incorrectly (bug 
30930).
// But the conversion from tab to space occurs while reading 
the input,
// before the conversion from 	 to tab, so we can armor

[MediaWiki-commits] [Gerrit] Revert "Add extension.json, empty PHP entry point" - change (mediawiki...SyntaxHighlight_GeSHi)

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

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

Change subject: Revert "Add extension.json, empty PHP entry point"
..

Revert "Add extension.json, empty PHP entry point"

This reverts commit 72d1e9226365959a7fff1ee429787b9ed52e751c.

Change-Id: I47eab2842f195bf302de0ae3bf15beff1b48290f
---
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.langs.php
M SyntaxHighlight_GeSHi.php
D extension.json
M maintenance/updateLanguageList.php
5 files changed, 118 insertions(+), 128 deletions(-)


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

diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index 0ba0aa0..ddaea80 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -30,31 +30,6 @@
private static $languages = null;
 
/**
-* Executed after processing extension.json
-*/
-   public static function registerExtension() {
-   global $wgVersion;
-   if ( version_compare( $wgVersion, '1.25', '<' ) ) {
-   die( 'This version of SyntaxHighlight GeSHi requires 
MediaWiki 1.25' );
-   }
-
-   require_once __DIR__ . '/SyntaxHighlight_GeSHi.langs.php';
-   require_once __DIR__ . '/geshi/geshi.php';
-   }
-
-   /**
-* Register parser hook
-*
-* @param $parser Parser
-* @return bool
-*/
-   public static function configureParser( &$parser ) {
-   $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 
'parserHook' ) );
-   $parser->setHook( 'syntaxhighlight', array( 
'SyntaxHighlight_GeSHi', 'parserHook' ) );
-   return true;
-   }
-
-   /**
 * Parser hook
 *
 * @param string $text
@@ -70,7 +45,7 @@
$text = preg_replace( '/^\n+/', '', $text );
 
// Validate language
-   if ( isset( $args['lang'] ) && $args['lang'] ) {
+   if( isset( $args['lang'] ) && $args['lang'] ) {
$lang = $args['lang'];
} else {
// language is not specified. Check if default exists, 
if yes, use it.
@@ -82,12 +57,12 @@
}
}
$lang = strtolower( $lang );
-   if ( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
+   if( !preg_match( '/^[a-z_0-9-]*$/', $lang ) ) {
$error = self::formatLanguageError( $text );
return $error;
}
$geshi = self::prepare( $text, $lang );
-   if ( !$geshi instanceof GeSHi ) {
+   if( !$geshi instanceof GeSHi ) {
$error = self::formatLanguageError( $text );
return $error;
}
@@ -95,23 +70,23 @@
$enclose = self::getEncloseType( $args );
 
// Line numbers
-   if ( isset( $args['line'] ) ) {
+   if( isset( $args['line'] ) ) {
$geshi->enable_line_numbers( GESHI_FANCY_LINE_NUMBERS );
}
// Highlighting specific lines
-   if ( isset( $args['highlight'] ) ) {
+   if( isset( $args['highlight'] ) ) {
$lines = self::parseHighlightLines( $args['highlight'] 
);
if ( count( $lines ) ) {
$geshi->highlight_lines_extra( $lines );
}
}
// Starting line number
-   if ( isset( $args['start'] ) ) {
+   if( isset( $args['start'] ) ) {
$geshi->start_line_numbers_at( $args['start'] );
}
$geshi->set_header_type( $enclose );
// Strict mode
-   if ( isset( $args['strict'] ) ) {
+   if( isset( $args['strict'] ) ) {
$geshi->enable_strict_mode();
}
// Format
@@ -122,19 +97,19 @@
return $error;
}
$err = $geshi->error();
-   if ( $err ) {
+   if( $err ) {
// Other unknown error!
$error = self::formatError( $err );
return $error;
}
// Armour for Parser::doBlockLevels()
-   if ( $enclose === GESHI_HEADER_DIV ) {
+   if( $enclose === GESHI_HEADER_DIV ) {
$out = str_replace( "\n", '', $out );
}
// HTML Tidy will convert tabs to spaces incorrectly (bug 
30930).
// But the conversion from tab to space occurs while reading 
the input,
  

  1   2   3   4   >