[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Fix CI for PHP 5.3

2017-11-04 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/388978 )

Change subject: Fix CI for PHP 5.3
..


Fix CI for PHP 5.3

Change-Id: I1c3bdc304681773e97d70519a80fd220d5d574da
---
M .travis.yml
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/.travis.yml b/.travis.yml
index b39af3f..3d90b21 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -35,6 +35,8 @@
   php: 5.5
 - env: DBTYPE=sqlite; MW=1.26.0
   php: 5.3
+  dist: precise
+  sudo: required
 
 script:
 - bash ./build/travis/script.sh

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1c3bdc304681773e97d70519a80fd220d5d574da
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Fix CI for PHP 5.3

2017-11-04 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/388978 )

Change subject: Fix CI for PHP 5.3
..

Fix CI for PHP 5.3

Change-Id: I1c3bdc304681773e97d70519a80fd220d5d574da
---
M .travis.yml
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/78/388978/1

diff --git a/.travis.yml b/.travis.yml
index b39af3f..3d90b21 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -35,6 +35,8 @@
   php: 5.5
 - env: DBTYPE=sqlite; MW=1.26.0
   php: 5.3
+  dist: precise
+  sudo: required
 
 script:
 - bash ./build/travis/script.sh

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c3bdc304681773e97d70519a80fd220d5d574da
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: build: Adding MinusX

2017-11-04 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/388723 )

Change subject: build: Adding MinusX
..


build: Adding MinusX

Change-Id: Ib67be77fad03f6a70112c8fc8910a6becc1906d5
---
M composer.json
1 file changed, 17 insertions(+), 12 deletions(-)

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



diff --git a/composer.json b/composer.json
index 4808a3e..4ff653f 100644
--- a/composer.json
+++ b/composer.json
@@ -1,21 +1,21 @@
 {
-   "name"   : "mediawiki/lingo",
-   "type"   : "mediawiki-extension",
+   "name": "mediawiki/lingo",
+   "type": "mediawiki-extension",
"description": "Provides hover-over tool tips on wiki pages from terms 
defined on a wiki page",
-   "keywords"   : [
+   "keywords": [
"wiki",
"MediaWiki",
"extension",
"glossary",
"terminology"
],
-   "homepage"   : "https://www.mediawiki.org/wiki/Extension:Lingo;,
-   "license": "GPL-2.0+",
-   "authors": [
+   "homepage": "https://www.mediawiki.org/wiki/Extension:Lingo;,
+   "license": "GPL-2.0+",
+   "authors": [
{
-   "name" : "Stephan Gambke",
+   "name": "Stephan Gambke",
"email": "s7ep...@gmail.com",
-   "role" : "Developer"
+   "role": "Developer"
}
],
"support": {
@@ -25,19 +25,24 @@
"issues": 
"https://phabricator.wikimedia.org/tag/mediawiki-extensions-lingo/;,
"irc": "irc://irc.freenode.org/mediawiki"
},
-   "require": {
-   "php": ">=5.3.2",
+   "require": {
+   "php": ">=5.3.2",
"ext-dom": "*",
"composer/installers": ">1.0.12"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"justinrainbow/json-schema": ">=1.0",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.0"
},
"scripts": {
"test": [
-   "parallel-lint . --exclude vendor --exclude 
node_modules"
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
+   "minus-x check ."
+   ],
+   "fix": [
+   "minus-x fix ."
]
},
"suggest": {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib67be77fad03f6a70112c8fc8910a6becc1906d5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Foxtrott 
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] mediawiki...Lingo[master]: Release Lingo 2.0.3

2017-05-23 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/355367 )

Change subject: Release Lingo 2.0.3
..

Release Lingo 2.0.3

Change-Id: Id474675a8de17e4cc6a520282e8d1a8cd6c6f6c7
---
M docs/release-notes.md
M extension.json
2 files changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/67/355367/1

diff --git a/docs/release-notes.md b/docs/release-notes.md
index ea45eaf..8ffbfad 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -2,11 +2,12 @@
 
 ### Lingo 2.0.3
 
-Released on tbd
-
-Changes:
+Released on 24-May-2017
 
 Fixes:
+* Fix Fatal error: Call to undefined function Lingo\string()
+* Fixed broken Special:Preferences
+* Fixed missing link icon
 
 
 ### Lingo 2.0.2
diff --git a/extension.json b/extension.json
index ba888f5..56d5be5 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Lingo",
-   "version": "2.0.3-dev",
+   "version": "2.0.3",
"author": [
"Barry Coughlan",
"[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id474675a8de17e4cc6a520282e8d1a8cd6c6f6c7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Move registration of GetDoubleUnderscoreIDs

2017-05-23 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/355366 )

Change subject: Move registration of GetDoubleUnderscoreIDs
..

Move registration of GetDoubleUnderscoreIDs

Change-Id: I23634ddf3fd34c50cb474722e8ef8c5f308e6303
---
M extension.json
M src/Lingo.php
2 files changed, 6 insertions(+), 11 deletions(-)


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

diff --git a/extension.json b/extension.json
index 6f38e73..ba888f5 100644
--- a/extension.json
+++ b/extension.json
@@ -60,9 +60,6 @@
"ExtensionMessagesFiles": {
"LingoMagic": "src/Lingo.i18n.magic.php"
},
-   "Hooks": {
-   "GetDoubleUnderscoreIDs": 
"Lingo\\Lingo::onGetDoubleUnderscoreIDs"
-   },
"AutoloadClasses": {
"Lingo\\Lingo": "/src/Lingo.php",
"Lingo\\LingoParser": "/src/LingoParser.php",
diff --git a/src/Lingo.php b/src/Lingo.php
index 7bef973..ed043de 100644
--- a/src/Lingo.php
+++ b/src/Lingo.php
@@ -53,6 +53,11 @@
 
\Hooks::register( 'ParserAfterParse', array( $parser, 
'parse' ) );
 
+   \Hooks::register('GetDoubleUnderscoreIDs', function ( 
array &$doubleUnderscoreIDs ) {
+   $doubleUnderscoreIDs[] = 'noglossary';
+   return true;
+   } );
+
\Hooks::register( 'ParserFirstCallInit', function ( 
\Parser $parser ) {
 
$parser->setHook( 'noglossary', function ( 
$input, array $args, \Parser $parser, \PPFrame $frame ) {
@@ -73,16 +78,9 @@
}
}
 
+   return true;
} );
};
}
 
-   /**
-* Hook: GetDoubleUnderscoreIDs
-*
-* @param array $doubleUnderscoreIDs
-*/
-   public static function onGetDoubleUnderscoreIDs( array 
&$doubleUnderscoreIDs ) {
-   $doubleUnderscoreIDs[] = 'noglossary';
-   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I23634ddf3fd34c50cb474722e8ef8c5f308e6303
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Fixed broken Special:Preferences. Fixed missing link icon.

2017-05-23 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/355360 )

Change subject: Fixed broken Special:Preferences. Fixed missing link icon.
..

Fixed broken Special:Preferences. Fixed missing link icon.

* https://github.com/SemanticMediaWiki/SemanticGlossary/issues/25
* https://github.com/SemanticMediaWiki/SemanticGlossary/issues/24

Change-Id: I227cb67d7391b96e81bd75ff23fad2393300937f
---
M src/Element.php
M src/Lingo.php
M src/LingoParser.php
M styles/Lingo.css
4 files changed, 19 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/60/355360/1

diff --git a/src/Element.php b/src/Element.php
index 18fc24a..cef8d15 100644
--- a/src/Element.php
+++ b/src/Element.php
@@ -5,7 +5,7 @@
  *
  * This file is part of the MediaWiki extension Lingo.
  *
- * @copyright 2011 - 2016, Stephan Gambke
+ * @copyright 2011 - 2017, Stephan Gambke
  * @license   GNU General Public License, version 2 (or any later version)
  *
  * The Lingo extension is free software: you can redistribute it and/or modify
@@ -187,7 +187,7 @@
/**
 * @param Title $target
 * @param DOMElement $link
-* @return mixed
+* @return DOMElement
 */
protected function ( $target, &$link ) {
 
@@ -259,13 +259,9 @@
 
// create template if it does not yet exist
if ( $mLinkTemplate === null ) {
-   global $wgScriptPath;
-
-   $linkimage = $doc->createElement( 'img' );
-   $linkimage->setAttribute( 'src', $wgScriptPath . 
'/extensions/Lingo/styles/linkicon.png' );
 
$mLinkTemplate = $doc->createElement( 'a' );
-   $mLinkTemplate->appendChild( $linkimage );
+   $mLinkTemplate->setAttribute( 'class', 
'mw-lingo-tooltip-link');
 
$doc->stashSet( $mLinkTemplate, self::LINK_TEMPLATE_ID 
);
}
diff --git a/src/Lingo.php b/src/Lingo.php
index ec2df36..7bef973 100644
--- a/src/Lingo.php
+++ b/src/Lingo.php
@@ -4,7 +4,7 @@
  *
  * This file is part of the MediaWiki extension Lingo.
  *
- * @copyright 2011 - 2016, Stephan Gambke
+ * @copyright 2011 - 2017, Stephan Gambke
  * @license   GNU General Public License, version 2 (or any later version)
  *
  * The Lingo extension is free software: you can redistribute it and/or modify
@@ -63,17 +63,17 @@
return true;
} );
 
-   foreach ( $GLOBALS[ 'wgExtensionCredits' ][ 
'parserhook' ] as $index => $description ) {
+   \Hooks::register( 'SpecialPageBeforeExecute', function 
( \SpecialPage $specialPage, $subPage ) {
 
-   if ( $GLOBALS[ 'wgExtensionCredits' ][ 
'parserhook' ][ $index ][ 'name' ] === 'Lingo' ) {
-
-   $lingoPageName = $GLOBALS[ 
'wgexLingoPage' ] ? $GLOBALS[ 'wgexLingoPage' ] : wfMessage( 
'lingo-terminologypagename' )->inContentLanguage()->text();
-   $GLOBALS[ 'wgExtensionCredits' ][ 
'parserhook' ][ $index ][ 'description' ] = wfMessage( 'lingo-desc', 
$lingoPageName )->inContentLanguage()->text();
-
-   break;
+   if ( $specialPage instanceof \SpecialVersion ) {
+   foreach ( $GLOBALS[ 
'wgExtensionCredits' ][ 'parserhook' ] as $index => $description ) {
+   if ( $GLOBALS[ 
'wgExtensionCredits' ][ 'parserhook' ][ $index ][ 'name' ] === 'Lingo' ) {
+   $GLOBALS[ 
'wgExtensionCredits' ][ 'parserhook' ][ $index ][ 'description' ] = wfMessage( 
'lingo-desc', $GLOBALS[ 'wgexLingoPage' ] ?: wfMessage( 
'lingo-terminologypagename' )->inContentLanguage()->text() )->text();
+   }
+   }
}
 
-   }
+   } );
};
}
 
diff --git a/src/LingoParser.php b/src/LingoParser.php
index f488162..aab27f2 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -235,7 +235,7 @@
\MediaWiki\restoreWarnings();
 
// Find all text in HTML.
-   $xpath = new DOMXpath( $doc );
+   $xpath = new DOMXPath( $doc );
$elements = $xpath->query(
"//*[not(ancestor-or-self::*[@class='noglossary'] or 
ancestor-or-self::a)][text()!=' ']/text()"
);
diff --git a/styles/Lingo.css b/styles/Lingo.css
index a2ed51e..00816e4 100644
--- a/styles/Lingo.css
+++ b/styles/Lingo.css
@@ -3,7 +3,7 @@
  *
  * This file is part of the MediaWiki extension Lingo.
  *
- * @copyright 2011 - 2016, 

[MediaWiki-commits] [Gerrit] mediawiki...DataTransfer[master]: Add styling to summary input

2017-05-11 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/353303 )

Change subject: Add styling to summary input
..

Add styling to summary input

Change-Id: I18b732280084d54c30878d834ac3a36343174f63
---
M DataTransfer.php
M specials/DT_ImportCSV.php
2 files changed, 8 insertions(+), 1 deletion(-)


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

diff --git a/DataTransfer.php b/DataTransfer.php
index 84348e2..16253c6 100644
--- a/DataTransfer.php
+++ b/DataTransfer.php
@@ -24,13 +24,19 @@
 );
 
 ###
-# This is the path to your installation of Semantic Forms as
+# This is the path to your installation of DataTransfer as
 # seen on your local filesystem. Used against some PHP file path
 # issues.
 ##
 $dtgIP = dirname( __FILE__ );
 ##
 
+$wgResourceModules[ 'ext.datatransfer' ] = array(
+'localBasePath' => $dtgIP,
+'styles' => 'styles/DataTransfer.css',
+'position' => 'bottom',
+);
+
 // register all special pages and other classes
 $wgAutoloadClasses['DTPageStructure'] = $dtgIP . 
'/includes/DT_PageStructure.php';
 $wgAutoloadClasses['DTPageComponent'] = $dtgIP . 
'/includes/DT_PageStructure.php';
diff --git a/specials/DT_ImportCSV.php b/specials/DT_ImportCSV.php
index 332224e..71c5651 100644
--- a/specials/DT_ImportCSV.php
+++ b/specials/DT_ImportCSV.php
@@ -31,6 +31,7 @@
$text = $this->printForm();
}
 
+   $this->getOutput()->addModuleStyles( 'ext.datatransfer');
$this->getOutput()->addHTML( $text );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I18b732280084d54c30878d834ac3a36343174f63
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DataTransfer
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Fix Fatal error: Call to undefined function Lingo\string()

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

Change subject: Fix Fatal error: Call to undefined function Lingo\string()
..

Fix Fatal error: Call to undefined function Lingo\string()

Change-Id: Ib969467ecfe9c352614675ad6c53a37571311747
---
M src/Element.php
1 file changed, 16 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/84/352284/1

diff --git a/src/Element.php b/src/Element.php
index b17f639..18fc24a 100644
--- a/src/Element.php
+++ b/src/Element.php
@@ -141,7 +141,7 @@
$link = $doc->createElement( 'a', $this->mDefinitions[ 0 ][ 
self::ELEMENT_TERM ] );
 
// set the link target
-   $link->setAttribute( 'href', $target->getLinkUrl() );
+   $link->setAttribute( 'href', $target->getLinkURL() );
 
 
$link = $this->addClassAttributeToLink( $target, $link );
@@ -151,9 +151,9 @@
}
 
/**
-* @param $target
-* @param $link
-* @return mixed
+* @param Title $target
+* @param DOMElement $link
+* @return DOMElement
 */
protected function ( $target, &$link ) {
 
@@ -163,28 +163,30 @@
// part here.
 
// set style
-   $classes = string( $this->mDefinitions[ 0 ][ 
self::ELEMENT_STYLE ] );
+   $classes = array();
+
+   if ( $this->mDefinitions[ 0 ][ self::ELEMENT_STYLE ] !== null ) 
{
+   $classes[] = $this->mDefinitions[ 0 ][ 
self::ELEMENT_STYLE ];
+   }
 
if ( !$target->isKnown() ) {
-   $classes .= ' new';
+   $classes[] = 'new';
}
 
if ( $target->isExternal() ) {
-   $classes .= ' extiw';
+   $classes[] = 'extiw';
}
 
-   $classes = trim( $classes );
-
-   if ( $classes !== '' ) {
-   $link->setAttribute( 'class', $classes );
+   if ( count($classes) > 0 ) {
+   $link->setAttribute( 'class', join(' ', $classes ) );
}
 
return $link;
}
 
/**
-* @param $target
-* @param $link
+* @param Title $target
+* @param DOMElement $link
 * @return mixed
 */
protected function ( $target, &$link ) {
@@ -203,7 +205,7 @@
 
/**
 * @param StashingDOMDocument $doc
-* @return string
+* @return DOMElement
 * @throws \MWException
 */
protected function getFullDefinitionAsTooltip( StashingDOMDocument 
&$doc ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib969467ecfe9c352614675ad6c53a37571311747
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Start next version

2017-05-03 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/351732 )

Change subject: Start next version
..


Start next version

Change-Id: I47ebb09e4fb0966481bbb57d8fd80f3d7be3594c
---
M docs/release-notes.md
M extension.json
2 files changed, 11 insertions(+), 2 deletions(-)

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



diff --git a/docs/release-notes.md b/docs/release-notes.md
index 76f76ef..ea45eaf 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -1,8 +1,17 @@
 ## Release Notes
 
+### Lingo 2.0.3
+
+Released on tbd
+
+Changes:
+
+Fixes:
+
+
 ### Lingo 2.0.2
 
-Released on 3-May-2017
+Released on 03-May-2017
 
 Changes:
 * Update Readme for changes in customization procedure
diff --git a/extension.json b/extension.json
index 4e3ce12..6f38e73 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Lingo",
-   "version": "2.0.2",
+   "version": "2.0.3-dev",
"author": [
"Barry Coughlan",
"[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I47ebb09e4fb0966481bbb57d8fd80f3d7be3594c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Start next version

2017-05-03 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351732 )

Change subject: Start next version
..

Start next version

Change-Id: I47ebb09e4fb0966481bbb57d8fd80f3d7be3594c
---
M docs/release-notes.md
M extension.json
2 files changed, 11 insertions(+), 2 deletions(-)


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

diff --git a/docs/release-notes.md b/docs/release-notes.md
index 76f76ef..ea45eaf 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -1,8 +1,17 @@
 ## Release Notes
 
+### Lingo 2.0.3
+
+Released on tbd
+
+Changes:
+
+Fixes:
+
+
 ### Lingo 2.0.2
 
-Released on 3-May-2017
+Released on 03-May-2017
 
 Changes:
 * Update Readme for changes in customization procedure
diff --git a/extension.json b/extension.json
index 4e3ce12..6f38e73 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Lingo",
-   "version": "2.0.2",
+   "version": "2.0.3-dev",
"author": [
"Barry Coughlan",
"[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47ebb09e4fb0966481bbb57d8fd80f3d7be3594c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Release Lingo 2.0.2

2017-05-03 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/351725 )

Change subject: Release Lingo 2.0.2
..


Release Lingo 2.0.2

Change-Id: Iafea336b55c9a5f8cb70f268bcc5fce71f7778c5
---
M build/travis/script.sh
M docs/release-notes.md
M extension.json
M tests/phpunit/Unit/BackendTest.php
M tests/phpunit/Unit/BasicBackendTest.php
5 files changed, 15 insertions(+), 7 deletions(-)

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



diff --git a/build/travis/script.sh b/build/travis/script.sh
index 2adafa1..5af5128 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -86,7 +86,7 @@
 function installExtensionViaComposerOnMediaWikiRoot {
 
# fix setup for older MW versions and install extension
-   composer require --prefer-source --dev --update-with-dependencies 
"phpunit/phpunit:~4.0" "justinrainbow/json-schema:~3.0" 
"mediawiki/lingo:dev-master"
+   composer require --prefer-source --dev --update-with-dependencies 
"phpunit/phpunit:~4.0" "mediawiki/lingo:dev-master"
 
cd extensions/Lingo
 
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 71219e1..76f76ef 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -2,13 +2,21 @@
 
 ### Lingo 2.0.2
 
-Released on tbd
+Released on 3-May-2017
 
 Changes:
-
+* Update Readme for changes in customization procedure
+* Removed usage of deprecated MediaWiki features
+* Fix and add more tests
+* Some reworking of BasicBackend and LingoParser
+* Use PageContentSave hook for cache purging (instead of ArticleSave)
+* Use GetDoubleUnderscoreIDs hook
 
 Fixes:
-
+* Add page position 'bottom' for loading of ext.Lingo.Scripts module
+* Replace unsupported function calls in ArticleAnnotationTest
+* Fixed noglossary tag hook
+* Fixed language of extension description in Special:Version
 
 ### Lingo 2.0.1
 
diff --git a/extension.json b/extension.json
index e979b51..4e3ce12 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Lingo",
-   "version": "2.0.2-dev",
+   "version": "2.0.2",
"author": [
"Barry Coughlan",
"[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]",
diff --git a/tests/phpunit/Unit/BackendTest.php 
b/tests/phpunit/Unit/BackendTest.php
index dc6596e..b78c68d 100644
--- a/tests/phpunit/Unit/BackendTest.php
+++ b/tests/phpunit/Unit/BackendTest.php
@@ -2,7 +2,7 @@
 /**
  * This file is part of the MediaWiki extension Lingo.
  *
- * @copyright 2011 - 2016, Stephan Gambke
+ * @copyright 2011 - 2017, Stephan Gambke
  * @license   GNU General Public License, version 2 (or any later version)
  *
  * The Lingo extension is free software: you can redistribute it and/or modify
diff --git a/tests/phpunit/Unit/BasicBackendTest.php 
b/tests/phpunit/Unit/BasicBackendTest.php
index a3eb9d4..bc29535 100644
--- a/tests/phpunit/Unit/BasicBackendTest.php
+++ b/tests/phpunit/Unit/BasicBackendTest.php
@@ -2,7 +2,7 @@
 /**
  * This file is part of the MediaWiki extension Lingo.
  *
- * @copyright 2011 - 2016, Stephan Gambke
+ * @copyright 2011 - 2017, Stephan Gambke
  * @license   GNU General Public License, version 2 (or any later version)
  *
  * The Lingo extension is free software: you can redistribute it and/or modify

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iafea336b55c9a5f8cb70f268bcc5fce71f7778c5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Release Lingo 2.0.2

2017-05-03 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351725 )

Change subject: Release Lingo 2.0.2
..

Release Lingo 2.0.2

Change-Id: Iafea336b55c9a5f8cb70f268bcc5fce71f7778c5
---
M build/travis/script.sh
M docs/release-notes.md
M extension.json
M tests/phpunit/Unit/BackendTest.php
M tests/phpunit/Unit/BasicBackendTest.php
5 files changed, 15 insertions(+), 7 deletions(-)


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

diff --git a/build/travis/script.sh b/build/travis/script.sh
index 2adafa1..5af5128 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -86,7 +86,7 @@
 function installExtensionViaComposerOnMediaWikiRoot {
 
# fix setup for older MW versions and install extension
-   composer require --prefer-source --dev --update-with-dependencies 
"phpunit/phpunit:~4.0" "justinrainbow/json-schema:~3.0" 
"mediawiki/lingo:dev-master"
+   composer require --prefer-source --dev --update-with-dependencies 
"phpunit/phpunit:~4.0" "mediawiki/lingo:dev-master"
 
cd extensions/Lingo
 
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 71219e1..76f76ef 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -2,13 +2,21 @@
 
 ### Lingo 2.0.2
 
-Released on tbd
+Released on 3-May-2017
 
 Changes:
-
+* Update Readme for changes in customization procedure
+* Removed usage of deprecated MediaWiki features
+* Fix and add more tests
+* Some reworking of BasicBackend and LingoParser
+* Use PageContentSave hook for cache purging (instead of ArticleSave)
+* Use GetDoubleUnderscoreIDs hook
 
 Fixes:
-
+* Add page position 'bottom' for loading of ext.Lingo.Scripts module
+* Replace unsupported function calls in ArticleAnnotationTest
+* Fixed noglossary tag hook
+* Fixed language of extension description in Special:Version
 
 ### Lingo 2.0.1
 
diff --git a/extension.json b/extension.json
index e979b51..4e3ce12 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Lingo",
-   "version": "2.0.2-dev",
+   "version": "2.0.2",
"author": [
"Barry Coughlan",
"[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]",
diff --git a/tests/phpunit/Unit/BackendTest.php 
b/tests/phpunit/Unit/BackendTest.php
index dc6596e..b78c68d 100644
--- a/tests/phpunit/Unit/BackendTest.php
+++ b/tests/phpunit/Unit/BackendTest.php
@@ -2,7 +2,7 @@
 /**
  * This file is part of the MediaWiki extension Lingo.
  *
- * @copyright 2011 - 2016, Stephan Gambke
+ * @copyright 2011 - 2017, Stephan Gambke
  * @license   GNU General Public License, version 2 (or any later version)
  *
  * The Lingo extension is free software: you can redistribute it and/or modify
diff --git a/tests/phpunit/Unit/BasicBackendTest.php 
b/tests/phpunit/Unit/BasicBackendTest.php
index a3eb9d4..bc29535 100644
--- a/tests/phpunit/Unit/BasicBackendTest.php
+++ b/tests/phpunit/Unit/BasicBackendTest.php
@@ -2,7 +2,7 @@
 /**
  * This file is part of the MediaWiki extension Lingo.
  *
- * @copyright 2011 - 2016, Stephan Gambke
+ * @copyright 2011 - 2017, Stephan Gambke
  * @license   GNU General Public License, version 2 (or any later version)
  *
  * The Lingo extension is free software: you can redistribute it and/or modify

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafea336b55c9a5f8cb70f268bcc5fce71f7778c5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Add Travis config for PHP 7

2017-05-03 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/351718 )

Change subject: Add Travis config for PHP 7
..


Add Travis config for PHP 7

Change-Id: Ia7a0898a2074a4f99b7ebfc99f7ca1fc933e2d97
---
M .travis.yml
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/.travis.yml b/.travis.yml
index 1aa7b12..b39af3f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -28,6 +28,8 @@
 matrix:
   include:
 - env: DBTYPE=mysql; MW=master
+  php: 7.0
+- env: DBTYPE=mysql; MW=1.28.0
   php: 5.6
 - env: DBTYPE=postgres; MW=1.26.2
   php: 5.5

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia7a0898a2074a4f99b7ebfc99f7ca1fc933e2d97
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Add Travis config for PHP 7

2017-05-03 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351718 )

Change subject: Add Travis config for PHP 7
..

Add Travis config for PHP 7

Change-Id: Ia7a0898a2074a4f99b7ebfc99f7ca1fc933e2d97
---
M .travis.yml
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/.travis.yml b/.travis.yml
index 1aa7b12..b39af3f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -28,6 +28,8 @@
 matrix:
   include:
 - env: DBTYPE=mysql; MW=master
+  php: 7.0
+- env: DBTYPE=mysql; MW=1.28.0
   php: 5.6
 - env: DBTYPE=postgres; MW=1.26.2
   php: 5.5

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7a0898a2074a4f99b7ebfc99f7ca1fc933e2d97
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Accept any JsonSchema >= 1.0 (+ fix tests)

2017-05-03 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/351715 )

Change subject: Accept any JsonSchema >= 1.0 (+ fix tests)
..


Accept any JsonSchema >= 1.0 (+ fix tests)

MW changes the JsonSchema version so often that it is pointless to
release a new Lingo version every time just to keep up.

* just accept any JsonSchema version >= 1.0
* instead add a test that class \JsonSchema\Validator wit method 'check' exists
* (+ fix tests for PHP 7)

Change-Id: I011232bacffc46d18233befcbc26cfc8a1b0257e
---
M composer.json
M src/Lingo.php
M src/LingoParser.php
M tests/phpunit/Unit/BackendTest.php
M tests/phpunit/Unit/BasicBackendTest.php
M tests/phpunit/Unit/LingoI18NTest.php
6 files changed, 11 insertions(+), 12 deletions(-)

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



diff --git a/composer.json b/composer.json
index b654c59..7abe331 100644
--- a/composer.json
+++ b/composer.json
@@ -28,11 +28,11 @@
"require": {
"php": ">=5.3.2",
"ext-dom": "*",
-   "composer/installers": ">1.0.12",
-   "justinrainbow/json-schema": "~3.0"
+   "composer/installers": ">1.0.12"
},
"require-dev": {
-   "jakub-onderka/php-parallel-lint": "0.9.2"
+   "jakub-onderka/php-parallel-lint": "0.9.2",
+   "justinrainbow/json-schema": ">=1.0"
},
"scripts": {
"test": [
diff --git a/src/Lingo.php b/src/Lingo.php
index 55fe7cf..ec2df36 100644
--- a/src/Lingo.php
+++ b/src/Lingo.php
@@ -25,7 +25,6 @@
  */
 
 namespace Lingo;
-use MagicWord;
 
 /**
  * Class Lingo
diff --git a/src/LingoParser.php b/src/LingoParser.php
index 5de6d42..f488162 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -28,7 +28,6 @@
  */
 namespace Lingo;
 
-use DOMDocument;
 use DOMXPath;
 use Parser;
 
diff --git a/tests/phpunit/Unit/BackendTest.php 
b/tests/phpunit/Unit/BackendTest.php
index 2d06d78..dc6596e 100644
--- a/tests/phpunit/Unit/BackendTest.php
+++ b/tests/phpunit/Unit/BackendTest.php
@@ -47,7 +47,6 @@
public function testGetMessageLog_withLogGivenToConstructor() {
 
$log = $this->getMock( '\Lingo\MessageLog' );
-   $logRef = &$log;
 
$stub = $this->getMockBuilder( '\Lingo\Backend' )
->disableOriginalConstructor()
@@ -55,7 +54,7 @@
 
$reflected = new \ReflectionClass( '\Lingo\Backend' );
$constructor = $reflected->getConstructor();
-   $constructor->invoke( $stub, $logRef );
+   $constructor->invokeArgs( $stub, array( &$log ) );
 
$this->assertEquals( $log, $stub->getMessageLog() );
}
diff --git a/tests/phpunit/Unit/BasicBackendTest.php 
b/tests/phpunit/Unit/BasicBackendTest.php
index f622880..a3eb9d4 100644
--- a/tests/phpunit/Unit/BasicBackendTest.php
+++ b/tests/phpunit/Unit/BasicBackendTest.php
@@ -299,7 +299,6 @@
 */
protected function getTestObject( $lingoPageText = '', $action = 
'view', $interwiki = '', $lingoPageRevision = false, $lingoPageContent = false, 
$lingoApprovedText = '' ) {
$messageLog = $this->getMock( 'Lingo\MessageLog' );
-   $messageLogRef =& $messageLog;
 
$backend = $this->getMockBuilder( 'Lingo\BasicBackend' )
->disableOriginalConstructor()
@@ -312,7 +311,7 @@
 
$reflected = new \ReflectionClass( '\Lingo\BasicBackend' );
$constructor = $reflected->getConstructor();
-   $constructor->invoke( $backend, $messageLogRef );
+   $constructor->invokeArgs( $backend, array( &$messageLog ) );
 
$GLOBALS[ 'wgLingoPageName' ] = 'SomePage';
 
diff --git a/tests/phpunit/Unit/LingoI18NTest.php 
b/tests/phpunit/Unit/LingoI18NTest.php
index 3f3174a..af5c114 100644
--- a/tests/phpunit/Unit/LingoI18NTest.php
+++ b/tests/phpunit/Unit/LingoI18NTest.php
@@ -26,8 +26,6 @@
 
 namespace Lingo\Tests\Unit;
 
-use JsonSchema\Validator;
-
 /**
  * @group extensions-lingo
  * @group extensions-lingo-unit
@@ -37,6 +35,11 @@
  * @ingroup Test
  */
 class LingoI18NTest extends \PHPUnit_Framework_TestCase {
+
+   public function testJsonSchemaValidatorExists(){
+   $this->assertTrue( class_exists( '\JsonSchema\Validator' ) );
+   $this->assertTrue( method_exists('\JsonSchema\Validator', 
'check' ) );
+   }
 
public function testMagicWordsLoaded() {
 
@@ -51,7 +54,7 @@
 
$data = json_decode( json_encode( $defined_vars[ 'magicWords' ] 
) );
 
-   $validator = new Validator();
+   $validator = new \JsonSchema\Validator();
$validator->check( $data, (object) array( '$ref' =>
'file://' . realpath( __DIR__ . 
'/../Fixture/magicWordsSchema.json' ) ) );
 

-- 

[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Accept any JsonSchema >= 1.0 (+ fix tests)

2017-05-03 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351715 )

Change subject: Accept any JsonSchema >= 1.0 (+ fix tests)
..

Accept any JsonSchema >= 1.0 (+ fix tests)

MW changes the JsonSchema version so often that it is pointless to
release a new Lingo version every time just to keep up.

* just accept any JsonSchema version >= 1.0
* instead add a test that class \JsonSchema\Validator wit method 'check' exists
* (+ fix tests for PHP 7)

Change-Id: I011232bacffc46d18233befcbc26cfc8a1b0257e
---
M composer.json
M src/Lingo.php
M src/LingoParser.php
M tests/phpunit/Unit/BackendTest.php
M tests/phpunit/Unit/BasicBackendTest.php
M tests/phpunit/Unit/LingoI18NTest.php
6 files changed, 11 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/15/351715/1

diff --git a/composer.json b/composer.json
index b654c59..7abe331 100644
--- a/composer.json
+++ b/composer.json
@@ -28,11 +28,11 @@
"require": {
"php": ">=5.3.2",
"ext-dom": "*",
-   "composer/installers": ">1.0.12",
-   "justinrainbow/json-schema": "~3.0"
+   "composer/installers": ">1.0.12"
},
"require-dev": {
-   "jakub-onderka/php-parallel-lint": "0.9.2"
+   "jakub-onderka/php-parallel-lint": "0.9.2",
+   "justinrainbow/json-schema": ">=1.0"
},
"scripts": {
"test": [
diff --git a/src/Lingo.php b/src/Lingo.php
index 55fe7cf..ec2df36 100644
--- a/src/Lingo.php
+++ b/src/Lingo.php
@@ -25,7 +25,6 @@
  */
 
 namespace Lingo;
-use MagicWord;
 
 /**
  * Class Lingo
diff --git a/src/LingoParser.php b/src/LingoParser.php
index 5de6d42..f488162 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -28,7 +28,6 @@
  */
 namespace Lingo;
 
-use DOMDocument;
 use DOMXPath;
 use Parser;
 
diff --git a/tests/phpunit/Unit/BackendTest.php 
b/tests/phpunit/Unit/BackendTest.php
index 2d06d78..dc6596e 100644
--- a/tests/phpunit/Unit/BackendTest.php
+++ b/tests/phpunit/Unit/BackendTest.php
@@ -47,7 +47,6 @@
public function testGetMessageLog_withLogGivenToConstructor() {
 
$log = $this->getMock( '\Lingo\MessageLog' );
-   $logRef = &$log;
 
$stub = $this->getMockBuilder( '\Lingo\Backend' )
->disableOriginalConstructor()
@@ -55,7 +54,7 @@
 
$reflected = new \ReflectionClass( '\Lingo\Backend' );
$constructor = $reflected->getConstructor();
-   $constructor->invoke( $stub, $logRef );
+   $constructor->invokeArgs( $stub, array( &$log ) );
 
$this->assertEquals( $log, $stub->getMessageLog() );
}
diff --git a/tests/phpunit/Unit/BasicBackendTest.php 
b/tests/phpunit/Unit/BasicBackendTest.php
index f622880..a3eb9d4 100644
--- a/tests/phpunit/Unit/BasicBackendTest.php
+++ b/tests/phpunit/Unit/BasicBackendTest.php
@@ -299,7 +299,6 @@
 */
protected function getTestObject( $lingoPageText = '', $action = 
'view', $interwiki = '', $lingoPageRevision = false, $lingoPageContent = false, 
$lingoApprovedText = '' ) {
$messageLog = $this->getMock( 'Lingo\MessageLog' );
-   $messageLogRef =& $messageLog;
 
$backend = $this->getMockBuilder( 'Lingo\BasicBackend' )
->disableOriginalConstructor()
@@ -312,7 +311,7 @@
 
$reflected = new \ReflectionClass( '\Lingo\BasicBackend' );
$constructor = $reflected->getConstructor();
-   $constructor->invoke( $backend, $messageLogRef );
+   $constructor->invokeArgs( $backend, array( &$messageLog ) );
 
$GLOBALS[ 'wgLingoPageName' ] = 'SomePage';
 
diff --git a/tests/phpunit/Unit/LingoI18NTest.php 
b/tests/phpunit/Unit/LingoI18NTest.php
index 3f3174a..af5c114 100644
--- a/tests/phpunit/Unit/LingoI18NTest.php
+++ b/tests/phpunit/Unit/LingoI18NTest.php
@@ -26,8 +26,6 @@
 
 namespace Lingo\Tests\Unit;
 
-use JsonSchema\Validator;
-
 /**
  * @group extensions-lingo
  * @group extensions-lingo-unit
@@ -37,6 +35,11 @@
  * @ingroup Test
  */
 class LingoI18NTest extends \PHPUnit_Framework_TestCase {
+
+   public function testJsonSchemaValidatorExists(){
+   $this->assertTrue( class_exists( '\JsonSchema\Validator' ) );
+   $this->assertTrue( method_exists('\JsonSchema\Validator', 
'check' ) );
+   }
 
public function testMagicWordsLoaded() {
 
@@ -51,7 +54,7 @@
 
$data = json_decode( json_encode( $defined_vars[ 'magicWords' ] 
) );
 
-   $validator = new Validator();
+   $validator = new \JsonSchema\Validator();
$validator->check( $data, (object) array( '$ref' =>
'file://' . realpath( __DIR__ . 

[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Update Readme for Customization changes with extension.json

2017-02-03 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/335950 )

Change subject: Update Readme for Customization changes with extension.json
..


Update Readme for Customization changes with extension.json

Have to use a hook now.

Change-Id: I4d48aeb301c3cb68c99f0d9613dc0db4cc574253
---
M README.md
1 file changed, 18 insertions(+), 10 deletions(-)

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



diff --git a/README.md b/README.md
index cc3de9e..eda9706 100644
--- a/README.md
+++ b/README.md
@@ -45,20 +45,28 @@
 
 ## Customization
 
-The following settings may be used:
+Add the following to `LocalSettings.php` and uncomment/modify as needed:
 
-* `$wgexLingoPage` to specify the name of the terminology page
-  Example: `$wgexLingoPage = 'Glossary'`;
+```php
+$wgHooks['SetupAfterCache'][] = function() {
 
-* `$wgexLingoDisplayOnce` to specify that each term should be annotated only
-  once per page
-  Example: `$wgexLingoDisplayOnce = true`;
+// specify a different name for the terminology page (Default: 
'Terminology' (or localised version). See MediaWiki:Lingo-terminologypagename.)
+//$GLOBALS['wgexLingoPage'] = 'Terminology';
 
-* `$wgexLingoUseNamespaces` to specify what namespaces should or should not be
-  used
-  Example: `$wgexLingoUseNamespaces[NS_TALK] = false`;
+// specify that each term should be annotated only once per page (Default: 
false)
+//$GLOBALS['wgexLingoDisplayOnce'] = false;
 
-If you want to use these settings, just include them in LocalSettings.php.
+// specify what namespaces should or should not be used (Default: Empty, 
i.e. use all namespaces)
+//$GLOBALS['wgexLingoUseNamespaces'][NS_SPECIAL] = false;
+
+// set default cache type (Default: null, i.e. use main cache)
+//$GLOBALS['wgexLingoCacheType'] = CACHE_NONE;
+
+// use ApprovedRevs extension on the Terminology page (Default: false)
+//$GLOBALS['wgexLingoEnableApprovedRevs'] = true;
+
+};
+```
 
 ## Usage
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4d48aeb301c3cb68c99f0d9613dc0db4cc574253
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Update Readme for Customization changes with extension.json

2017-02-03 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335950 )

Change subject: Update Readme for Customization changes with extension.json
..

Update Readme for Customization changes with extension.json

Have to use a hook now.

Change-Id: I4d48aeb301c3cb68c99f0d9613dc0db4cc574253
---
M README.md
1 file changed, 18 insertions(+), 10 deletions(-)


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

diff --git a/README.md b/README.md
index cc3de9e..eda9706 100644
--- a/README.md
+++ b/README.md
@@ -45,20 +45,28 @@
 
 ## Customization
 
-The following settings may be used:
+Add the following to `LocalSettings.php` and uncomment/modify as needed:
 
-* `$wgexLingoPage` to specify the name of the terminology page
-  Example: `$wgexLingoPage = 'Glossary'`;
+```php
+$wgHooks['SetupAfterCache'][] = function() {
 
-* `$wgexLingoDisplayOnce` to specify that each term should be annotated only
-  once per page
-  Example: `$wgexLingoDisplayOnce = true`;
+// specify a different name for the terminology page (Default: 
'Terminology' (or localised version). See MediaWiki:Lingo-terminologypagename.)
+//$GLOBALS['wgexLingoPage'] = 'Terminology';
 
-* `$wgexLingoUseNamespaces` to specify what namespaces should or should not be
-  used
-  Example: `$wgexLingoUseNamespaces[NS_TALK] = false`;
+// specify that each term should be annotated only once per page (Default: 
false)
+//$GLOBALS['wgexLingoDisplayOnce'] = false;
 
-If you want to use these settings, just include them in LocalSettings.php.
+// specify what namespaces should or should not be used (Default: Empty, 
i.e. use all namespaces)
+//$GLOBALS['wgexLingoUseNamespaces'][NS_SPECIAL] = false;
+
+// set default cache type (Default: null, i.e. use main cache)
+//$GLOBALS['wgexLingoCacheType'] = CACHE_NONE;
+
+// use ApprovedRevs extension on the Terminology page (Default: false)
+//$GLOBALS['wgexLingoEnableApprovedRevs'] = true;
+
+};
+```
 
 ## Usage
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d48aeb301c3cb68c99f0d9613dc0db4cc574253
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Add position for ext.Lingo.Scripts module

2016-10-08 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Add position for ext.Lingo.Scripts module
..

Add position for ext.Lingo.Scripts module

Change-Id: I9237beb2bfc048b5af132c8246959484c0b88fc4
---
M extension.json
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/extension.json b/extension.json
index 3d9ca13..e4c0753 100644
--- a/extension.json
+++ b/extension.json
@@ -30,7 +30,8 @@
],
"dependencies": [
"ext.jquery.qtip"
-   ]
+   ],
+   "position": "bottom"
},
"ext.jquery.qtip": {
"scripts": [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9237beb2bfc048b5af132c8246959484c0b88fc4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Bootstrap[master]: Change required package: twitter/bootstrap -> twbs/bootstrap

2016-10-08 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Change required package: twitter/bootstrap -> twbs/bootstrap
..

Change required package: twitter/bootstrap -> twbs/bootstrap

Change-Id: I8dd1c863b6b5ac1826e236f0cc64b785fccbf3a5
---
M Bootstrap.php
M composer.json
M tests/phpunit/Hooks/SetupAfterCacheTest.php
3 files changed, 5 insertions(+), 5 deletions(-)


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

diff --git a/Bootstrap.php b/Bootstrap.php
index ad2ee52..a7deeae 100644
--- a/Bootstrap.php
+++ b/Bootstrap.php
@@ -49,7 +49,7 @@
/**
 * The extension version
 */
-   define( 'BS_VERSION', '1.1.5' );
+   define( 'BS_VERSION', '1.2-alpha' );
 
// register the extension
$GLOBALS[ 'wgExtensionCredits' ][ 'other' ][ ] = array(
@@ -77,8 +77,8 @@
 
$configuration = array();
$configuration[ 'IP' ] = $GLOBALS[ 'IP' ];
-   $configuration[ 'localBasePath' ] = $GLOBALS[ 'IP' ] . 
'/vendor/twitter/bootstrap';
-   $configuration[ 'remoteBasePath' ] = $GLOBALS[ 'wgScriptPath' ] 
. '/vendor/twitter/bootstrap';
+   $configuration[ 'localBasePath' ] = $GLOBALS[ 'IP' ] . 
'/vendor/twbs/bootstrap';
+   $configuration[ 'remoteBasePath' ] = $GLOBALS[ 'wgScriptPath' ] 
. '/vendor/twbs/bootstrap';
 
$setupAfterCache = new \Bootstrap\Hooks\SetupAfterCache( 
$configuration );
$setupAfterCache->process();
diff --git a/composer.json b/composer.json
index efebe25..7879ba2 100644
--- a/composer.json
+++ b/composer.json
@@ -29,7 +29,7 @@
"php": ">=5.3.0",
"composer/installers": "1.*,>=1.0.1",
"oyejorge/less.php"  : "~1.0,>=1.7.0.9",
-   "twitter/bootstrap"  : "~3.0"
+   "twbs/bootstrap"  : "~3.0"
},
"autoload"   : {
"files": [
diff --git a/tests/phpunit/Hooks/SetupAfterCacheTest.php 
b/tests/phpunit/Hooks/SetupAfterCacheTest.php
index 76125c2..4c40f9e 100644
--- a/tests/phpunit/Hooks/SetupAfterCacheTest.php
+++ b/tests/phpunit/Hooks/SetupAfterCacheTest.php
@@ -24,7 +24,7 @@
 
protected function setUp() {
parent::setUp();
-   $this->localBootstrapVendorPath = __DIR__ . 
'/../../../../../vendor/twitter/bootstrap';
+   $this->localBootstrapVendorPath = __DIR__ . 
'/../../../../../vendor/twbs/bootstrap';
}
 
public function testCanConstruct() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8dd1c863b6b5ac1826e236f0cc64b785fccbf3a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Bootstrap
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Fix test setup for older MW versions

2016-10-07 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Fix test setup for older MW versions
..

Fix test setup for older MW versions

Change-Id: I62f4ba278ff25f204481afc46c55e6bee4fe7abf
---
M build/travis/script.sh
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/84/314784/1

diff --git a/build/travis/script.sh b/build/travis/script.sh
index b882790..2adafa1 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -85,7 +85,8 @@
 
 function installExtensionViaComposerOnMediaWikiRoot {
 
-   composer require --prefer-source --dev --update-with-dependencies 
"phpunit/phpunit:~4.0" "mediawiki/lingo:dev-master"
+   # fix setup for older MW versions and install extension
+   composer require --prefer-source --dev --update-with-dependencies 
"phpunit/phpunit:~4.0" "justinrainbow/json-schema:~3.0" 
"mediawiki/lingo:dev-master"
 
cd extensions/Lingo
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I62f4ba278ff25f204481afc46c55e6bee4fe7abf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Use lingo:dev-master in Travis' install script

2016-10-07 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Use lingo:dev-master in Travis' install script
..

Use lingo:dev-master in Travis' install script

Change-Id: I8d79bd8c74a228ba627484a1ccf02a43891f6679
---
M build/travis/script.sh
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/build/travis/script.sh b/build/travis/script.sh
index 17d9cd7..b882790 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -85,7 +85,7 @@
 
 function installExtensionViaComposerOnMediaWikiRoot {
 
-   composer require --prefer-source --dev --update-with-dependencies 
'phpunit/phpunit=~4.0' 'mediawiki/lingo=@dev'
+   composer require --prefer-source --dev --update-with-dependencies 
"phpunit/phpunit:~4.0" "mediawiki/lingo:dev-master"
 
cd extensions/Lingo
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d79bd8c74a228ba627484a1ccf02a43891f6679
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] mediawiki...chameleon[master]: Release Chameleon 1.4

2016-09-20 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Release Chameleon 1.4
..

Release Chameleon 1.4

Change-Id: Icdc98fe3f54ae2ec290aef6a696f9d5c1e454581
---
M Chameleon.php
M docs/release-notes.md
M resources/styles/Components/NavbarHorizontal.less
3 files changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/chameleon 
refs/changes/55/311755/1

diff --git a/Chameleon.php b/Chameleon.php
index fd0495a..43afb0e 100644
--- a/Chameleon.php
+++ b/Chameleon.php
@@ -47,7 +47,7 @@
}
 
// define the skin's version
-   define( 'CHAMELEON_VERSION', '1.4-alpha' );
+   define( 'CHAMELEON_VERSION', '1.4' );
 
// set credits
$GLOBALS[ 'wgExtensionCredits' ][ 'skin' ][ ] = array(
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 17da0ff..b8fb91d 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -2,13 +2,14 @@
 
 ### Chameleon 1.4
 
-Released on TBD
+Released on 20-Sep-2016
 
 Changes:
 * Logo: add addLink attribute to Logo component
 
 Fixes:
 * Restore "Edit with form" link for Semantic Forms 3.5 and later
+* Show dropdown menus of NavBar in front of maps (Maps extension)
 
 ### Chameleon 1.3
 
diff --git a/resources/styles/Components/NavbarHorizontal.less 
b/resources/styles/Components/NavbarHorizontal.less
index 42c3486..96ceac6 100644
--- a/resources/styles/Components/NavbarHorizontal.less
+++ b/resources/styles/Components/NavbarHorizontal.less
@@ -34,6 +34,7 @@
.dropdown-menu {
 
list-style: outside none none;
+   z-index: 1010;
 
> li {
> a {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icdc98fe3f54ae2ec290aef6a696f9d5c1e454581
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/chameleon
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Tweak license lable to show on "Special:Version" - change (mediawiki...Bootstrap)

2016-06-13 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Tweak license lable to show on "Special:Version"
..


Tweak license lable to show on "Special:Version"

(according to https://spdx.org/licenses/ used for MW)

Also providing a linkfix, update version in docu as well as going https

Change-Id: Ib4a884c813c908a53490de840d4c86a058065d69
---
M Bootstrap.php
1 file changed, 6 insertions(+), 6 deletions(-)

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



diff --git a/Bootstrap.php b/Bootstrap.php
index ad2ee52..7ca07d1 100644
--- a/Bootstrap.php
+++ b/Bootstrap.php
@@ -3,10 +3,10 @@
  * An extension providing the Bootstrap library to other extensions
  *
  * @see  https://www.mediawiki.org/wiki/Extension:Bootstrap
- * @see  http://twitter.github.io/bootstrap
+ * @see  https://getbootstrap.com/
  *
  * @author   Stephan Gambke
- * @version  1.0-alpha
+ * @version  1.1.5
  *
  * @defgroup Bootstrap Bootstrap
  */
@@ -15,7 +15,7 @@
  * The main file of the Bootstrap extension
  *
  * @copyright (C) 2013 - 2016, Stephan Gambke
- * @license   http://www.gnu.org/licenses/gpl-3.0.html GNU General Public 
License, version 3 (or later)
+ * @license   https://www.gnu.org/licenses/gpl-3.0.html GNU General Public 
License, version 3 (or later)
  *
  * This file is part of the MediaWiki extension Bootstrap.
  * The Bootstrap extension is free software: you can redistribute it and/or
@@ -29,7 +29,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see .
+ * along with this program.  If not, see .
  *
  * @file
  * @ingroup   Bootstrap
@@ -55,11 +55,11 @@
$GLOBALS[ 'wgExtensionCredits' ][ 'other' ][ ] = array(
'path'   => __FILE__,
'name'   => 'Bootstrap',
-   'author' => array( '[http://www.mediawiki.org/wiki/User:F.trott 
Stephan Gambke]', 'James Hong Kong' ),
+   'author' => array( 
'[https://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]', 'James Hong 
Kong' ),
'url'=> 
'https://www.mediawiki.org/wiki/Extension:Bootstrap',
'descriptionmsg' => 'bootstrap-desc',
'version'=> BS_VERSION,
-   'license-name'   => 'GPLv3+',
+   'license-name'   => 'GPL-3.0+',
);
 
// register message files

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4a884c813c908a53490de840d4c86a058065d69
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Bootstrap
Gerrit-Branch: master
Gerrit-Owner: Kghbln 
Gerrit-Reviewer: Foxtrott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Bumped tested MW version 1.25.5 => 1.25.6 - change (mediawiki...chameleon)

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

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

Change subject: Bumped tested MW version 1.25.5 => 1.25.6
..

Bumped tested MW version 1.25.5 => 1.25.6

to avoid Bug: T135102

Change-Id: I9d70048345d6c93f8819bba94f78feb533a7a441
---
M .travis.yml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/chameleon 
refs/changes/64/293964/1

diff --git a/.travis.yml b/.travis.yml
index afbd094..0a25bd5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -34,7 +34,7 @@
   include:
 - env: DBTYPE=mysql; MW=master
   php: 5.6
-- env: DBTYPE=mysql; MW=1.25.5
+- env: DBTYPE=mysql; MW=1.25.6
   php: 5.3
 - env: DBTYPE=sqlite; MW=1.22.1
   php: 5.5

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d70048345d6c93f8819bba94f78feb533a7a441
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/chameleon
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Fix order if univ lang selector and "not logged in" message - change (mediawiki...MonoBook)

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

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

Change subject: Fix order if univ lang selector and "not logged in" message
..

Fix order if univ lang selector and "not logged in" message

Bug: T121793
Change-Id: Ia6406fe535916684c998225f052f7e8b2231cbe1
---
M MonoBookTemplate.php
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MonoBook 
refs/changes/48/289548/1

diff --git a/MonoBookTemplate.php b/MonoBookTemplate.php
index c4ff806..7f496a0 100644
--- a/MonoBookTemplate.php
+++ b/MonoBookTemplate.php
@@ -120,6 +120,14 @@

>
getPersonalTools();
+
+   if ( array_key_exists( 'uls', 
$personalTools ) ) {
+   echo 
$this->makeListItem( 'uls', $personalTools[ 'uls' ] );
+   unset( $personalTools[ 
'uls' ] );
+   }
+
if ( 
!$this->getSkin()->getUser()->isLoggedIn() &&

User::groupHasPermission( '*', 'edit' ) ) {
 
@@ -129,7 +137,7 @@
 
}
 
-   foreach ( 
$this->getPersonalTools() as $key => $item ) { ?>
+   foreach ( $personalTools as 
$key => $item ) { ?>
makeListItem( $key, $item ); ?>
 
https://gerrit.wikimedia.org/r/289548
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6406fe535916684c998225f052f7e8b2231cbe1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/MonoBook
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Fix order if univ lang selector and "not logged in" message - change (mediawiki...Vector)

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

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

Change subject: Fix order if univ lang selector and "not logged in" message
..

Fix order if univ lang selector and "not logged in" message

Bug: T121793
Change-Id: I1a42443dab0dd064c35f858ece69e6d9cdb398a1
---
M VectorTemplate.php
1 file changed, 10 insertions(+), 1 deletion(-)


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

diff --git a/VectorTemplate.php b/VectorTemplate.php
index 7a02b36..5b27141 100644
--- a/VectorTemplate.php
+++ b/VectorTemplate.php
@@ -513,17 +513,26 @@
 
}
 
+   $personalTools = 
$this->getPersonalTools();
+
+   $langSelector = '';
+   if ( array_key_exists( 
'uls', $personalTools ) ) {
+   $langSelector = 
$this->makeListItem( 'uls', $personalTools[ 'uls' ] );
+   unset( 
$personalTools[ 'uls' ] );
+   }
+
if ( !$this->data[ 
'rtl' ] ) {
+   echo 
$langSelector;
echo 
$notLoggedIn;
}
 
-   $personalTools = 
$this->getPersonalTools();
foreach ( 
$personalTools as $key => $item ) {
echo 
$this->makeListItem( $key, $item );
}
 
if ( $this->data[ 'rtl' 
] ) {
echo 
$notLoggedIn;
+   echo 
$langSelector;
}
?>


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a42443dab0dd064c35f858ece69e6d9cdb398a1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Update changelog.md - change (mediawiki...chameleon)

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

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

Change subject: Update changelog.md
..

Update changelog.md

Change-Id: If6b30b71f935a4e3314d9c9512c254a33c606506
---
M Chameleon.php
M docs/release-notes.md
2 files changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/chameleon 
refs/changes/90/286290/1

diff --git a/Chameleon.php b/Chameleon.php
index 3e62a40..7d82750 100644
--- a/Chameleon.php
+++ b/Chameleon.php
@@ -47,7 +47,7 @@
}
 
// define the skin's version
-   define( 'CHAMELEON_VERSION', '1.3' );
+   define( 'CHAMELEON_VERSION', '1.4-alpha' );
 
// set credits
$GLOBALS[ 'wgExtensionCredits' ][ 'skin' ][ ] = array(
diff --git a/docs/release-notes.md b/docs/release-notes.md
index e35a5dc..17da0ff 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -1,9 +1,12 @@
 ## Release Notes
 
-### Chameleon 1.3.1
+### Chameleon 1.4
 
 Released on TBD
 
+Changes:
+* Logo: add addLink attribute to Logo component
+
 Fixes:
 * Restore "Edit with form" link for Semantic Forms 3.5 and later
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If6b30b71f935a4e3314d9c9512c254a33c606506
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/chameleon
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Restore "Edit with form" link for Semantic Forms 3.5 and later - change (mediawiki...chameleon)

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

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

Change subject: Restore "Edit with form" link for Semantic Forms 3.5 and later
..

Restore "Edit with form" link for Semantic Forms 3.5 and later

Change-Id: I446320a301ef6c7289a6ba602299dd773af31ecf
---
M docs/release-notes.md
M src/Components/NavbarHorizontal.php
2 files changed, 54 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/chameleon 
refs/changes/89/286289/1

diff --git a/docs/release-notes.md b/docs/release-notes.md
index a2d1015..e35a5dc 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -1,5 +1,12 @@
 ## Release Notes
 
+### Chameleon 1.3.1
+
+Released on TBD
+
+Fixes:
+* Restore "Edit with form" link for Semantic Forms 3.5 and later
+
 ### Chameleon 1.3
 
 Released on 08-Mar-2016
diff --git a/src/Components/NavbarHorizontal.php 
b/src/Components/NavbarHorizontal.php
index 50d8cd0..5d4e621 100644
--- a/src/Components/NavbarHorizontal.php
+++ b/src/Components/NavbarHorizontal.php
@@ -283,31 +283,7 @@
$pageTools->removeClasses( 'text-center list-inline' );
$pageTools->addClasses( 'dropdown-menu' );
 
-   $editLinkHtml = '';
-   $pageToolsStructure = $pageTools->getPageToolsStructure();
-
-   if ( array_key_exists( 'views', $pageToolsStructure ) &&
-   array_key_exists( 'form_edit', $pageToolsStructure[ 
'views' ] ) &&
-   array_key_exists( 'sfgRenameEditTabs', $GLOBALS ) &&
-   $GLOBALS[ 'sfgRenameEditTabs' ] === true
-
-   ) {
-
-   $editLinkHtml = 
$this->getLinkAndRemoveFromPageToolStructure( $pageTools, 'form_edit' );
-
-   } elseif ( array_key_exists( 'views', $pageToolsStructure ) &&
-   array_key_exists( 've-edit', $pageToolsStructure[ 
'views' ] )
-   ) {
-
-   $editLinkHtml = 
$this->getLinkAndRemoveFromPageToolStructure( $pageTools, 've-edit' );
-
-   } elseif ( array_key_exists( 'views', $pageToolsStructure ) &&
-   array_key_exists( 'edit', $pageToolsStructure[ 'views' 
] )
-   ) {
-
-   $editLinkHtml = 
$this->getLinkAndRemoveFromPageToolStructure( $pageTools, 'edit' );
-
-   }
+   $editLinkHtml = $this->getEditLinkHtml( $pageTools );
 
$pageToolsHtml = $pageTools->getHtml();
 
@@ -516,4 +492,50 @@
return $editLinkHtml;
}
 
+   /**
+* @param $pageTools
+* @return string
+*/
+   protected function getEditLinkHtml( $pageTools ) {
+
+   $pageToolsStructure = $pageTools->getPageToolsStructure();
+
+   if ( array_key_exists( 'views', $pageToolsStructure ) &&
+   array_key_exists( 'sfgRenameEditTabs', $GLOBALS ) &&
+   array_key_exists( 'formedit', $pageToolsStructure[ 
'views' ] ) && // SemanticForms 3.5+
+   $GLOBALS[ 'sfgRenameEditTabs' ] === true
+
+   ) {
+
+   $editLinkHtml = 
$this->getLinkAndRemoveFromPageToolStructure( $pageTools, 'formedit' );
+   return $editLinkHtml;
+
+   } elseif ( array_key_exists( 'views', $pageToolsStructure ) &&
+   array_key_exists( 'sfgRenameEditTabs', $GLOBALS ) &&
+   array_key_exists( 'form_edit', $pageToolsStructure[ 
'views' ] ) && // SemanticForms <3.5
+   $GLOBALS[ 'sfgRenameEditTabs' ] === true
+
+   ) {
+
+   $editLinkHtml = 
$this->getLinkAndRemoveFromPageToolStructure( $pageTools, 'form_edit' );
+   return $editLinkHtml;
+
+   } elseif ( array_key_exists( 'views', $pageToolsStructure ) &&
+   array_key_exists( 've-edit', $pageToolsStructure[ 
'views' ] )
+   ) {
+
+   $editLinkHtml = 
$this->getLinkAndRemoveFromPageToolStructure( $pageTools, 've-edit' );
+   return $editLinkHtml;
+
+   } elseif ( array_key_exists( 'views', $pageToolsStructure ) &&
+   array_key_exists( 'edit', $pageToolsStructure[ 'views' 
] )
+   ) {
+
+   $editLinkHtml = 
$this->getLinkAndRemoveFromPageToolStructure( $pageTools, 'edit' );
+   return $editLinkHtml;
+
+   }
+   return '';
+   }
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I446320a301ef6c7289a6ba602299dd773af31ecf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/chameleon
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 


[MediaWiki-commits] [Gerrit] Rework BasicBackend::next() - change (mediawiki...Lingo)

2016-03-30 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Rework BasicBackend::next()
..


Rework BasicBackend::next()

Change-Id: Iad88fb55b697bc2d6059d125b7e1101d2c1e4c3d
---
M src/BasicBackend.php
1 file changed, 63 insertions(+), 39 deletions(-)

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



diff --git a/src/BasicBackend.php b/src/BasicBackend.php
index 082dba8..d011845 100644
--- a/src/BasicBackend.php
+++ b/src/BasicBackend.php
@@ -84,25 +84,67 @@
 
$line = array_pop( $this->mArticleLines );
 
-   if ( empty( $line ) || ( $line[ 0 ] !== ';' && $line[ 0 
] !== ':' ) ) {
-   continue;
-   }
+   if ( $this->isValidGlossaryLine( $line ) ) {
 
-   $this->queueNextLine( $line, $term, $definitions );
+   list( $term, $definitions ) = 
$this->processNextGlossaryLine( $line, $term, $definitions );
 
-   if ( $term !== null ) {
-   foreach ( $definitions as $definition ) {
-   $ret[] = array(
-   Element::ELEMENT_TERM   => 
$term,
-   Element::ELEMENT_DEFINITION => 
$definition,
-   Element::ELEMENT_LINK   => 
null,
-   Element::ELEMENT_SOURCE => 
null
-   );
+   if ( $term !== null ) {
+   $ret = $this->queueDefinitions( 
$definitions, $term );
}
}
}
 
return array_pop( $ret );
+   }
+
+   /**
+* @param string $line
+* @param string $term
+* @param string[] $definitions
+* @return array
+*/
+   protected function processNextGlossaryLine( $line, $term, $definitions 
) {
+
+   $chunks = explode( ':', $line, 2 );
+
+   // found a new definition?
+   if ( count( $chunks ) === 2 ) {
+
+   // wipe the data if it's a totally new term definition
+   if ( !empty( $term ) && count( $definitions ) > 0 ) {
+   $definitions = array();
+   $term = null;
+   }
+
+   $definitions[] = trim( $chunks[ 1 ] );
+   }
+
+   // found a new term?
+   if ( strlen( trim( $chunks[ 0 ] ) ) > 1 ) {
+   $term = trim( substr( $chunks[ 0 ], 1 ) );
+   }
+
+   return array( $term, $definitions );
+   }
+
+   /**
+* @param $definitions
+* @param $term
+* @return array
+*/
+   protected function queueDefinitions( $definitions, $term ) {
+   $ret = array();
+
+   foreach ( $definitions as $definition ) {
+   $ret[] = array(
+   Element::ELEMENT_TERM   => $term,
+   Element::ELEMENT_DEFINITION => $definition,
+   Element::ELEMENT_LINK   => null,
+   Element::ELEMENT_SOURCE => null
+   );
+   }
+
+   return $ret;
}
 
/**
@@ -208,33 +250,6 @@
}
 
/**
-* @param string $line
-* @param string $term
-* @param string[] $definitions
-*/
-   protected function queueNextLine( $line, &$term, &$definitions ) {
-
-   $chunks = explode( ':', $line, 2 );
-
-   // found a new definition?
-   if ( count( $chunks ) === 2 ) {
-
-   // wipe the data if it's a totally new term definition
-   if ( !empty( $term ) && count( $definitions ) > 0 ) {
-   $definitions = array();
-   $term = null;
-   }
-
-   $definitions[] = trim( $chunks[ 1 ] );
-   }
-
-   // found a new term?
-   if ( strlen( trim( $chunks[ 0 ] ) ) > 1 ) {
-   $term = trim( substr( $chunks[ 0 ], 1 ) );
-   }
-   }
-
-   /**
 * Initiates the purging of the cache when the Terminology page was 
saved or purged.
 *
 * @param WikiPage $wikipage
@@ -288,4 +303,13 @@
protected function getLatestRevisionFromTitle( Title $title ) {
return Revision::newFromTitle( $title );
}
+
+   /**
+* @param $line
+* @return bool
+*/
+   protected 

[MediaWiki-commits] [Gerrit] Rework BasicBackend::next() - change (mediawiki...Lingo)

2016-03-30 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Rework BasicBackend::next()
..

Rework BasicBackend::next()

Change-Id: Iad88fb55b697bc2d6059d125b7e1101d2c1e4c3d
---
M src/BasicBackend.php
1 file changed, 63 insertions(+), 39 deletions(-)


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

diff --git a/src/BasicBackend.php b/src/BasicBackend.php
index 082dba8..d011845 100644
--- a/src/BasicBackend.php
+++ b/src/BasicBackend.php
@@ -84,25 +84,67 @@
 
$line = array_pop( $this->mArticleLines );
 
-   if ( empty( $line ) || ( $line[ 0 ] !== ';' && $line[ 0 
] !== ':' ) ) {
-   continue;
-   }
+   if ( $this->isValidGlossaryLine( $line ) ) {
 
-   $this->queueNextLine( $line, $term, $definitions );
+   list( $term, $definitions ) = 
$this->processNextGlossaryLine( $line, $term, $definitions );
 
-   if ( $term !== null ) {
-   foreach ( $definitions as $definition ) {
-   $ret[] = array(
-   Element::ELEMENT_TERM   => 
$term,
-   Element::ELEMENT_DEFINITION => 
$definition,
-   Element::ELEMENT_LINK   => 
null,
-   Element::ELEMENT_SOURCE => 
null
-   );
+   if ( $term !== null ) {
+   $ret = $this->queueDefinitions( 
$definitions, $term );
}
}
}
 
return array_pop( $ret );
+   }
+
+   /**
+* @param string $line
+* @param string $term
+* @param string[] $definitions
+* @return array
+*/
+   protected function processNextGlossaryLine( $line, $term, $definitions 
) {
+
+   $chunks = explode( ':', $line, 2 );
+
+   // found a new definition?
+   if ( count( $chunks ) === 2 ) {
+
+   // wipe the data if it's a totally new term definition
+   if ( !empty( $term ) && count( $definitions ) > 0 ) {
+   $definitions = array();
+   $term = null;
+   }
+
+   $definitions[] = trim( $chunks[ 1 ] );
+   }
+
+   // found a new term?
+   if ( strlen( trim( $chunks[ 0 ] ) ) > 1 ) {
+   $term = trim( substr( $chunks[ 0 ], 1 ) );
+   }
+
+   return array( $term, $definitions );
+   }
+
+   /**
+* @param $definitions
+* @param $term
+* @return array
+*/
+   protected function queueDefinitions( $definitions, $term ) {
+   $ret = array();
+
+   foreach ( $definitions as $definition ) {
+   $ret[] = array(
+   Element::ELEMENT_TERM   => $term,
+   Element::ELEMENT_DEFINITION => $definition,
+   Element::ELEMENT_LINK   => null,
+   Element::ELEMENT_SOURCE => null
+   );
+   }
+
+   return $ret;
}
 
/**
@@ -208,33 +250,6 @@
}
 
/**
-* @param string $line
-* @param string $term
-* @param string[] $definitions
-*/
-   protected function queueNextLine( $line, &$term, &$definitions ) {
-
-   $chunks = explode( ':', $line, 2 );
-
-   // found a new definition?
-   if ( count( $chunks ) === 2 ) {
-
-   // wipe the data if it's a totally new term definition
-   if ( !empty( $term ) && count( $definitions ) > 0 ) {
-   $definitions = array();
-   $term = null;
-   }
-
-   $definitions[] = trim( $chunks[ 1 ] );
-   }
-
-   // found a new term?
-   if ( strlen( trim( $chunks[ 0 ] ) ) > 1 ) {
-   $term = trim( substr( $chunks[ 0 ], 1 ) );
-   }
-   }
-
-   /**
 * Initiates the purging of the cache when the Terminology page was 
saved or purged.
 *
 * @param WikiPage $wikipage
@@ -288,4 +303,13 @@
protected function getLatestRevisionFromTitle( Title $title ) {
return Revision::newFromTitle( $title );
}
+
+   /**
+* @param $line
+* 

[MediaWiki-commits] [Gerrit] Add StashingDOMDocument; error handling for invalid link tar... - change (mediawiki...Lingo)

2016-03-30 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Add StashingDOMDocument; error handling for invalid link targets
..


Add StashingDOMDocument; error handling for invalid link targets

Change-Id: I028ef68e6e73f55a58f7c46ccb72b6b54645cd5b
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M src/Element.php
M src/Lingo.php
M src/LingoParser.php
A src/StashingDOMDocument.php
7 files changed, 126 insertions(+), 31 deletions(-)

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



diff --git a/extension.json b/extension.json
index 688f010..3d9ca13 100644
--- a/extension.json
+++ b/extension.json
@@ -67,6 +67,7 @@
"Lingo\\Backend": "/src/Backend.php",
"Lingo\\BasicBackend": "/src/BasicBackend.php",
"Lingo\\MessageLog": "/src/MessageLog.php",
+   "Lingo\\StashingDOMDocument": "/src/StashingDOMDocument.php",
"Lingo\\Tests\\Util\\XmlFileProvider": 
"/tests/phpunit/Util/XmlFileProvider.php"
},
"callback": "Lingo\\Lingo::initExtension",
diff --git a/i18n/en.json b/i18n/en.json
index b4904f7..10d3902 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -7,5 +7,6 @@
"lingo-noterminologypage": "The terminology page \"$1\" does not 
exist.",
"lingo-notatextpage": "The terminology page \"$1\" is not a text page.",
"lingo-terminologypagenotlocal": "Page \"$1\" is not a local page.",
-   "lingo-noapprovedrevs": "Support for ApprovedRevs is enabled in Lingo. 
But ApprovedRevs was not found."
+   "lingo-noapprovedrevs": "Support for ApprovedRevs is enabled in Lingo. 
But ApprovedRevs was not found.",
+   "lingo-invalidlinktarget" : "Invalid link target for term \"$1\": $2"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 173c448..9fd5017 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -11,5 +11,6 @@
"lingo-noterminologypage": "Used as warning message. Parameters:\n* $1 
- terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-terminologypagenotlocal}}",
"lingo-notatextpage": "Used as error message. Parameters:\n* $1 - 
terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-noterminologypage}}",
"lingo-terminologypagenotlocal": "Used as error message. Parameters:\n* 
$1 - terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-noterminologypage}}",
-   "lingo-noapprovedrevs": "Used as warning message when the ApprovedRevs 
extension is not installed."
+   "lingo-noapprovedrevs": "Used as warning message when the ApprovedRevs 
extension is not installed.",
+   "lingo-invalidlinktarget" : "Used as error message when the link target 
$2 is not a valid wiki page name."
 }
diff --git a/src/Element.php b/src/Element.php
index ba22f5a..b17f639 100644
--- a/src/Element.php
+++ b/src/Element.php
@@ -28,11 +28,10 @@
  */
 
 namespace Lingo;
-use DOMDocument;
+
 use DOMElement;
 use DOMNode;
 use DOMText;
-use MWException;
 use Title;
 
 /**
@@ -49,7 +48,9 @@
const ELEMENT_STYLE = 4;
 
const ELEMENT_FIELDCOUNT = 5;  // number of fields stored for each 
element; (last field's index) + 1
-   static private $mLinkTemplate = null;
+
+   const LINK_TEMPLATE_ID = 'LingoLink';
+
private $mFullDefinition = null;
private $mDefinitions = array();
private $mTerm = null;
@@ -77,10 +78,10 @@
}
 
/**
-* @param DOMDocument $doc
+* @param StashingDOMDocument $doc
 * @return DOMNode|DOMText
 */
-   public function getFullDefinition( DOMDocument &$doc ) {
+   public function getFullDefinition( StashingDOMDocument &$doc ) {
 
global $wgexLingoDisplayOnce;
 
@@ -95,10 +96,9 @@
}
 
/**
-* @param DOMDocument $doc
-* @return DOMDocument
+* @param StashingDOMDocument $doc
 */
-   private function buildFullDefinition( DOMDocument &$doc ) {
+   private function buildFullDefinition( StashingDOMDocument &$doc ) {
 
// only create if not yet created
if ( $this->mFullDefinition === null || 
$this->mFullDefinition->ownerDocument !== $doc ) {
@@ -121,21 +121,29 @@
}
 
/**
-* @param DOMDocument $doc
-*
+* @param StashingDOMDocument $doc
 * @return DOMElement
-* @throws MWException
+* @throws \MWException
 */
-   protected function getFullDefinitionAsLink( DOMDocument &$doc ) {
+   protected function getFullDefinitionAsLink( StashingDOMDocument &$doc ) 
{
 
// create Title object for target page
$target = Title::newFromText( $this->mDefinitions[ 0 ][ 
self::ELEMENT_LINK ] );
+
+   

[MediaWiki-commits] [Gerrit] Add StashingDOMDocument; error handling for invalid link tar... - change (mediawiki...Lingo)

2016-03-30 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Add StashingDOMDocument; error handling for invalid link targets
..

Add StashingDOMDocument; error handling for invalid link targets

Change-Id: I028ef68e6e73f55a58f7c46ccb72b6b54645cd5b
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M src/Element.php
M src/Lingo.php
M src/LingoParser.php
A src/StashingDOMDocument.php
7 files changed, 126 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/81/280581/1

diff --git a/extension.json b/extension.json
index 688f010..3d9ca13 100644
--- a/extension.json
+++ b/extension.json
@@ -67,6 +67,7 @@
"Lingo\\Backend": "/src/Backend.php",
"Lingo\\BasicBackend": "/src/BasicBackend.php",
"Lingo\\MessageLog": "/src/MessageLog.php",
+   "Lingo\\StashingDOMDocument": "/src/StashingDOMDocument.php",
"Lingo\\Tests\\Util\\XmlFileProvider": 
"/tests/phpunit/Util/XmlFileProvider.php"
},
"callback": "Lingo\\Lingo::initExtension",
diff --git a/i18n/en.json b/i18n/en.json
index b4904f7..10d3902 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -7,5 +7,6 @@
"lingo-noterminologypage": "The terminology page \"$1\" does not 
exist.",
"lingo-notatextpage": "The terminology page \"$1\" is not a text page.",
"lingo-terminologypagenotlocal": "Page \"$1\" is not a local page.",
-   "lingo-noapprovedrevs": "Support for ApprovedRevs is enabled in Lingo. 
But ApprovedRevs was not found."
+   "lingo-noapprovedrevs": "Support for ApprovedRevs is enabled in Lingo. 
But ApprovedRevs was not found.",
+   "lingo-invalidlinktarget" : "Invalid link target for term \"$1\": $2"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 3924b3a..e9f5079 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -10,5 +10,6 @@
"lingo-noterminologypage": "Used as warning message. Parameters:\n* $1 
- terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-terminologypagenotlocal}}",
"lingo-notatextpage": "Used as error message. Parameters:\n* $1 - 
terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-noterminologypage}}",
"lingo-terminologypagenotlocal": "Used as error message. Parameters:\n* 
$1 - terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-noterminologypage}}",
-   "lingo-noapprovedrevs": "Used as warning message when the ApprovedRevs 
extension is not installed."
+   "lingo-noapprovedrevs": "Used as warning message when the ApprovedRevs 
extension is not installed.",
+   "lingo-invalidlinktarget" : "Used as error message when the link target 
$2 is not a valid wiki page name."
 }
diff --git a/src/Element.php b/src/Element.php
index ba22f5a..b17f639 100644
--- a/src/Element.php
+++ b/src/Element.php
@@ -28,11 +28,10 @@
  */
 
 namespace Lingo;
-use DOMDocument;
+
 use DOMElement;
 use DOMNode;
 use DOMText;
-use MWException;
 use Title;
 
 /**
@@ -49,7 +48,9 @@
const ELEMENT_STYLE = 4;
 
const ELEMENT_FIELDCOUNT = 5;  // number of fields stored for each 
element; (last field's index) + 1
-   static private $mLinkTemplate = null;
+
+   const LINK_TEMPLATE_ID = 'LingoLink';
+
private $mFullDefinition = null;
private $mDefinitions = array();
private $mTerm = null;
@@ -77,10 +78,10 @@
}
 
/**
-* @param DOMDocument $doc
+* @param StashingDOMDocument $doc
 * @return DOMNode|DOMText
 */
-   public function getFullDefinition( DOMDocument &$doc ) {
+   public function getFullDefinition( StashingDOMDocument &$doc ) {
 
global $wgexLingoDisplayOnce;
 
@@ -95,10 +96,9 @@
}
 
/**
-* @param DOMDocument $doc
-* @return DOMDocument
+* @param StashingDOMDocument $doc
 */
-   private function buildFullDefinition( DOMDocument &$doc ) {
+   private function buildFullDefinition( StashingDOMDocument &$doc ) {
 
// only create if not yet created
if ( $this->mFullDefinition === null || 
$this->mFullDefinition->ownerDocument !== $doc ) {
@@ -121,21 +121,29 @@
}
 
/**
-* @param DOMDocument $doc
-*
+* @param StashingDOMDocument $doc
 * @return DOMElement
-* @throws MWException
+* @throws \MWException
 */
-   protected function getFullDefinitionAsLink( DOMDocument &$doc ) {
+   protected function getFullDefinitionAsLink( StashingDOMDocument &$doc ) 
{
 
// create Title object for target page
$target = Title::newFromText( 

[MediaWiki-commits] [Gerrit] Minor rework of LingoParser - change (mediawiki...Lingo)

2016-03-20 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Minor rework of LingoParser
..


Minor rework of LingoParser

Change-Id: I5a92c1465d9c381910245cf44807f7df874ba1a2
---
M src/LingoParser.php
1 file changed, 19 insertions(+), 12 deletions(-)

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



diff --git a/src/LingoParser.php b/src/LingoParser.php
index 6d4b5ce..da4d039 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -71,18 +71,8 @@
 */
public function parse( Parser &$parser, &$text ) {
 
-   global $wgexLingoUseNamespaces;
-
-   $title = $parser->getTitle();
-
// parse if
-   if ( !isset( $parser->mDoubleUnderscores[ 'noglossary' ] ) && 
// __NOGLOSSARY__ not present and
-   (
-   !$title || // title not set or
-   !isset( $wgexLingoUseNamespaces[ 
$title->getNamespace() ] ) || // namespace not explicitly forbidden (i.e. not 
in list of namespaces and set to false) or
-   $wgexLingoUseNamespaces[ $title->getNamespace() 
] // namespace explicitly allowed
-   )
-   ) {
+   if ( $this->shouldParse( $parser ) ) {
 
// unstrip strip items of the 'general' group
// this will be done again by parse when this hook 
returns, but it should not hurt to do this twice
@@ -90,7 +80,6 @@
$text = $parser->mStripState->unstripGeneral( $text );
$this->realParse( $parser, $text );
}
-
 
return true;
}
@@ -391,5 +380,23 @@
$this->mLingoBackend = $backend;
$backend->setLingoParser( $this );
}
+
+   /**
+* @param Parser $parser
+* @return bool
+*/
+   protected function shouldParse( Parser &$parser ) {
+   global $wgexLingoUseNamespaces;
+
+   $title = $parser->getTitle();
+   $namespace = $title->getNamespace();
+
+   return !isset( $parser->mDoubleUnderscores[ 'noglossary' ] ) && 
// __NOGLOSSARY__ not present and
+   (
+   !$title || // title not set (i.e. when text is outside 
the page content) or
+   !isset( $wgexLingoUseNamespaces[ $namespace ] ) || // 
namespace not explicitly forbidden (i.e. not in list of namespaces and set to 
false) or
+   $wgexLingoUseNamespaces[ $namespace ] // namespace 
explicitly allowed
+   );
+   }
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5a92c1465d9c381910245cf44807f7df874ba1a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Minor rework of LingoParser - change (mediawiki...Lingo)

2016-03-20 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Minor rework of LingoParser
..

Minor rework of LingoParser

Change-Id: I5a92c1465d9c381910245cf44807f7df874ba1a2
---
M src/LingoParser.php
1 file changed, 19 insertions(+), 12 deletions(-)


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

diff --git a/src/LingoParser.php b/src/LingoParser.php
index 6d4b5ce..da4d039 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -71,18 +71,8 @@
 */
public function parse( Parser &$parser, &$text ) {
 
-   global $wgexLingoUseNamespaces;
-
-   $title = $parser->getTitle();
-
// parse if
-   if ( !isset( $parser->mDoubleUnderscores[ 'noglossary' ] ) && 
// __NOGLOSSARY__ not present and
-   (
-   !$title || // title not set or
-   !isset( $wgexLingoUseNamespaces[ 
$title->getNamespace() ] ) || // namespace not explicitly forbidden (i.e. not 
in list of namespaces and set to false) or
-   $wgexLingoUseNamespaces[ $title->getNamespace() 
] // namespace explicitly allowed
-   )
-   ) {
+   if ( $this->shouldParse( $parser ) ) {
 
// unstrip strip items of the 'general' group
// this will be done again by parse when this hook 
returns, but it should not hurt to do this twice
@@ -90,7 +80,6 @@
$text = $parser->mStripState->unstripGeneral( $text );
$this->realParse( $parser, $text );
}
-
 
return true;
}
@@ -391,5 +380,23 @@
$this->mLingoBackend = $backend;
$backend->setLingoParser( $this );
}
+
+   /**
+* @param Parser $parser
+* @return bool
+*/
+   protected function shouldParse( Parser &$parser ) {
+   global $wgexLingoUseNamespaces;
+
+   $title = $parser->getTitle();
+   $namespace = $title->getNamespace();
+
+   return !isset( $parser->mDoubleUnderscores[ 'noglossary' ] ) && 
// __NOGLOSSARY__ not present and
+   (
+   !$title || // title not set (i.e. when text is outside 
the page content) or
+   !isset( $wgexLingoUseNamespaces[ $namespace ] ) || // 
namespace not explicitly forbidden (i.e. not in list of namespaces and set to 
false) or
+   $wgexLingoUseNamespaces[ $namespace ] // namespace 
explicitly allowed
+   );
+   }
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a92c1465d9c381910245cf44807f7df874ba1a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Some clean-up - change (mediawiki...Lingo)

2016-03-20 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Some clean-up
..


Some clean-up

Change-Id: I9578e7780164271a53de116b0fcb1c2f87effe04
---
M src/BasicBackend.php
M tests/phpunit/Unit/BasicBackendTest.php
2 files changed, 4 insertions(+), 5 deletions(-)

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



diff --git a/src/BasicBackend.php b/src/BasicBackend.php
index 48be64b..082dba8 100644
--- a/src/BasicBackend.php
+++ b/src/BasicBackend.php
@@ -28,7 +28,6 @@
 namespace Lingo;
 
 use ApprovedRevs;
-use ContentHandler;
 use Hooks;
 use Parser;
 use ParserOptions;
@@ -230,7 +229,7 @@
}
 
// found a new term?
-   if ( count( $chunks ) >= 1 && strlen( $chunks[ 0 ] ) > 0 ) {
+   if ( strlen( trim( $chunks[ 0 ] ) ) > 1 ) {
$term = trim( substr( $chunks[ 0 ], 1 ) );
}
}
@@ -266,10 +265,10 @@
/**
 * @codeCoverageIgnore
 * @param $dictionaryPage
-* @return null|Title
+* @return Title
 */
protected function getTitleFromText( $dictionaryPage ) {
-   return Title::newFromText( $dictionaryPage );
+   return Title::newFromTextThrow( $dictionaryPage );
}
 
/**
diff --git a/tests/phpunit/Unit/BasicBackendTest.php 
b/tests/phpunit/Unit/BasicBackendTest.php
index 8f30098..f622880 100644
--- a/tests/phpunit/Unit/BasicBackendTest.php
+++ b/tests/phpunit/Unit/BasicBackendTest.php
@@ -270,7 +270,7 @@
array(
 <<<'TESTTEXT'
 ;CIP:Common image point
-;CMP:Common midpoint
+; CMP : Common midpoint
 
 ;DIMO
 ;DMO

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9578e7780164271a53de116b0fcb1c2f87effe04
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Some clean-up - change (mediawiki...Lingo)

2016-03-20 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Some clean-up
..

Some clean-up

Change-Id: I9578e7780164271a53de116b0fcb1c2f87effe04
---
M src/BasicBackend.php
M tests/phpunit/Unit/BasicBackendTest.php
2 files changed, 4 insertions(+), 5 deletions(-)


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

diff --git a/src/BasicBackend.php b/src/BasicBackend.php
index 48be64b..082dba8 100644
--- a/src/BasicBackend.php
+++ b/src/BasicBackend.php
@@ -28,7 +28,6 @@
 namespace Lingo;
 
 use ApprovedRevs;
-use ContentHandler;
 use Hooks;
 use Parser;
 use ParserOptions;
@@ -230,7 +229,7 @@
}
 
// found a new term?
-   if ( count( $chunks ) >= 1 && strlen( $chunks[ 0 ] ) > 0 ) {
+   if ( strlen( trim( $chunks[ 0 ] ) ) > 1 ) {
$term = trim( substr( $chunks[ 0 ], 1 ) );
}
}
@@ -266,10 +265,10 @@
/**
 * @codeCoverageIgnore
 * @param $dictionaryPage
-* @return null|Title
+* @return Title
 */
protected function getTitleFromText( $dictionaryPage ) {
-   return Title::newFromText( $dictionaryPage );
+   return Title::newFromTextThrow( $dictionaryPage );
}
 
/**
diff --git a/tests/phpunit/Unit/BasicBackendTest.php 
b/tests/phpunit/Unit/BasicBackendTest.php
index 8f30098..f622880 100644
--- a/tests/phpunit/Unit/BasicBackendTest.php
+++ b/tests/phpunit/Unit/BasicBackendTest.php
@@ -270,7 +270,7 @@
array(
 <<<'TESTTEXT'
 ;CIP:Common image point
-;CMP:Common midpoint
+; CMP : Common midpoint
 
 ;DIMO
 ;DMO

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9578e7780164271a53de116b0fcb1c2f87effe04
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Unit test & rework BasicBackend - change (mediawiki...Lingo)

2016-03-20 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Unit test & rework BasicBackend
..


Unit test & rework BasicBackend

Change-Id: I5ffeb4d4667a14349616b13c400540a9eac5d7c7
---
M i18n/en.json
M i18n/qqq.json
M src/BasicBackend.php
M tests/phpunit/Unit/BasicBackendTest.php
4 files changed, 439 insertions(+), 97 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 2585912..b4904f7 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -4,6 +4,8 @@
},
"lingo-desc": "Provides hover-over tool tips on pages from words 
defined on the [[$1]] page",
"lingo-terminologypagename": "Terminology",
-   "lingo-noterminologypage": "Page \"$1\" does not exist.",
-   "lingo-terminologypagenotlocal": "Page \"$1\" is not a local page."
-}
\ No newline at end of file
+   "lingo-noterminologypage": "The terminology page \"$1\" does not 
exist.",
+   "lingo-notatextpage": "The terminology page \"$1\" is not a text page.",
+   "lingo-terminologypagenotlocal": "Page \"$1\" is not a local page.",
+   "lingo-noapprovedrevs": "Support for ApprovedRevs is enabled in Lingo. 
But ApprovedRevs was not found."
+}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 1b05962..3924b3a 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -7,6 +7,8 @@
},
"lingo-desc": 
"{{desc|name=Lingo|url=https://www.mediawiki.org/wiki/Extension:Lingo}}\nParameters:\n*
 $1 - terminology page title (value of $wgexLingoPage), or 
{{msg-mw|Lingo-terminologypagename}}",
"lingo-terminologypagename": "Name of the page where the terms and 
definitions of the glossary are stored",
-   "lingo-noterminologypage": "Used as warning. Parameters:\n* $1 - 
terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-terminologypagenotlocal}}",
-   "lingo-terminologypagenotlocal": "Used as error message. Parameters:\n* 
$1 - terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-noterminologypage}}"
+   "lingo-noterminologypage": "Used as warning message. Parameters:\n* $1 
- terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-terminologypagenotlocal}}",
+   "lingo-notatextpage": "Used as error message. Parameters:\n* $1 - 
terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-noterminologypage}}",
+   "lingo-terminologypagenotlocal": "Used as error message. Parameters:\n* 
$1 - terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-noterminologypage}}",
+   "lingo-noapprovedrevs": "Used as warning message when the ApprovedRevs 
extension is not installed."
 }
diff --git a/src/BasicBackend.php b/src/BasicBackend.php
index 114a6da..48be64b 100644
--- a/src/BasicBackend.php
+++ b/src/BasicBackend.php
@@ -33,6 +33,7 @@
 use Parser;
 use ParserOptions;
 use Revision;
+use TextContent;
 use Title;
 use User;
 use WikiPage;
@@ -64,14 +65,6 @@
}
 
/**
-* @return string
-*/
-   private function getLingoPage() {
-   global $wgexLingoPage;
-   return $wgexLingoPage ? $wgexLingoPage : wfMessage( 
'lingo-terminologypagename' )->inContentLanguage()->text();
-   }
-
-   /**
 * This function returns the next element. The element is an array of 
four
 * strings: Term, Definition, Link, Source. For the Lingo\BasicBackend 
Link
 * and Source are set to null. If there is no next element the function
@@ -85,33 +78,18 @@
static $definitions = array();
static $ret = array();
 
-   $this->setArticleLines();
+   $this->collectDictionaryLines();
 
-   // find next valid line (yes, the assignation is intended)
-   while ( ( count( $ret ) == 0 ) && ( $entry = each( 
$this->mArticleLines ) ) ) {
+   // loop backwards: accumulate definitions until term found
+   while ( ( count( $ret ) === 0 ) && ( $this->mArticleLines ) ) {
 
-   if ( empty( $entry[ 1 ] ) || ( $entry[ 1 ][ 0 ] !== ';' 
&& $entry[ 1 ][ 0 ] !== ':' ) ) {
+   $line = array_pop( $this->mArticleLines );
+
+   if ( empty( $line ) || ( $line[ 0 ] !== ';' && $line[ 0 
] !== ':' ) ) {
continue;
}
 
-   $chunks = explode( ':', $entry[ 1 ], 2 );
-
-   // found a new definition?
-   if ( count( $chunks ) == 2 ) {
-
-   // wipe the data if its a totaly new term 

[MediaWiki-commits] [Gerrit] Unit test BasicBackend - change (mediawiki...Lingo)

2016-03-20 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Unit test BasicBackend
..

Unit test BasicBackend

Change-Id: I5ffeb4d4667a14349616b13c400540a9eac5d7c7
---
M i18n/en.json
M i18n/qqq.json
M src/BasicBackend.php
M tests/phpunit/Unit/BasicBackendTest.php
4 files changed, 444 insertions(+), 102 deletions(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index 2585912..b4904f7 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -4,6 +4,8 @@
},
"lingo-desc": "Provides hover-over tool tips on pages from words 
defined on the [[$1]] page",
"lingo-terminologypagename": "Terminology",
-   "lingo-noterminologypage": "Page \"$1\" does not exist.",
-   "lingo-terminologypagenotlocal": "Page \"$1\" is not a local page."
-}
\ No newline at end of file
+   "lingo-noterminologypage": "The terminology page \"$1\" does not 
exist.",
+   "lingo-notatextpage": "The terminology page \"$1\" is not a text page.",
+   "lingo-terminologypagenotlocal": "Page \"$1\" is not a local page.",
+   "lingo-noapprovedrevs": "Support for ApprovedRevs is enabled in Lingo. 
But ApprovedRevs was not found."
+}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 1b05962..3924b3a 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -7,6 +7,8 @@
},
"lingo-desc": 
"{{desc|name=Lingo|url=https://www.mediawiki.org/wiki/Extension:Lingo}}\nParameters:\n*
 $1 - terminology page title (value of $wgexLingoPage), or 
{{msg-mw|Lingo-terminologypagename}}",
"lingo-terminologypagename": "Name of the page where the terms and 
definitions of the glossary are stored",
-   "lingo-noterminologypage": "Used as warning. Parameters:\n* $1 - 
terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-terminologypagenotlocal}}",
-   "lingo-terminologypagenotlocal": "Used as error message. Parameters:\n* 
$1 - terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-noterminologypage}}"
+   "lingo-noterminologypage": "Used as warning message. Parameters:\n* $1 
- terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-terminologypagenotlocal}}",
+   "lingo-notatextpage": "Used as error message. Parameters:\n* $1 - 
terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-noterminologypage}}",
+   "lingo-terminologypagenotlocal": "Used as error message. Parameters:\n* 
$1 - terminology page title (value of $wgexLingoPage), or 
{{msg-mw|lingo-terminologypagename}}\nSee also:\n* 
{{msg-mw|lingo-noterminologypage}}",
+   "lingo-noapprovedrevs": "Used as warning message when the ApprovedRevs 
extension is not installed."
 }
diff --git a/src/BasicBackend.php b/src/BasicBackend.php
index 114a6da..2675c39 100644
--- a/src/BasicBackend.php
+++ b/src/BasicBackend.php
@@ -33,6 +33,7 @@
 use Parser;
 use ParserOptions;
 use Revision;
+use TextContent;
 use Title;
 use User;
 use WikiPage;
@@ -64,14 +65,6 @@
}
 
/**
-* @return string
-*/
-   private function getLingoPage() {
-   global $wgexLingoPage;
-   return $wgexLingoPage ? $wgexLingoPage : wfMessage( 
'lingo-terminologypagename' )->inContentLanguage()->text();
-   }
-
-   /**
 * This function returns the next element. The element is an array of 
four
 * strings: Term, Definition, Link, Source. For the Lingo\BasicBackend 
Link
 * and Source are set to null. If there is no next element the function
@@ -85,33 +78,18 @@
static $definitions = array();
static $ret = array();
 
-   $this->setArticleLines();
+   $this->collectDictionaryLines();
 
-   // find next valid line (yes, the assignation is intended)
-   while ( ( count( $ret ) == 0 ) && ( $entry = each( 
$this->mArticleLines ) ) ) {
+   // loop backwards: accumulate definitions until term found
+   while ( ( count( $ret ) === 0 ) && ( $this->mArticleLines ) ) {
 
-   if ( empty( $entry[ 1 ] ) || ( $entry[ 1 ][ 0 ] !== ';' 
&& $entry[ 1 ][ 0 ] !== ':' ) ) {
+   $line = array_pop( $this->mArticleLines );
+
+   if ( empty( $line ) || ( $line[ 0 ] !== ';' && $line[ 0 
] !== ':' ) ) {
continue;
}
 
-   $chunks = explode( ':', $entry[ 1 ], 2 );
-
-   // found a new definition?
-   if ( count( $chunks ) == 2 ) {
-
-   // wipe the data if its 

[MediaWiki-commits] [Gerrit] Some cleanup - change (mediawiki...Lingo)

2016-03-13 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Some cleanup
..


Some cleanup

Change-Id: I238412f013806419c370e08271ed73e7b8ebec38
---
M extension.json
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/extension.json b/extension.json
index 3b5923b..688f010 100644
--- a/extension.json
+++ b/extension.json
@@ -61,7 +61,6 @@
},
"AutoloadClasses": {
"Lingo\\Lingo": "/src/Lingo.php",
-   "Lingo\\Hooks": "/src/Hooks.php",
"Lingo\\LingoParser": "/src/LingoParser.php",
"Lingo\\Tree": "/src/Tree.php",
"Lingo\\Element": "/src/Element.php",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I238412f013806419c370e08271ed73e7b8ebec38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Some cleanup - change (mediawiki...Lingo)

2016-03-13 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Some cleanup
..

Some cleanup

Change-Id: I238412f013806419c370e08271ed73e7b8ebec38
---
M extension.json
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/15/277115/1

diff --git a/extension.json b/extension.json
index 3b5923b..688f010 100644
--- a/extension.json
+++ b/extension.json
@@ -61,7 +61,6 @@
},
"AutoloadClasses": {
"Lingo\\Lingo": "/src/Lingo.php",
-   "Lingo\\Hooks": "/src/Hooks.php",
"Lingo\\LingoParser": "/src/LingoParser.php",
"Lingo\\Tree": "/src/Tree.php",
"Lingo\\Element": "/src/Element.php",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I238412f013806419c370e08271ed73e7b8ebec38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Some cleanup - change (mediawiki...Lingo)

2016-03-13 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Some cleanup
..


Some cleanup

Change-Id: Id412bd2c72429c9b2703f018f10796fa9fce2bc0
---
M src/BasicBackend.php
D src/Hooks.php
M src/Lingo.php
3 files changed, 2 insertions(+), 53 deletions(-)

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



diff --git a/src/BasicBackend.php b/src/BasicBackend.php
index 9ea5343..114a6da 100644
--- a/src/BasicBackend.php
+++ b/src/BasicBackend.php
@@ -30,7 +30,6 @@
 use ApprovedRevs;
 use ContentHandler;
 use Hooks;
-use Page;
 use Parser;
 use ParserOptions;
 use Revision;
@@ -45,12 +44,11 @@
  */
 class BasicBackend extends Backend {
 
-   protected $mArticleLines = array();
+   protected $mArticleLines = null;
 
/**
 * Lingo\BasicBackend constructor.
 * @param MessageLog|null $messages
-* @param LingoParser $lingoParser
 */
public function __construct( MessageLog &$messages = null ) {
 
@@ -188,7 +186,7 @@
private function setArticleLines() {
global $wgRequest;
 
-   if ( $this->mArticleLines ) {
+   if ( $this->mArticleLines !== null ) {
return;
}
 
diff --git a/src/Hooks.php b/src/Hooks.php
deleted file mode 100644
index e00f846..000
--- a/src/Hooks.php
+++ /dev/null
@@ -1,43 +0,0 @@
-http://www.gnu.org/licenses/>.
- *
- * @author Stephan Gambke
- * @file
- * @ingroup Lingo
- */
-
-namespace Lingo;
-use MagicWord;
-use Parser;
-use PPFrame;
-
-/**
- * The Lingo\Hooks class.
- *
- * It contains the hook handlers of the extension
- *
- * @ingroup Lingo
- */
-class Hooks {
-}
-
diff --git a/src/Lingo.php b/src/Lingo.php
index acd4a06..e74db7c 100644
--- a/src/Lingo.php
+++ b/src/Lingo.php
@@ -77,12 +77,6 @@
}
 
}
-
-// $hookRegistry = new HookRegistry(
-// ApplicationFactory::getInstance()->getStore()
-// );
-//
-// $hookRegistry->register();
};
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id412bd2c72429c9b2703f018f10796fa9fce2bc0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Some cleanup - change (mediawiki...Lingo)

2016-03-13 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Some cleanup
..

Some cleanup

Change-Id: Id412bd2c72429c9b2703f018f10796fa9fce2bc0
---
M src/BasicBackend.php
D src/Hooks.php
M src/Lingo.php
3 files changed, 2 insertions(+), 53 deletions(-)


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

diff --git a/src/BasicBackend.php b/src/BasicBackend.php
index 9ea5343..114a6da 100644
--- a/src/BasicBackend.php
+++ b/src/BasicBackend.php
@@ -30,7 +30,6 @@
 use ApprovedRevs;
 use ContentHandler;
 use Hooks;
-use Page;
 use Parser;
 use ParserOptions;
 use Revision;
@@ -45,12 +44,11 @@
  */
 class BasicBackend extends Backend {
 
-   protected $mArticleLines = array();
+   protected $mArticleLines = null;
 
/**
 * Lingo\BasicBackend constructor.
 * @param MessageLog|null $messages
-* @param LingoParser $lingoParser
 */
public function __construct( MessageLog &$messages = null ) {
 
@@ -188,7 +186,7 @@
private function setArticleLines() {
global $wgRequest;
 
-   if ( $this->mArticleLines ) {
+   if ( $this->mArticleLines !== null ) {
return;
}
 
diff --git a/src/Hooks.php b/src/Hooks.php
deleted file mode 100644
index e00f846..000
--- a/src/Hooks.php
+++ /dev/null
@@ -1,43 +0,0 @@
-http://www.gnu.org/licenses/>.
- *
- * @author Stephan Gambke
- * @file
- * @ingroup Lingo
- */
-
-namespace Lingo;
-use MagicWord;
-use Parser;
-use PPFrame;
-
-/**
- * The Lingo\Hooks class.
- *
- * It contains the hook handlers of the extension
- *
- * @ingroup Lingo
- */
-class Hooks {
-}
-
diff --git a/src/Lingo.php b/src/Lingo.php
index acd4a06..e74db7c 100644
--- a/src/Lingo.php
+++ b/src/Lingo.php
@@ -77,12 +77,6 @@
}
 
}
-
-// $hookRegistry = new HookRegistry(
-// ApplicationFactory::getInstance()->getStore()
-// );
-//
-// $hookRegistry->register();
};
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id412bd2c72429c9b2703f018f10796fa9fce2bc0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Rework and testing of Backends; move hooks back to php - change (mediawiki...Lingo)

2016-03-13 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Rework and testing of Backends; move hooks back to php
..


Rework and testing of Backends; move hooks back to php

* rework BasicBackend
* minor rework Backend
* minor rework LingoParser
* generally replace static methods
* improve testing of Backends

* put hook registration back into php
* no registration of hooks when not necessary (e.g. BasicBackend not used)
* introduce class Lingo for extension initialisation

Change-Id: I69c84dd442a448c4a7d56a878d6a3e29ddda5f05
---
M extension.json
M src/Backend.php
M src/BasicBackend.php
M src/Hooks.php
A src/Lingo.php
M src/LingoParser.php
M src/Tree.php
M tests/phpunit/Integration/ArticleAnnotationTest.php
M tests/phpunit/Unit/BackendTest.php
M tests/phpunit/Unit/BasicBackendTest.php
10 files changed, 337 insertions(+), 161 deletions(-)

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



diff --git a/extension.json b/extension.json
index 99b1e47..3b5923b 100644
--- a/extension.json
+++ b/extension.json
@@ -60,6 +60,7 @@
"LingoMagic": "src/Lingo.i18n.magic.php"
},
"AutoloadClasses": {
+   "Lingo\\Lingo": "/src/Lingo.php",
"Lingo\\Hooks": "/src/Hooks.php",
"Lingo\\LingoParser": "/src/LingoParser.php",
"Lingo\\Tree": "/src/Tree.php",
@@ -69,22 +70,6 @@
"Lingo\\MessageLog": "/src/MessageLog.php",
"Lingo\\Tests\\Util\\XmlFileProvider": 
"/tests/phpunit/Util/XmlFileProvider.php"
},
-   "Hooks": {
-   "ParserFirstCallInit": [
-   "Lingo\\Hooks::registerTags"
-   ],
-   "ArticlePurge": [
-   "Lingo\\BasicBackend::purgeCache"
-   ],
-   "ArticleSave": [
-   "Lingo\\BasicBackend::purgeCache"
-   ],
-   "ParserAfterParse": [
-   "Lingo\\Hooks::parse"
-   ]
-   },
-   "ExtensionFunctions": [
-   "Lingo\\Hooks::initExtension"
-   ],
+   "callback": "Lingo\\Lingo::initExtension",
"manifest_version": 1
 }
diff --git a/src/Backend.php b/src/Backend.php
index e2ece01..d49851c 100644
--- a/src/Backend.php
+++ b/src/Backend.php
@@ -36,6 +36,7 @@
 abstract class Backend {
 
protected $mMessageLog;
+   protected $mLingoParser;
 
/**
 * Lingo\Backend constructor.
@@ -43,21 +44,41 @@
 */
public function __construct( MessageLog &$messages = null ) {
 
-   if ( !$messages ) {
-   $this->mMessageLog = new MessageLog();
-   } else {
-   $this->mMessageLog = $messages;
-   }
+   $this->mMessageLog = $messages;
}
 
/**
 * @return MessageLog
 */
public function getMessageLog() {
+
+   if ( !$this->mMessageLog ) {
+   $this->mMessageLog = new MessageLog();
+   }
+
return $this->mMessageLog;
}
 
/**
+* @return LingoParser
+*/
+   public function getLingoParser() {
+
+   if ( !$this->mLingoParser ) {
+   $this->mLingoParser = LingoParser::getInstance();
+   }
+
+   return $this->mLingoParser;
+   }
+
+   /**
+* @param LingoParser $mLingoParser
+*/
+   public function setLingoParser( LingoParser $mLingoParser ) {
+   $this->mLingoParser = $mLingoParser;
+   }
+
+   /**
 * This function returns true if the backend is cache-enabled.
 *
 * Actual caching is done by the parser, but to be cache-enabled the 
backend
diff --git a/src/BasicBackend.php b/src/BasicBackend.php
index d7fa827..9ea5343 100644
--- a/src/BasicBackend.php
+++ b/src/BasicBackend.php
@@ -29,12 +29,14 @@
 
 use ApprovedRevs;
 use ContentHandler;
+use Hooks;
 use Page;
 use Parser;
 use ParserOptions;
 use Revision;
 use Title;
 use User;
+use WikiPage;
 
 /**
  * The Lingo\BasicBackend class.
@@ -48,59 +50,26 @@
/**
 * Lingo\BasicBackend constructor.
 * @param MessageLog|null $messages
+* @param LingoParser $lingoParser
 */
public function __construct( MessageLog &$messages = null ) {
 
-   global $wgRequest;
-
-   $page = self::getLingoPage();
-
parent::__construct( $messages );
 
-   // Get Terminology page
-   $title = Title::newFromText( $page );
-   if ( $title->getInterwiki() ) {
-   $this->getMessageLog()->addError( wfMessage( 
'lingo-terminologypagenotlocal', $page )->inContentLanguage()->text() );
-   return;
-   }
+   

[MediaWiki-commits] [Gerrit] Rework and testing of Backends; move hooks back to php - change (mediawiki...Lingo)

2016-03-13 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Rework and testing of Backends; move hooks back to php
..

Rework and testing of Backends; move hooks back to php

* rework BasicBackend
* minor rework Backend
* minor rework LingoParser
* generally replace static methods
* improve testing of Backends

* put hook registration back into php
* no registration of hooks when not necessary (e.g. BasicBackend not used)
* introduce class Lingo for extension initialisation

Change-Id: I69c84dd442a448c4a7d56a878d6a3e29ddda5f05
---
M extension.json
M src/Backend.php
M src/BasicBackend.php
M src/Hooks.php
A src/Lingo.php
M src/LingoParser.php
M src/Tree.php
M tests/phpunit/Integration/ArticleAnnotationTest.php
M tests/phpunit/Unit/BackendTest.php
M tests/phpunit/Unit/BasicBackendTest.php
10 files changed, 337 insertions(+), 161 deletions(-)


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

diff --git a/extension.json b/extension.json
index 99b1e47..3b5923b 100644
--- a/extension.json
+++ b/extension.json
@@ -60,6 +60,7 @@
"LingoMagic": "src/Lingo.i18n.magic.php"
},
"AutoloadClasses": {
+   "Lingo\\Lingo": "/src/Lingo.php",
"Lingo\\Hooks": "/src/Hooks.php",
"Lingo\\LingoParser": "/src/LingoParser.php",
"Lingo\\Tree": "/src/Tree.php",
@@ -69,22 +70,6 @@
"Lingo\\MessageLog": "/src/MessageLog.php",
"Lingo\\Tests\\Util\\XmlFileProvider": 
"/tests/phpunit/Util/XmlFileProvider.php"
},
-   "Hooks": {
-   "ParserFirstCallInit": [
-   "Lingo\\Hooks::registerTags"
-   ],
-   "ArticlePurge": [
-   "Lingo\\BasicBackend::purgeCache"
-   ],
-   "ArticleSave": [
-   "Lingo\\BasicBackend::purgeCache"
-   ],
-   "ParserAfterParse": [
-   "Lingo\\Hooks::parse"
-   ]
-   },
-   "ExtensionFunctions": [
-   "Lingo\\Hooks::initExtension"
-   ],
+   "callback": "Lingo\\Lingo::initExtension",
"manifest_version": 1
 }
diff --git a/src/Backend.php b/src/Backend.php
index e2ece01..d49851c 100644
--- a/src/Backend.php
+++ b/src/Backend.php
@@ -36,6 +36,7 @@
 abstract class Backend {
 
protected $mMessageLog;
+   protected $mLingoParser;
 
/**
 * Lingo\Backend constructor.
@@ -43,21 +44,41 @@
 */
public function __construct( MessageLog &$messages = null ) {
 
-   if ( !$messages ) {
-   $this->mMessageLog = new MessageLog();
-   } else {
-   $this->mMessageLog = $messages;
-   }
+   $this->mMessageLog = $messages;
}
 
/**
 * @return MessageLog
 */
public function getMessageLog() {
+
+   if ( !$this->mMessageLog ) {
+   $this->mMessageLog = new MessageLog();
+   }
+
return $this->mMessageLog;
}
 
/**
+* @return LingoParser
+*/
+   public function getLingoParser() {
+
+   if ( !$this->mLingoParser ) {
+   $this->mLingoParser = LingoParser::getInstance();
+   }
+
+   return $this->mLingoParser;
+   }
+
+   /**
+* @param LingoParser $mLingoParser
+*/
+   public function setLingoParser( LingoParser $mLingoParser ) {
+   $this->mLingoParser = $mLingoParser;
+   }
+
+   /**
 * This function returns true if the backend is cache-enabled.
 *
 * Actual caching is done by the parser, but to be cache-enabled the 
backend
diff --git a/src/BasicBackend.php b/src/BasicBackend.php
index d7fa827..9ea5343 100644
--- a/src/BasicBackend.php
+++ b/src/BasicBackend.php
@@ -29,12 +29,14 @@
 
 use ApprovedRevs;
 use ContentHandler;
+use Hooks;
 use Page;
 use Parser;
 use ParserOptions;
 use Revision;
 use Title;
 use User;
+use WikiPage;
 
 /**
  * The Lingo\BasicBackend class.
@@ -48,59 +50,26 @@
/**
 * Lingo\BasicBackend constructor.
 * @param MessageLog|null $messages
+* @param LingoParser $lingoParser
 */
public function __construct( MessageLog &$messages = null ) {
 
-   global $wgRequest;
-
-   $page = self::getLingoPage();
-
parent::__construct( $messages );
 
-   // Get Terminology page
-   $title = Title::newFromText( $page );
-   if ( $title->getInterwiki() ) {
-   $this->getMessageLog()->addError( wfMessage( 
'lingo-terminologypagenotlocal', $page )->inContentLanguage()->text() );
-   return;
-  

[MediaWiki-commits] [Gerrit] Improve tests - change (mediawiki...Lingo)

2016-03-12 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Improve tests
..


Improve tests

Change-Id: I98d718ec46eab6de26a6577b97179cefec89680b
---
M docs/release-notes.md
M extension.json
M tests/phpunit/Integration/ArticleAnnotationTest.php
M tests/phpunit/Unit/BackendTest.php
4 files changed, 39 insertions(+), 9 deletions(-)

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



diff --git a/docs/release-notes.md b/docs/release-notes.md
index 98e1f89..71219e1 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -1,10 +1,20 @@
 ## Release Notes
 
-### Lingo 2.0.1
+### Lingo 2.0.2
 
 Released on tbd
 
 Changes:
+
+
+Fixes:
+
+
+### Lingo 2.0.1
+
+Released on 13-Mar-2016
+
+Changes:
 * Improved test coverage
 
 Fixes:
diff --git a/extension.json b/extension.json
index 990c892..99b1e47 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Lingo",
-   "version": "2.0.1",
+   "version": "2.0.2-dev",
"author": [
"Barry Coughlan",
"[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]",
diff --git a/tests/phpunit/Integration/ArticleAnnotationTest.php 
b/tests/phpunit/Integration/ArticleAnnotationTest.php
index 9966d56..6526897 100644
--- a/tests/phpunit/Integration/ArticleAnnotationTest.php
+++ b/tests/phpunit/Integration/ArticleAnnotationTest.php
@@ -50,6 +50,9 @@
 class ArticleAnnotationTest extends \PHPUnit_Framework_TestCase {
 
public function setup() {
+
+   $GLOBALS[ 'wgexLingoDisplayOnce' ] = false;
+
}
 
public function tearDown() {
@@ -107,7 +110,9 @@
$json = json_encode( $xml );
$decoded = json_decode( $json, TRUE );
 
+   // suppress warnings for non-existant array keys
\MediaWiki\suppressWarnings();
+
$testCase = array(
0 => substr( $file, strlen( __DIR__ . 
'/../Fixture/articleAnnotation' ) ),
1 => $decoded[ 'text' ],
@@ -116,14 +121,13 @@
);
 
if ( array_key_exists( 'term', $decoded[ 
'glossary-entry' ] ) ) {
-
-   $testCase[ 2 ][] = array( $decoded[ 
'glossary-entry' ][ 'term' ], $decoded[ 'glossary-entry' ][ 'definition' ], 
$decoded[ 'glossary-entry' ][ 'link' ], $decoded[ 'glossary-entry' ][ 'style' ] 
);
-
-   } else {
-   foreach ( $decoded[ 'glossary-entry' ] as 
$entry ) {
-   $testCase[ 2 ][] = array( $entry[ 
'term' ], $entry[ 'definition' ], $entry[ 'link' ], $entry[ 'style' ] );
-   }
+   $decoded[ 'glossary-entry' ] = array( $decoded[ 
'glossary-entry' ] );
}
+
+   foreach ( $decoded[ 'glossary-entry' ] as $entry ) {
+   $testCase[ 2 ][] = array( $entry[ 'term' ], 
$entry[ 'definition' ], $entry[ 'link' ], $entry[ 'style' ] );
+   }
+
\MediaWiki\restoreWarnings();
 
$data[] = $testCase;
diff --git a/tests/phpunit/Unit/BackendTest.php 
b/tests/phpunit/Unit/BackendTest.php
index e0e503f..04e1672 100644
--- a/tests/phpunit/Unit/BackendTest.php
+++ b/tests/phpunit/Unit/BackendTest.php
@@ -47,4 +47,20 @@
$this->assertFalse( $stub->useCache() );
}
 
+   public function testGetMessageLog() {
+
+   $log = $this->getMock( '\Lingo\MessageLog' );
+   $logRef = &$log;
+
+   $stub = $this->getMockBuilder( '\Lingo\Backend' )
+   ->disableOriginalConstructor()
+   ->getMockForAbstractClass();
+
+   $reflected = new \ReflectionClass( '\Lingo\Backend' );
+   $constructor = $reflected->getConstructor();
+   $constructor->invoke( $stub, $logRef );
+
+   $this->assertEquals( $log, $stub->getMessageLog() );
+   }
+
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I98d718ec46eab6de26a6577b97179cefec89680b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Improve tests - change (mediawiki...Lingo)

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

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

Change subject: Improve tests
..

Improve tests

Change-Id: I98d718ec46eab6de26a6577b97179cefec89680b
---
M docs/release-notes.md
M extension.json
M tests/phpunit/Integration/ArticleAnnotationTest.php
M tests/phpunit/Unit/BackendTest.php
4 files changed, 39 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/55/277055/1

diff --git a/docs/release-notes.md b/docs/release-notes.md
index 98e1f89..71219e1 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -1,10 +1,20 @@
 ## Release Notes
 
-### Lingo 2.0.1
+### Lingo 2.0.2
 
 Released on tbd
 
 Changes:
+
+
+Fixes:
+
+
+### Lingo 2.0.1
+
+Released on 13-Mar-2016
+
+Changes:
 * Improved test coverage
 
 Fixes:
diff --git a/extension.json b/extension.json
index 990c892..99b1e47 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Lingo",
-   "version": "2.0.1",
+   "version": "2.0.2-dev",
"author": [
"Barry Coughlan",
"[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]",
diff --git a/tests/phpunit/Integration/ArticleAnnotationTest.php 
b/tests/phpunit/Integration/ArticleAnnotationTest.php
index 9966d56..6526897 100644
--- a/tests/phpunit/Integration/ArticleAnnotationTest.php
+++ b/tests/phpunit/Integration/ArticleAnnotationTest.php
@@ -50,6 +50,9 @@
 class ArticleAnnotationTest extends \PHPUnit_Framework_TestCase {
 
public function setup() {
+
+   $GLOBALS[ 'wgexLingoDisplayOnce' ] = false;
+
}
 
public function tearDown() {
@@ -107,7 +110,9 @@
$json = json_encode( $xml );
$decoded = json_decode( $json, TRUE );
 
+   // suppress warnings for non-existant array keys
\MediaWiki\suppressWarnings();
+
$testCase = array(
0 => substr( $file, strlen( __DIR__ . 
'/../Fixture/articleAnnotation' ) ),
1 => $decoded[ 'text' ],
@@ -116,14 +121,13 @@
);
 
if ( array_key_exists( 'term', $decoded[ 
'glossary-entry' ] ) ) {
-
-   $testCase[ 2 ][] = array( $decoded[ 
'glossary-entry' ][ 'term' ], $decoded[ 'glossary-entry' ][ 'definition' ], 
$decoded[ 'glossary-entry' ][ 'link' ], $decoded[ 'glossary-entry' ][ 'style' ] 
);
-
-   } else {
-   foreach ( $decoded[ 'glossary-entry' ] as 
$entry ) {
-   $testCase[ 2 ][] = array( $entry[ 
'term' ], $entry[ 'definition' ], $entry[ 'link' ], $entry[ 'style' ] );
-   }
+   $decoded[ 'glossary-entry' ] = array( $decoded[ 
'glossary-entry' ] );
}
+
+   foreach ( $decoded[ 'glossary-entry' ] as $entry ) {
+   $testCase[ 2 ][] = array( $entry[ 'term' ], 
$entry[ 'definition' ], $entry[ 'link' ], $entry[ 'style' ] );
+   }
+
\MediaWiki\restoreWarnings();
 
$data[] = $testCase;
diff --git a/tests/phpunit/Unit/BackendTest.php 
b/tests/phpunit/Unit/BackendTest.php
index e0e503f..04e1672 100644
--- a/tests/phpunit/Unit/BackendTest.php
+++ b/tests/phpunit/Unit/BackendTest.php
@@ -47,4 +47,20 @@
$this->assertFalse( $stub->useCache() );
}
 
+   public function testGetMessageLog() {
+
+   $log = $this->getMock( '\Lingo\MessageLog' );
+   $logRef = &$log;
+
+   $stub = $this->getMockBuilder( '\Lingo\Backend' )
+   ->disableOriginalConstructor()
+   ->getMockForAbstractClass();
+
+   $reflected = new \ReflectionClass( '\Lingo\Backend' );
+   $constructor = $reflected->getConstructor();
+   $constructor->invoke( $stub, $logRef );
+
+   $this->assertEquals( $log, $stub->getMessageLog() );
+   }
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I98d718ec46eab6de26a6577b97179cefec89680b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Fix test for latin - change (mediawiki...Lingo)

2016-03-12 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Fix test for latin
..


Fix test for latin

Change-Id: I7975b48830631bfe5b38a18425c6bef290bcf418
---
M tests/phpunit/Fixture/articleAnnotation/latin.xml
1 file changed, 7 insertions(+), 7 deletions(-)

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



diff --git a/tests/phpunit/Fixture/articleAnnotation/latin.xml 
b/tests/phpunit/Fixture/articleAnnotation/latin.xml
index 96e7555..6ffa67c 100644
--- a/tests/phpunit/Fixture/articleAnnotation/latin.xml
+++ b/tests/phpunit/Fixture/articleAnnotation/latin.xml
@@ -63,12 +63,12 @@
 
 Putent nemore vituperata velvel-defvel-def an, ut 
iuvaret delicata quaerendum est. Quas
 viderer civibus an cum. Vidisse efficiantur nam ut. Id sed aeque similique
-definitionem, in fugit partem copiosae eum. Sit diceret repudiare ne, ea ius
+definitionem, in fugit partem copiosae eum. Sit diceret repudiare ne, ea iusius-def
 alii laboramus.
 
 Brute viris propriae vis ad. Cu modusmodus-def 
pericula eum. Qui ne quot recusabo
 eloquentiam, ex quod hinc veritus per, vix at putent molestie consequuntur. His
-in omnes gloriatur, propriae posidonium duo ne. Convenire consulatu 
definitiones
+in omnesomnes-def 
gloriatur, propriae posidonium duo ne. Convenire consulatu definitiones
 et quo, mea autem fabulas epicuri ne. Erant percipit petentium ne qui, ad
 volumus facilisi mei.
 
@@ -77,7 +77,7 @@
 philosophia pri.
 
 Equidem consequuntur eu sed, ne justo partiendo sea, facilis apeirian eos te. 
Et
-fabellas rationibus nam. Nullam offendit eam et. Ea nostrum assueverit ius,
+fabellas rationibus nam. Nullam offendit eam et. Ea nostrum assueverit iusius-def,
 copiosae tincidunt ullamcorper quo eu.
 
 Ex vocent molestiae nam, in usu aliquip assentior. Sensibus dissentiunt
@@ -85,19 +85,19 @@
 
 Te per laudem graecis conclusionemque. No mel lorem eligendi appellantur. Ut 
usu
 duis legendos hendrerit. Oportere liberavisse duo te. Eum et quis ullum
-scaevola, nam duis voluptua et, vel ei nostrud veritus. Eam ut erat integre,
+scaevola, nam duis voluptua et, velvel-defvel-def ei nostrud 
veritus. Eam ut erat integre,
 rebum accusam noluisse ne vis.
 
-Oblique feugiat rationibus sit te, ius erat facilisi accusamus ei. Eu eum 
noster
+Oblique feugiat rationibus sit te, iusius-def erat 
facilisi accusamus ei. Eu eum noster
 nostro. Detracto argumentum te pri. His meis periculis vituperata te, vix ei
 etiam omittam reformidans. Usu ex dolores erroribus abhorreant. Ea vidit atqui
-philosophia duo, ius ad vide tritani appareat. Enim timeam nonumes ius no.
+philosophia duo, iusius-def ad 
vide tritani appareat. Enim timeam nonumes iusius-def no.
 
 No prima audire quo, ei ubique mucius scribentur eos, cu duis harum philosophia
 usu. Detracto recusabo antiopam cu mea. An petentium appellantur vix, te eum
 elitr quidam doctus, et errem malorum omnesque sed. Nam cu errem dictas
 concludaturque, quo illud dolores ut. Has te nibh velit concludaturque, quod
-erant iuvaret est an, ius ex lorem molestie pertinax.
+erant iuvaret est an, iusius-def ex 
lorem molestie pertinax.
 
 Ius at sonet incorrupte. Ei sea honestatis complectitur, ei vim quando persius
 epicuri. Mei duis percipit no, postea pericula prodesset mel ex. Ea vix nostrud

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7975b48830631bfe5b38a18425c6bef290bcf418
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Fix test for latin - change (mediawiki...Lingo)

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

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

Change subject: Fix test for latin
..

Fix test for latin

Change-Id: I7975b48830631bfe5b38a18425c6bef290bcf418
---
M tests/phpunit/Fixture/articleAnnotation/latin.xml
1 file changed, 7 insertions(+), 7 deletions(-)


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

diff --git a/tests/phpunit/Fixture/articleAnnotation/latin.xml 
b/tests/phpunit/Fixture/articleAnnotation/latin.xml
index 96e7555..6ffa67c 100644
--- a/tests/phpunit/Fixture/articleAnnotation/latin.xml
+++ b/tests/phpunit/Fixture/articleAnnotation/latin.xml
@@ -63,12 +63,12 @@
 
 Putent nemore vituperata velvel-defvel-def an, ut 
iuvaret delicata quaerendum est. Quas
 viderer civibus an cum. Vidisse efficiantur nam ut. Id sed aeque similique
-definitionem, in fugit partem copiosae eum. Sit diceret repudiare ne, ea ius
+definitionem, in fugit partem copiosae eum. Sit diceret repudiare ne, ea iusius-def
 alii laboramus.
 
 Brute viris propriae vis ad. Cu modusmodus-def 
pericula eum. Qui ne quot recusabo
 eloquentiam, ex quod hinc veritus per, vix at putent molestie consequuntur. His
-in omnes gloriatur, propriae posidonium duo ne. Convenire consulatu 
definitiones
+in omnesomnes-def 
gloriatur, propriae posidonium duo ne. Convenire consulatu definitiones
 et quo, mea autem fabulas epicuri ne. Erant percipit petentium ne qui, ad
 volumus facilisi mei.
 
@@ -77,7 +77,7 @@
 philosophia pri.
 
 Equidem consequuntur eu sed, ne justo partiendo sea, facilis apeirian eos te. 
Et
-fabellas rationibus nam. Nullam offendit eam et. Ea nostrum assueverit ius,
+fabellas rationibus nam. Nullam offendit eam et. Ea nostrum assueverit iusius-def,
 copiosae tincidunt ullamcorper quo eu.
 
 Ex vocent molestiae nam, in usu aliquip assentior. Sensibus dissentiunt
@@ -85,19 +85,19 @@
 
 Te per laudem graecis conclusionemque. No mel lorem eligendi appellantur. Ut 
usu
 duis legendos hendrerit. Oportere liberavisse duo te. Eum et quis ullum
-scaevola, nam duis voluptua et, vel ei nostrud veritus. Eam ut erat integre,
+scaevola, nam duis voluptua et, velvel-defvel-def ei nostrud 
veritus. Eam ut erat integre,
 rebum accusam noluisse ne vis.
 
-Oblique feugiat rationibus sit te, ius erat facilisi accusamus ei. Eu eum 
noster
+Oblique feugiat rationibus sit te, iusius-def erat 
facilisi accusamus ei. Eu eum noster
 nostro. Detracto argumentum te pri. His meis periculis vituperata te, vix ei
 etiam omittam reformidans. Usu ex dolores erroribus abhorreant. Ea vidit atqui
-philosophia duo, ius ad vide tritani appareat. Enim timeam nonumes ius no.
+philosophia duo, iusius-def ad 
vide tritani appareat. Enim timeam nonumes iusius-def no.
 
 No prima audire quo, ei ubique mucius scribentur eos, cu duis harum philosophia
 usu. Detracto recusabo antiopam cu mea. An petentium appellantur vix, te eum
 elitr quidam doctus, et errem malorum omnesque sed. Nam cu errem dictas
 concludaturque, quo illud dolores ut. Has te nibh velit concludaturque, quod
-erant iuvaret est an, ius ex lorem molestie pertinax.
+erant iuvaret est an, iusius-def ex 
lorem molestie pertinax.
 
 Ius at sonet incorrupte. Ei sea honestatis complectitur, ei vim quando persius
 epicuri. Mei duis percipit no, postea pericula prodesset mel ex. Ea vix nostrud

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7975b48830631bfe5b38a18425c6bef290bcf418
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Add more integration tests - change (mediawiki...Lingo)

2016-03-12 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Add more integration tests
..


Add more integration tests

Change-Id: I3c97e37b06824fb4091e122f1a32401cb8a805b5
---
A tests/phpunit/Fixture/articleAnnotation/cyrillic.xml
A tests/phpunit/Fixture/articleAnnotation/html.xml
A tests/phpunit/Fixture/articleAnnotation/latin.xml
M tests/phpunit/Fixture/articleAnnotation/simple.xml
4 files changed, 316 insertions(+), 6 deletions(-)

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



diff --git a/tests/phpunit/Fixture/articleAnnotation/cyrillic.xml 
b/tests/phpunit/Fixture/articleAnnotation/cyrillic.xml
new file mode 100644
index 000..405b880
--- /dev/null
+++ b/tests/phpunit/Fixture/articleAnnotation/cyrillic.xml
@@ -0,0 +1,35 @@
+
+
+   
+
+   
+   
+
+   
+   
+   торквюатоз
+   торквюатоз-def
+   
+   
+   декам
+   декам-def
+   
+   
+   мёнём
+   мёнём-def
+   
+   
+   но
+   но-def
+   
+
diff --git a/tests/phpunit/Fixture/articleAnnotation/html.xml 
b/tests/phpunit/Fixture/articleAnnotation/html.xml
new file mode 100644
index 000..cf30596
--- /dev/null
+++ b/tests/phpunit/Fixture/articleAnnotation/html.xml
@@ -0,0 +1,95 @@
+
+
+   
+
+   
+   
+
+   
+   
+   
+   publishing
+   publishing-def
+   
+   
+   
+   layout
+   layout-def
+   
+   
+   
+   mid-1980s
+   mid-1980s-def
+   
+   
+   
+   title
+   title-def
+   
+   
+   
+   sup
+   sup-def
+   
+   
+   
+   
+   
+   
+   
+   
+   quickly-generated
+   quickly-generated-def
+   
+
diff --git a/tests/phpunit/Fixture/articleAnnotation/latin.xml 
b/tests/phpunit/Fixture/articleAnnotation/latin.xml
new file mode 100644
index 000..96e7555
--- /dev/null
+++ b/tests/phpunit/Fixture/articleAnnotation/latin.xml
@@ -0,0 +1,141 @@
+
+
+   
+
+   
+   
+
+   
+   
+   ipsum
+   ipsum-def
+   
+   
+   vel
+   vel-def
+   
+   
+   vel
+   vel-def
+   
+   
+   mandamus
+   mandamus-def
+   
+   
+   ius
+   ius-def
+   
+   
+   modus
+   modus-def
+   
+   
+   omnes
+   omnes-def
+   
+   
+   has
+   has-def
+   
+
diff --git a/tests/phpunit/Fixture/articleAnnotation/simple.xml 
b/tests/phpunit/Fixture/articleAnnotation/simple.xml
index d66b9a0..ed9c0d0 100644
--- a/tests/phpunit/Fixture/articleAnnotation/simple.xml
+++ b/tests/phpunit/Fixture/articleAnnotation/simple.xml
@@ -1,20 +1,59 @@
+
 

 


 


-   foo
-   bar
+   
+   lorem
+   lorem-def


-   baz
-   quok
+   
+   ipsüm
+   ipsüm-def
+   
+   
+   
+   dolor sit
+   dolor sit-def
+   
+   
+   
+   हीकम
+   हीकम-def
+   
+   
+   
+   他携
+   他携-def
+   
+   
+   
+   d4 t3xt
+   d4 t3xt-def
+   
+   
+   d4
+   d4-def

 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c97e37b06824fb4091e122f1a32401cb8a805b5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Add more integration tests - change (mediawiki...Lingo)

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

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

Change subject: Add more integration tests
..

Add more integration tests

Change-Id: I3c97e37b06824fb4091e122f1a32401cb8a805b5
---
A tests/phpunit/Fixture/articleAnnotation/cyrillic.xml
A tests/phpunit/Fixture/articleAnnotation/html.xml
A tests/phpunit/Fixture/articleAnnotation/latin.xml
M tests/phpunit/Fixture/articleAnnotation/simple.xml
4 files changed, 316 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/52/277052/1

diff --git a/tests/phpunit/Fixture/articleAnnotation/cyrillic.xml 
b/tests/phpunit/Fixture/articleAnnotation/cyrillic.xml
new file mode 100644
index 000..405b880
--- /dev/null
+++ b/tests/phpunit/Fixture/articleAnnotation/cyrillic.xml
@@ -0,0 +1,35 @@
+
+
+   
+
+   
+   
+
+   
+   
+   торквюатоз
+   торквюатоз-def
+   
+   
+   декам
+   декам-def
+   
+   
+   мёнём
+   мёнём-def
+   
+   
+   но
+   но-def
+   
+
diff --git a/tests/phpunit/Fixture/articleAnnotation/html.xml 
b/tests/phpunit/Fixture/articleAnnotation/html.xml
new file mode 100644
index 000..cf30596
--- /dev/null
+++ b/tests/phpunit/Fixture/articleAnnotation/html.xml
@@ -0,0 +1,95 @@
+
+
+   
+
+   
+   
+
+   
+   
+   
+   publishing
+   publishing-def
+   
+   
+   
+   layout
+   layout-def
+   
+   
+   
+   mid-1980s
+   mid-1980s-def
+   
+   
+   
+   title
+   title-def
+   
+   
+   
+   sup
+   sup-def
+   
+   
+   
+   
+   
+   
+   
+   
+   quickly-generated
+   quickly-generated-def
+   
+
diff --git a/tests/phpunit/Fixture/articleAnnotation/latin.xml 
b/tests/phpunit/Fixture/articleAnnotation/latin.xml
new file mode 100644
index 000..96e7555
--- /dev/null
+++ b/tests/phpunit/Fixture/articleAnnotation/latin.xml
@@ -0,0 +1,141 @@
+
+
+   
+
+   
+   
+
+   
+   
+   ipsum
+   ipsum-def
+   
+   
+   vel
+   vel-def
+   
+   
+   vel
+   vel-def
+   
+   
+   mandamus
+   mandamus-def
+   
+   
+   ius
+   ius-def
+   
+   
+   modus
+   modus-def
+   
+   
+   omnes
+   omnes-def
+   
+   
+   has
+   has-def
+   
+
diff --git a/tests/phpunit/Fixture/articleAnnotation/simple.xml 
b/tests/phpunit/Fixture/articleAnnotation/simple.xml
index d66b9a0..ed9c0d0 100644
--- a/tests/phpunit/Fixture/articleAnnotation/simple.xml
+++ b/tests/phpunit/Fixture/articleAnnotation/simple.xml
@@ -1,20 +1,59 @@
+
 

 


 


-   foo
-   bar
+   
+   lorem
+   lorem-def


-   baz
-   quok
+   
+   ipsüm
+   ipsüm-def
+   
+   
+   
+   dolor sit
+   dolor sit-def
+   
+   
+   
+   हीकम
+   हीकम-def
+   
+   
+   
+   他携
+   他携-def
+   
+   
+   
+   d4 t3xt
+   d4 t3xt-def
+   
+   
+   d4
+   d4-def

 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c97e37b06824fb4091e122f1a32401cb8a805b5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Remove support for old MW versions - change (mediawiki...Lingo)

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

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

Change subject: Remove support for old MW versions
..

Remove support for old MW versions

Change-Id: I2f75b2a92bc8d780f610cf39ccec6fe5e491bc59
---
M .travis.yml
M src/LingoParser.php
2 files changed, 11 insertions(+), 24 deletions(-)


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

diff --git a/.travis.yml b/.travis.yml
index f9d438f..1aa7b12 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -36,3 +36,7 @@
 
 script:
 - bash ./build/travis/script.sh
+
+notifications:
+  email:
+- s7ep...@gmail.com
diff --git a/src/LingoParser.php b/src/LingoParser.php
index edadfb1..8b5dc2e 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -326,34 +326,17 @@
$parserOutput = $parser->getOutput();
 
// load scripts
-   if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) {
-   $parserOutput->addModules( 'ext.Lingo.Scripts' );
+   $parserOutput->addModules( 'ext.Lingo.Scripts' );
 
-   if ( !$wgOut->isArticle() ) {
-   $wgOut->addModules( 'ext.Lingo.Scripts' );
-   }
-   } else {
-   global $wgStylePath;
-   $parserOutput->addHeadItem( "\n", 'ext.Lingo.jq' );
-   $parserOutput->addHeadItem( "\n", 
'ext.Lingo.Scripts' );
-
-   if ( !$wgOut->isArticle() ) {
-   $wgOut->addHeadItem( 'ext.Lingo.jq', "\n" );
-   $wgOut->addHeadItem( 'ext.Lingo.Scripts', 
"\n" );
-   }
+   if ( !$wgOut->isArticle() ) {
+   $wgOut->addModules( 'ext.Lingo.Scripts' );
}
 
// load styles
-   if ( method_exists( $parserOutput, 'addModuleStyles' ) ) {
-   $parserOutput->addModuleStyles( 'ext.Lingo.Styles' );
-   if ( !$wgOut->isArticle() ) {
-   $wgOut->addModuleStyles( 'ext.Lingo.Styles' );
-   }
-   } else {
-   $parserOutput->addHeadItem( "\n", 
'ext.Lingo.Styles' );
-   if ( !$wgOut->isArticle() ) {
-   $wgOut->addHeadItem( 'ext.Lingo.Styles', "\n" );
-   }
+   $parserOutput->addModuleStyles( 'ext.Lingo.Styles' );
+
+   if ( !$wgOut->isArticle() ) {
+   $wgOut->addModuleStyles( 'ext.Lingo.Styles' );
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f75b2a92bc8d780f610cf39ccec6fe5e491bc59
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Remove support for old MW versions - change (mediawiki...Lingo)

2016-03-12 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Remove support for old MW versions
..


Remove support for old MW versions

Change-Id: I2f75b2a92bc8d780f610cf39ccec6fe5e491bc59
---
M .travis.yml
M src/LingoParser.php
2 files changed, 11 insertions(+), 24 deletions(-)

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



diff --git a/.travis.yml b/.travis.yml
index f9d438f..1aa7b12 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -36,3 +36,7 @@
 
 script:
 - bash ./build/travis/script.sh
+
+notifications:
+  email:
+- s7ep...@gmail.com
diff --git a/src/LingoParser.php b/src/LingoParser.php
index edadfb1..8b5dc2e 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -326,34 +326,17 @@
$parserOutput = $parser->getOutput();
 
// load scripts
-   if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) {
-   $parserOutput->addModules( 'ext.Lingo.Scripts' );
+   $parserOutput->addModules( 'ext.Lingo.Scripts' );
 
-   if ( !$wgOut->isArticle() ) {
-   $wgOut->addModules( 'ext.Lingo.Scripts' );
-   }
-   } else {
-   global $wgStylePath;
-   $parserOutput->addHeadItem( "\n", 'ext.Lingo.jq' );
-   $parserOutput->addHeadItem( "\n", 
'ext.Lingo.Scripts' );
-
-   if ( !$wgOut->isArticle() ) {
-   $wgOut->addHeadItem( 'ext.Lingo.jq', "\n" );
-   $wgOut->addHeadItem( 'ext.Lingo.Scripts', 
"\n" );
-   }
+   if ( !$wgOut->isArticle() ) {
+   $wgOut->addModules( 'ext.Lingo.Scripts' );
}
 
// load styles
-   if ( method_exists( $parserOutput, 'addModuleStyles' ) ) {
-   $parserOutput->addModuleStyles( 'ext.Lingo.Styles' );
-   if ( !$wgOut->isArticle() ) {
-   $wgOut->addModuleStyles( 'ext.Lingo.Styles' );
-   }
-   } else {
-   $parserOutput->addHeadItem( "\n", 
'ext.Lingo.Styles' );
-   if ( !$wgOut->isArticle() ) {
-   $wgOut->addHeadItem( 'ext.Lingo.Styles', "\n" );
-   }
+   $parserOutput->addModuleStyles( 'ext.Lingo.Styles' );
+
+   if ( !$wgOut->isArticle() ) {
+   $wgOut->addModuleStyles( 'ext.Lingo.Styles' );
}
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2f75b2a92bc8d780f610cf39ccec6fe5e491bc59
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Replace too new function in ArticleAnnotationTest - change (mediawiki...Lingo)

2016-03-12 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Replace too new function in ArticleAnnotationTest
..


Replace too new function in ArticleAnnotationTest

Change-Id: I567692eaebf6de0583fe8939c9d62844159ecfb8
---
M tests/phpunit/Integration/ArticleAnnotationTest.php
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/tests/phpunit/Integration/ArticleAnnotationTest.php 
b/tests/phpunit/Integration/ArticleAnnotationTest.php
index b600996..9966d56 100644
--- a/tests/phpunit/Integration/ArticleAnnotationTest.php
+++ b/tests/phpunit/Integration/ArticleAnnotationTest.php
@@ -30,6 +30,7 @@
 
 use Parser;
 use ParserOptions;
+use User;
 
 use PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls;
 use ReflectionClass;
@@ -72,7 +73,7 @@
$parser = new Parser();
$parser->startExternalParse(
/* Title */ null,
-   /* ParserOptions */ ParserOptions::newFromAnon(),
+   /* ParserOptions */ ParserOptions::newFromUser( new 
User() ),
/* $outputType = */ Parser::OT_HTML,
/* $clearState = */ true
);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I567692eaebf6de0583fe8939c9d62844159ecfb8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Replace too new function in ArticleAnnotationTest - change (mediawiki...Lingo)

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

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

Change subject: Replace too new function in ArticleAnnotationTest
..

Replace too new function in ArticleAnnotationTest

Change-Id: I567692eaebf6de0583fe8939c9d62844159ecfb8
---
M tests/phpunit/Integration/ArticleAnnotationTest.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/94/276994/1

diff --git a/tests/phpunit/Integration/ArticleAnnotationTest.php 
b/tests/phpunit/Integration/ArticleAnnotationTest.php
index b600996..9966d56 100644
--- a/tests/phpunit/Integration/ArticleAnnotationTest.php
+++ b/tests/phpunit/Integration/ArticleAnnotationTest.php
@@ -30,6 +30,7 @@
 
 use Parser;
 use ParserOptions;
+use User;
 
 use PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls;
 use ReflectionClass;
@@ -72,7 +73,7 @@
$parser = new Parser();
$parser->startExternalParse(
/* Title */ null,
-   /* ParserOptions */ ParserOptions::newFromAnon(),
+   /* ParserOptions */ ParserOptions::newFromUser( new 
User() ),
/* $outputType = */ Parser::OT_HTML,
/* $clearState = */ true
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I567692eaebf6de0583fe8939c9d62844159ecfb8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Release Lingo 2.0.1 - change (mediawiki...Lingo)

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

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

Change subject: Release Lingo 2.0.1
..

Release Lingo 2.0.1

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/91/276991/1

diff --git a/extension.json b/extension.json
index 33109d2..990c892 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Lingo",
-   "version": "2.0.1-dev",
+   "version": "2.0.1",
"author": [
"Barry Coughlan",
"[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I81f58101685dcc3ced9d15c4ba1bb01ec2a5bf62
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Release Lingo 2.0.1 - change (mediawiki...Lingo)

2016-03-12 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Release Lingo 2.0.1
..


Release Lingo 2.0.1

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

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



diff --git a/extension.json b/extension.json
index 33109d2..990c892 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Lingo",
-   "version": "2.0.1-dev",
+   "version": "2.0.1",
"author": [
"Barry Coughlan",
"[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I81f58101685dcc3ced9d15c4ba1bb01ec2a5bf62
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Limit cache retention time - change (mediawiki...Lingo)

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

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

Change subject: Limit cache retention time
..

Limit cache retention time

Change-Id: Ib543892ddc1b44624f73559e440f002c7c566c55
---
M docs/release-notes.md
M src/LingoParser.php
2 files changed, 19 insertions(+), 3 deletions(-)


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

diff --git a/docs/release-notes.md b/docs/release-notes.md
index cd9bf44..98e1f89 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -7,6 +7,9 @@
 Changes:
 * Improved test coverage
 
+Fixes:
+* Outdated cache entries are not loaded anymore
+
 ### Lingo 2.0.0
 
 Released on 09-Mar-2016
diff --git a/src/LingoParser.php b/src/LingoParser.php
index 5c3e4d6..edadfb1 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -93,6 +93,13 @@
}
 
/**
+* @return string
+*/
+   private static function getCacheKey() {
+   return wfMemcKey( 'ext', 'lingo', 'lingotree', 
Tree::TREE_VERSION );
+   }
+
+   /**
 *
 * @return Backend the backend used by the parser
 */
@@ -131,7 +138,7 @@
// Try cache first
global $wgexLingoCacheType;
$cache = ( $wgexLingoCacheType !== null ) ? 
wfGetCache( $wgexLingoCacheType ) : wfGetMainCache();
-   $cachekey = wfMemcKey( 'ext', 'lingo', 
'lingotree', Tree::TREE_VERSION );
+   $cachekey = self::getCacheKey();
$cachedLingoTree = $cache->get( $cachekey );
 
// cache hit?
@@ -140,13 +147,19 @@
wfDebug( "Cache hit: Got lingo tree 
from cache.\n" );
$this->mLingoTree = &$cachedLingoTree;
 
+   wfDebug( "Re-cached lingo tree.\n" );
} else {
 
wfDebug( "Cache miss: Lingo tree not 
found in cache.\n" );
$this->mLingoTree =& 
$this->buildLingo();
-   $cache->set( $cachekey, 
$this->mLingoTree );
wfDebug( "Cached lingo tree.\n" );
}
+
+   // Keep for one month
+   // Limiting the cache validity will allow to 
purge stale cache
+   // entries inserted by older versions after one 
month
+   $cache->set( $cachekey, $this->mLingoTree, 60 * 
60 * 24 * 30 );
+
} else {
wfDebug( "Caching of lingo tree disabled.\n" );
$this->mLingoTree =& $this->buildLingo();
@@ -351,7 +364,7 @@
 
global $wgexLingoCacheType;
$cache = ( $wgexLingoCacheType !== null ) ? wfGetCache( 
$wgexLingoCacheType ) : wfGetMainCache();
-   $cache->delete( wfMemcKey( 'ext', 'lingo', 'lingotree' ) );
+   $cache->delete( self::getCacheKey() );
 
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib543892ddc1b44624f73559e440f002c7c566c55
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Limit cache retention time - change (mediawiki...Lingo)

2016-03-12 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Limit cache retention time
..


Limit cache retention time

Change-Id: Ib543892ddc1b44624f73559e440f002c7c566c55
---
M docs/release-notes.md
M src/LingoParser.php
2 files changed, 19 insertions(+), 3 deletions(-)

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



diff --git a/docs/release-notes.md b/docs/release-notes.md
index cd9bf44..98e1f89 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -7,6 +7,9 @@
 Changes:
 * Improved test coverage
 
+Fixes:
+* Outdated cache entries are not loaded anymore
+
 ### Lingo 2.0.0
 
 Released on 09-Mar-2016
diff --git a/src/LingoParser.php b/src/LingoParser.php
index 5c3e4d6..edadfb1 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -93,6 +93,13 @@
}
 
/**
+* @return string
+*/
+   private static function getCacheKey() {
+   return wfMemcKey( 'ext', 'lingo', 'lingotree', 
Tree::TREE_VERSION );
+   }
+
+   /**
 *
 * @return Backend the backend used by the parser
 */
@@ -131,7 +138,7 @@
// Try cache first
global $wgexLingoCacheType;
$cache = ( $wgexLingoCacheType !== null ) ? 
wfGetCache( $wgexLingoCacheType ) : wfGetMainCache();
-   $cachekey = wfMemcKey( 'ext', 'lingo', 
'lingotree', Tree::TREE_VERSION );
+   $cachekey = self::getCacheKey();
$cachedLingoTree = $cache->get( $cachekey );
 
// cache hit?
@@ -140,13 +147,19 @@
wfDebug( "Cache hit: Got lingo tree 
from cache.\n" );
$this->mLingoTree = &$cachedLingoTree;
 
+   wfDebug( "Re-cached lingo tree.\n" );
} else {
 
wfDebug( "Cache miss: Lingo tree not 
found in cache.\n" );
$this->mLingoTree =& 
$this->buildLingo();
-   $cache->set( $cachekey, 
$this->mLingoTree );
wfDebug( "Cached lingo tree.\n" );
}
+
+   // Keep for one month
+   // Limiting the cache validity will allow to 
purge stale cache
+   // entries inserted by older versions after one 
month
+   $cache->set( $cachekey, $this->mLingoTree, 60 * 
60 * 24 * 30 );
+
} else {
wfDebug( "Caching of lingo tree disabled.\n" );
$this->mLingoTree =& $this->buildLingo();
@@ -351,7 +364,7 @@
 
global $wgexLingoCacheType;
$cache = ( $wgexLingoCacheType !== null ) ? wfGetCache( 
$wgexLingoCacheType ) : wfGetMainCache();
-   $cache->delete( wfMemcKey( 'ext', 'lingo', 'lingotree' ) );
+   $cache->delete( self::getCacheKey() );
 
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib543892ddc1b44624f73559e440f002c7c566c55
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
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 version number to cache key to avoid loading incompatibl... - change (mediawiki...Lingo)

2016-03-12 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Add version number to cache key to avoid loading incompatible 
trees
..


Add version number to cache key to avoid loading incompatible trees

Change-Id: Id592e15821a4ceb2014210e69931cf12cfb7b5e7
---
M src/LingoParser.php
M src/Tree.php
2 files changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/src/LingoParser.php b/src/LingoParser.php
index 524e4e1..5c3e4d6 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -131,7 +131,7 @@
// Try cache first
global $wgexLingoCacheType;
$cache = ( $wgexLingoCacheType !== null ) ? 
wfGetCache( $wgexLingoCacheType ) : wfGetMainCache();
-   $cachekey = wfMemcKey( 'ext', 'lingo', 
'lingotree' );
+   $cachekey = wfMemcKey( 'ext', 'lingo', 
'lingotree', Tree::TREE_VERSION );
$cachedLingoTree = $cache->get( $cachekey );
 
// cache hit?
diff --git a/src/Tree.php b/src/Tree.php
index ccb3c6d..4021e3c 100644
--- a/src/Tree.php
+++ b/src/Tree.php
@@ -50,6 +50,8 @@
  */
 class Tree {
 
+   const TREE_VERSION = 2;
+
private $mTree = array();
private $mList = array();
private $mMinLength = 1000;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id592e15821a4ceb2014210e69931cf12cfb7b5e7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
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 simple integration test - change (mediawiki...Lingo)

2016-03-12 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Add simple integration test
..


Add simple integration test

Change-Id: I6579622bc46f89720b29199401343b07dcfde104
---
M docs/release-notes.md
M extension.json
M src/LingoParser.php
A tests/phpunit/Fixture/articleAnnotation/simple.xml
A tests/phpunit/Integration/ArticleAnnotationTest.php
A tests/phpunit/Util/XmlFileProvider.php
6 files changed, 274 insertions(+), 8 deletions(-)

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



diff --git a/docs/release-notes.md b/docs/release-notes.md
index 1fe7436..cd9bf44 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -1,5 +1,12 @@
 ## Release Notes
 
+### Lingo 2.0.1
+
+Released on tbd
+
+Changes:
+* Improved test coverage
+
 ### Lingo 2.0.0
 
 Released on 09-Mar-2016
@@ -27,7 +34,7 @@
 * Migrate to JSON i18n
 * Remove wfMsg / wfMsgForContent usage
 * Unstrip strip items of 'general' category
-* Swap SpecialVersionExtensionTypes for ExtensionTypes
+* Use ExtensionFunctions instead of SpecialVersionExtensionTypes
 
 ### Lingo 1.1.0
 
diff --git a/extension.json b/extension.json
index c54831a..33109d2 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Lingo",
-   "version": "2.0.0",
+   "version": "2.0.1-dev",
"author": [
"Barry Coughlan",
"[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]",
@@ -66,7 +66,8 @@
"Lingo\\Element": "/src/Element.php",
"Lingo\\Backend": "/src/Backend.php",
"Lingo\\BasicBackend": "/src/BasicBackend.php",
-   "Lingo\\MessageLog": "/src/MessageLog.php"
+   "Lingo\\MessageLog": "/src/MessageLog.php",
+   "Lingo\\Tests\\Util\\XmlFileProvider": 
"/tests/phpunit/Util/XmlFileProvider.php"
},
"Hooks": {
"ParserFirstCallInit": [
diff --git a/src/LingoParser.php b/src/LingoParser.php
index 684ed34..524e4e1 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -60,7 +60,7 @@
public function __construct( MessageLog &$messages = null ) {
global $wgexLingoBackend;
 
-   $this->mLingoBackend = new $wgexLingoBackend( $messages );
+   $this->setBackend( new $wgexLingoBackend( $messages ) );
}
 
/**
@@ -71,6 +71,16 @@
 */
public static function parse( Parser &$parser, &$text ) {
 
+   self::getInstance()->realParse( $parser, $text );
+
+   return true;
+   }
+
+   /**
+* @return LingoParser
+* @since 2.0.1
+*/
+   public static function getInstance() {
if ( !self::$parserSingleton ) {
self::$parserSingleton = new LingoParser();
 
@@ -79,9 +89,7 @@
self::$regex = '/' . preg_quote( Parser::MARKER_PREFIX, 
'/' ) . '.*?' . preg_quote( Parser::MARKER_SUFFIX, '/' ) . 
'|[\p{L}\p{N}]+|[^\p{L}\p{N}]/u';
}
 
-   self::$parserSingleton->realParse( $parser, $text );
-
-   return true;
+   return self::$parserSingleton;
}
 
/**
@@ -297,7 +305,7 @@
}
 
/**
-* @param $parser
+* @param Parser $parser
 */
protected function loadModules( &$parser ) {
global $wgOut, $wgScriptPath;
@@ -346,5 +354,13 @@
$cache->delete( wfMemcKey( 'ext', 'lingo', 'lingotree' ) );
 
}
+
+   /**
+* @since 2.0.1
+* @param Backend $backend
+*/
+   public function setBackend( $backend ) {
+   $this->mLingoBackend = $backend;
+   }
 }
 
diff --git a/tests/phpunit/Fixture/articleAnnotation/simple.xml 
b/tests/phpunit/Fixture/articleAnnotation/simple.xml
new file mode 100644
index 000..d66b9a0
--- /dev/null
+++ b/tests/phpunit/Fixture/articleAnnotation/simple.xml
@@ -0,0 +1,20 @@
+
+   
+
+   
+   
+
+   
+   
+   foo
+   bar
+   
+   
+   baz
+   quok
+   
+
diff --git a/tests/phpunit/Integration/ArticleAnnotationTest.php 
b/tests/phpunit/Integration/ArticleAnnotationTest.php
new file mode 100644
index 000..b600996
--- /dev/null
+++ b/tests/phpunit/Integration/ArticleAnnotationTest.php
@@ -0,0 +1,133 @@
+http://www.gnu.org/licenses/>.
+ *
+ * @since 2.0.1
+ * @file
+ * @ingroup Lingo
+ */
+
+namespace Lingo\Tests\Integration;
+
+use Lingo\LingoParser;
+use Lingo\Tests\Util\XmlFileProvider;
+
+use Parser;
+use ParserOptions;
+
+use PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls;
+use ReflectionClass;
+
+/**
+ * @group extensions-lingo
+ * @group extensions-lingo-integration
+ * @group mediawiki-databaseless
+ *
+ * @coversNothing
+ *
+ * @ingroup Lingo
+ * @ingroup Test
+ * @since 2.0.1
+ * @author Stephan Gambke
+ */
+class 

[MediaWiki-commits] [Gerrit] Add version number to cache key to avoid loading incompatibl... - change (mediawiki...Lingo)

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

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

Change subject: Add version number to cache key to avoid loading incompatible 
trees
..

Add version number to cache key to avoid loading incompatible trees

Change-Id: Id592e15821a4ceb2014210e69931cf12cfb7b5e7
---
M src/LingoParser.php
M src/Tree.php
2 files changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/81/276981/1

diff --git a/src/LingoParser.php b/src/LingoParser.php
index 524e4e1..5c3e4d6 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -131,7 +131,7 @@
// Try cache first
global $wgexLingoCacheType;
$cache = ( $wgexLingoCacheType !== null ) ? 
wfGetCache( $wgexLingoCacheType ) : wfGetMainCache();
-   $cachekey = wfMemcKey( 'ext', 'lingo', 
'lingotree' );
+   $cachekey = wfMemcKey( 'ext', 'lingo', 
'lingotree', Tree::TREE_VERSION );
$cachedLingoTree = $cache->get( $cachekey );
 
// cache hit?
diff --git a/src/Tree.php b/src/Tree.php
index ccb3c6d..4021e3c 100644
--- a/src/Tree.php
+++ b/src/Tree.php
@@ -50,6 +50,8 @@
  */
 class Tree {
 
+   const TREE_VERSION = 2;
+
private $mTree = array();
private $mList = array();
private $mMinLength = 1000;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id592e15821a4ceb2014210e69931cf12cfb7b5e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Add simple integration test - change (mediawiki...Lingo)

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

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

Change subject: Add simple integration test
..

Add simple integration test

Change-Id: I6579622bc46f89720b29199401343b07dcfde104
---
M docs/release-notes.md
M extension.json
M src/LingoParser.php
A tests/phpunit/Fixture/articleAnnotation/simple.xml
A tests/phpunit/Integration/ArticleAnnotationTest.php
A tests/phpunit/Util/XmlFileProvider.php
6 files changed, 274 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/79/276979/1

diff --git a/docs/release-notes.md b/docs/release-notes.md
index 1fe7436..cd9bf44 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -1,5 +1,12 @@
 ## Release Notes
 
+### Lingo 2.0.1
+
+Released on tbd
+
+Changes:
+* Improved test coverage
+
 ### Lingo 2.0.0
 
 Released on 09-Mar-2016
@@ -27,7 +34,7 @@
 * Migrate to JSON i18n
 * Remove wfMsg / wfMsgForContent usage
 * Unstrip strip items of 'general' category
-* Swap SpecialVersionExtensionTypes for ExtensionTypes
+* Use ExtensionFunctions instead of SpecialVersionExtensionTypes
 
 ### Lingo 1.1.0
 
diff --git a/extension.json b/extension.json
index c54831a..33109d2 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Lingo",
-   "version": "2.0.0",
+   "version": "2.0.1-dev",
"author": [
"Barry Coughlan",
"[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]",
@@ -66,7 +66,8 @@
"Lingo\\Element": "/src/Element.php",
"Lingo\\Backend": "/src/Backend.php",
"Lingo\\BasicBackend": "/src/BasicBackend.php",
-   "Lingo\\MessageLog": "/src/MessageLog.php"
+   "Lingo\\MessageLog": "/src/MessageLog.php",
+   "Lingo\\Tests\\Util\\XmlFileProvider": 
"/tests/phpunit/Util/XmlFileProvider.php"
},
"Hooks": {
"ParserFirstCallInit": [
diff --git a/src/LingoParser.php b/src/LingoParser.php
index 684ed34..524e4e1 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -60,7 +60,7 @@
public function __construct( MessageLog &$messages = null ) {
global $wgexLingoBackend;
 
-   $this->mLingoBackend = new $wgexLingoBackend( $messages );
+   $this->setBackend( new $wgexLingoBackend( $messages ) );
}
 
/**
@@ -71,6 +71,16 @@
 */
public static function parse( Parser &$parser, &$text ) {
 
+   self::getInstance()->realParse( $parser, $text );
+
+   return true;
+   }
+
+   /**
+* @return LingoParser
+* @since 2.0.1
+*/
+   public static function getInstance() {
if ( !self::$parserSingleton ) {
self::$parserSingleton = new LingoParser();
 
@@ -79,9 +89,7 @@
self::$regex = '/' . preg_quote( Parser::MARKER_PREFIX, 
'/' ) . '.*?' . preg_quote( Parser::MARKER_SUFFIX, '/' ) . 
'|[\p{L}\p{N}]+|[^\p{L}\p{N}]/u';
}
 
-   self::$parserSingleton->realParse( $parser, $text );
-
-   return true;
+   return self::$parserSingleton;
}
 
/**
@@ -297,7 +305,7 @@
}
 
/**
-* @param $parser
+* @param Parser $parser
 */
protected function loadModules( &$parser ) {
global $wgOut, $wgScriptPath;
@@ -346,5 +354,13 @@
$cache->delete( wfMemcKey( 'ext', 'lingo', 'lingotree' ) );
 
}
+
+   /**
+* @since 2.0.1
+* @param Backend $backend
+*/
+   public function setBackend( $backend ) {
+   $this->mLingoBackend = $backend;
+   }
 }
 
diff --git a/tests/phpunit/Fixture/articleAnnotation/simple.xml 
b/tests/phpunit/Fixture/articleAnnotation/simple.xml
new file mode 100644
index 000..d66b9a0
--- /dev/null
+++ b/tests/phpunit/Fixture/articleAnnotation/simple.xml
@@ -0,0 +1,20 @@
+
+   
+
+   
+   
+
+   
+   
+   foo
+   bar
+   
+   
+   baz
+   quok
+   
+
diff --git a/tests/phpunit/Integration/ArticleAnnotationTest.php 
b/tests/phpunit/Integration/ArticleAnnotationTest.php
new file mode 100644
index 000..b600996
--- /dev/null
+++ b/tests/phpunit/Integration/ArticleAnnotationTest.php
@@ -0,0 +1,133 @@
+http://www.gnu.org/licenses/>.
+ *
+ * @since 2.0.1
+ * @file
+ * @ingroup Lingo
+ */
+
+namespace Lingo\Tests\Integration;
+
+use Lingo\LingoParser;
+use Lingo\Tests\Util\XmlFileProvider;
+
+use Parser;
+use ParserOptions;
+
+use PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls;
+use ReflectionClass;
+
+/**
+ * @group extensions-lingo
+ * @group extensions-lingo-integration
+ * @group mediawiki-databaseless
+ *
+ * @coversNothing
+ *
+ * @ingroup Lingo
+ * @ingroup 

[MediaWiki-commits] [Gerrit] Change the default value for $wgUseCombinedLoginLink to true - change (mediawiki/core)

2016-03-11 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Change the default value for $wgUseCombinedLoginLink to true
..

Change the default value for $wgUseCombinedLoginLink to true

Do not show the "Create account" link. It clutters the personal toolbar. The
functionality is available via the "Log in" link.

Bug: T121793
Change-Id: Iaea7ea071d4784814a6180a357f2628e517b6623
---
M RELEASE-NOTES-1.27
M includes/DefaultSettings.php
2 files changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/08/276908/1

diff --git a/RELEASE-NOTES-1.27 b/RELEASE-NOTES-1.27
index a1614d0..96be2fd 100644
--- a/RELEASE-NOTES-1.27
+++ b/RELEASE-NOTES-1.27
@@ -98,6 +98,7 @@
 * $wgEnotifUseJobQ was removed and the job queue is always used.
 * The functionality of the ApiSandbox extension has been merged into core. The
   extension should no longer be used.
+* Default value for $wgUseCombinedLoginLink changed to true
 
 === New features in 1.27 ===
 * $wgDataCenterUpdateStickTTL was also added. This decides how long a user
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index c04602c..0e0d5cc 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -3330,10 +3330,10 @@
 /**
  * Login / create account link behavior when it's possible for anonymous users
  * to create an account.
- *  - true = use a combined login / create account link
- *  - false = split login and create account into two separate links
+ *  - true = only show the login link
+ *  - false = have separate links for login and create account
  */
-$wgUseCombinedLoginLink = false;
+$wgUseCombinedLoginLink = true;
 
 /**
  * Display user edit counts in various prominent places.

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

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

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


[MediaWiki-commits] [Gerrit] Release Lingo 2.0 - change (mediawiki...Lingo)

2016-03-09 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Release Lingo 2.0
..


Release Lingo 2.0

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

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



diff --git a/extension.json b/extension.json
index 664c901..c54831a 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Lingo",
-   "version": "2.0-dev",
+   "version": "2.0.0",
"author": [
"Barry Coughlan",
"[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8a20c6cf1868e7485beced81d3295469b192b344
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Release Lingo 2.0 - change (mediawiki...Lingo)

2016-03-09 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Release Lingo 2.0
..

Release Lingo 2.0

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


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

diff --git a/extension.json b/extension.json
index 664c901..c54831a 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Lingo",
-   "version": "2.0-dev",
+   "version": "2.0.0",
"author": [
"Barry Coughlan",
"[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a20c6cf1868e7485beced81d3295469b192b344
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Add release notes - change (mediawiki...Lingo)

2016-03-09 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Add release notes
..


Add release notes

Change-Id: I6538dc33266e18185ef2ad33225adde34aff4e19
---
M README.md
A docs/release-notes.md
2 files changed, 186 insertions(+), 8 deletions(-)

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



diff --git a/README.md b/README.md
index 2c66a5d..cc3de9e 100644
--- a/README.md
+++ b/README.md
@@ -40,7 +40,8 @@
 
 ## Updating
 
-Run `php composer.phar update mediawiki/lingo` from the MediaWiki installation 
directory.
+Run `php composer.phar update mediawiki/lingo` from the MediaWiki installation
+directory.
 
 ## Customization
 
@@ -49,15 +50,15 @@
 * `$wgexLingoPage` to specify the name of the terminology page
   Example: `$wgexLingoPage = 'Glossary'`;
 
-* `$wgexLingoDisplayOnce` to specify that each term should be annotated only 
once
-  per page
+* `$wgexLingoDisplayOnce` to specify that each term should be annotated only
+  once per page
   Example: `$wgexLingoDisplayOnce = true`;
 
-* `$wgexLingoUseNamespaces` to specify what namespaces should or should not be 
used
+* `$wgexLingoUseNamespaces` to specify what namespaces should or should not be
+  used
   Example: `$wgexLingoUseNamespaces[NS_TALK] = false`;
 
-If you want to use these settings, just include them in LocalSettings.php AFTER
-the require_once("$IP/extensions/Lingo/Lingo.php");
+If you want to use these settings, just include them in LocalSettings.php.
 
 ## Usage
 
@@ -82,8 +83,8 @@
 ## Reporting bugs
 
 Comments, questions and suggestions should be sent or posted to:
-* the Lingo discussion page: http://www.mediawiki.org/wiki/Extension_talk:Lingo
-* the maintainer: http://www.mediawiki.org/wiki/Special:EmailUser/F.trott
+* the Lingo discussion page: 
https://www.mediawiki.org/wiki/Extension_talk:Lingo
+* the maintainer: https://www.mediawiki.org/wiki/Special:EmailUser/F.trott
 
 ## Credits
 
diff --git a/docs/release-notes.md b/docs/release-notes.md
new file mode 100644
index 000..1fe7436
--- /dev/null
+++ b/docs/release-notes.md
@@ -0,0 +1,177 @@
+## Release Notes
+
+### Lingo 2.0.0
+
+Released on 09-Mar-2016
+
+Minimum MediaWiki version is now 1.26
+
+Changes:
+* Usage of new extension registration mechanism
+* Removed usage of deprecated MediaWiki features
+* Reworked file structure
+* Introduced unit testing (incl. automatic regression testing)
+
+Fixes:
+* Fix "Balloc() allocation exceeds list boundary"
+  ([Bug:T70710](https://phabricator.wikimedia.org/T70710))
+* Explicitly require Lingo styles to be loaded at the page top
+
+### Lingo 1.2.0
+
+Released on 02-Aug-2014
+
+Minimum MediaWiki version is now 1.20
+
+Changes:
+* Migrate to JSON i18n
+* Remove wfMsg / wfMsgForContent usage
+* Unstrip strip items of 'general' category
+* Swap SpecialVersionExtensionTypes for ExtensionTypes
+
+### Lingo 1.1.0
+
+Released on 09-Mar-2014
+
+Changes:
+* new CSS class mw-lingo-tooltip-definition for definitions
+
+Fixes:
+* multiple definitions appear on the same line - 2nd attempt
+
+### Lingo 1.0.1
+
+Released on 03-Mar-2014
+
+Fixes:
+* multiple definitions appeared on the same line
+
+### Lingo 1.0.0
+
+Released on 02-Mar-2014
+
+From here on this extension will use [Semantic Versioning](http://semver.org).
+
+Changes:
+* features introduced during the [Google Summer of Code 2013]
+  (https://www.mediawiki.org/wiki/Google_Summer_of_Code_2013) by Yevheniy
+  Vlasenko:
+** ability to turn off the recognition of glossary terms by using
+   `` tags
+** ability to use multiple definitions per term
+** support the [ApprovedRevs]
+   (https://www.mediawiki.org/wiki/Extension:ApprovedRevs) extension for the
+   Terminology page
+* introduce the [qTip2 library](http://qtip2.com) for the tooltips (and abandon
+  the home-grown tooltips)
+* enable transclusion of other pages on the Terminology page
+* support setting per-term CSS styles (only in combination with [Semantic
+  Glossary](https://www.mediawiki.org/wiki/Extension:SemanticGlossary)) (patch
+  by Nathan Douglas)
+* support the [Composer](https://getcomposer.org) dependency manager for PHP
+* change the CSS class of elements from *tooltip* to *mw-lingo-tooltip* to 
avoid
+  collisions, e.g. with the [Bootstrap](http://getbootstrap.com) framework
+
+Fixes:
+* Mark-up on the Terminology page is now immediately updated when new terms are
+  saved
+
+### Lingo 0.4.2
+
+Released on 07-Apr-2013
+
+Fixes:
+* bugfix (links with terms broken for MW pre1.20). This re-introduces bug
+  "annotation of text between nowiki tags" for MW pre1.20.
+
+### Lingo 0.4.1
+
+Released on 24-Feb-2013
+
+Fixes:
+* bugfix (Compatibility with MW pre1.20 broken, hook ParserAfterParse is not
+  available)
+
+### Lingo 0.4
+
+Released on 21-Nov-2012
+
+Changes:
+* caching of the glossary
+* special handling for IE6/IE7 (it's still ugly, but not as ugly as before)
+* if for a term only a link and no definition is specified, 

[MediaWiki-commits] [Gerrit] Add release notes - change (mediawiki...Lingo)

2016-03-09 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Add release notes
..

Add release notes

Change-Id: I6538dc33266e18185ef2ad33225adde34aff4e19
---
M README.md
A docs/release-notes.md
2 files changed, 187 insertions(+), 8 deletions(-)


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

diff --git a/README.md b/README.md
index 2c66a5d..cc3de9e 100644
--- a/README.md
+++ b/README.md
@@ -40,7 +40,8 @@
 
 ## Updating
 
-Run `php composer.phar update mediawiki/lingo` from the MediaWiki installation 
directory.
+Run `php composer.phar update mediawiki/lingo` from the MediaWiki installation
+directory.
 
 ## Customization
 
@@ -49,15 +50,15 @@
 * `$wgexLingoPage` to specify the name of the terminology page
   Example: `$wgexLingoPage = 'Glossary'`;
 
-* `$wgexLingoDisplayOnce` to specify that each term should be annotated only 
once
-  per page
+* `$wgexLingoDisplayOnce` to specify that each term should be annotated only
+  once per page
   Example: `$wgexLingoDisplayOnce = true`;
 
-* `$wgexLingoUseNamespaces` to specify what namespaces should or should not be 
used
+* `$wgexLingoUseNamespaces` to specify what namespaces should or should not be
+  used
   Example: `$wgexLingoUseNamespaces[NS_TALK] = false`;
 
-If you want to use these settings, just include them in LocalSettings.php AFTER
-the require_once("$IP/extensions/Lingo/Lingo.php");
+If you want to use these settings, just include them in LocalSettings.php.
 
 ## Usage
 
@@ -82,8 +83,8 @@
 ## Reporting bugs
 
 Comments, questions and suggestions should be sent or posted to:
-* the Lingo discussion page: http://www.mediawiki.org/wiki/Extension_talk:Lingo
-* the maintainer: http://www.mediawiki.org/wiki/Special:EmailUser/F.trott
+* the Lingo discussion page: 
https://www.mediawiki.org/wiki/Extension_talk:Lingo
+* the maintainer: https://www.mediawiki.org/wiki/Special:EmailUser/F.trott
 
 ## Credits
 
diff --git a/docs/release-notes.md b/docs/release-notes.md
new file mode 100644
index 000..72b2537
--- /dev/null
+++ b/docs/release-notes.md
@@ -0,0 +1,178 @@
+## Release Notes
+
+### Lingo 2.0.0
+
+Released on 09-Mar-2016
+
+Minimum MediaWiki version is now 1.26
+
+Changes:
+* Usage of new extension registration mechanism
+* Removed usage of deprecated MediaWiki features  
+* Reworked file structure
+* Introduced unit testing (incl. automatic regression testing) 
+
+Fixes:
+* Fix "Balloc() allocation exceeds list boundary"
+  ([Bug:T70710](https://phabricator.wikimedia.org/T70710))
+* Explicitly require Lingo styles to be loaded at the page top
+
+### Lingo 1.2.0
+
+Released on 02-Aug-2014
+
+Minimum MediaWiki version is now 1.20
+
+Changes:
+* Migrate to JSON i18n
+* Remove wfMsg / wfMsgForContent usage
+* Unstrip strip items of 'general' category
+* Swap SpecialVersionExtensionTypes for ExtensionTypes
+
+### Lingo 1.1.0
+ 
+Released on 09-Mar-2014
+
+Changes:
+* new CSS class mw-lingo-tooltip-definition for definitions
+
+Fixes:
+* multiple definitions appear on the same line - 2nd attempt
+
+### Lingo 1.0.1
+
+Released on 03-Mar-2014
+
+Fixes:
+* multiple definitions appeared on the same line 
+
+### Lingo 1.0.0
+ 
+Released on 02-Mar-2014
+
+From here on this extension will use [Semantic Versioning](http://semver.org).
+
+Changes:
+* features introduced during the [Google Summer of Code 2013]
+  (https://www.mediawiki.org/wiki/Google_Summer_of_Code_2013) by Yevheniy
+  Vlasenko:
+** ability to turn off the recognition of glossary terms by using
+   `` tags
+** ability to use multiple definitions per term
+** support the [ApprovedRevs]
+   (https://www.mediawiki.org/wiki/Extension:ApprovedRevs) extension for the
+   Terminology page
+* introduce the [qTip2 library](http://qtip2.com) for the tooltips (and abandon
+  the home-grown tooltips)
+* enable transclusion of other pages on the Terminology page
+* support setting per-term CSS styles (only in combination with [Semantic
+  Glossary](https://www.mediawiki.org/wiki/Extension:SemanticGlossary)) (patch
+  by Nathan Douglas)
+* support the [Composer](https://getcomposer.org) dependency manager for PHP
+* change the CSS class of elements from *tooltip* to *mw-lingo-tooltip* to 
avoid
+  collisions, e.g. with the [Bootstrap](http://getbootstrap.com) framework
+
+Fixes:
+* Mark-up on the Terminology page is now immediately updated when new terms are
+  saved 
+
+### Lingo 0.4.2
+ 
+Released on 07-Apr-2013
+
+Fixes:
+* bugfix (links with terms broken for MW pre1.20). This re-introduces bug
+  "annotation of text between nowiki tags" for MW pre1.20.
+
+
+### Lingo 0.4.1
+ 
+Released on 24-Feb-2013
+
+Fixes:
+* bugfix (Compatibility with MW pre1.20 broken, hook ParserAfterParse is not
+  available)
+
+### Lingo 0.4
+
+Released on 21-Nov-2012
+
+Changes:
+* caching of the glossary
+* special handling for IE6/IE7 (it's still ugly, but not as 

[MediaWiki-commits] [Gerrit] Release Chameleon 1.3 - change (mediawiki...chameleon)

2016-03-08 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Release Chameleon 1.3
..

Release Chameleon 1.3

Change-Id: I9d7e423e1786251bbb3a0c98c05cac5b3f463547
---
M Chameleon.php
M docs/release-notes.md
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/chameleon 
refs/changes/44/275944/1

diff --git a/Chameleon.php b/Chameleon.php
index c1a1573..3e62a40 100644
--- a/Chameleon.php
+++ b/Chameleon.php
@@ -47,7 +47,7 @@
}
 
// define the skin's version
-   define( 'CHAMELEON_VERSION', '1.3-alpha' );
+   define( 'CHAMELEON_VERSION', '1.3' );
 
// set credits
$GLOBALS[ 'wgExtensionCredits' ][ 'skin' ][ ] = array(
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 9d646f1..a2d1015 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -2,7 +2,7 @@
 
 ### Chameleon 1.3
 
-Released on (tbd)
+Released on 08-Mar-2016
 
 Changes:
 * Add URL parameter 'uselayout'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d7e423e1786251bbb3a0c98c05cac5b3f463547
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/chameleon
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Replace deprecated functions - change (mediawiki...Lingo)

2016-03-06 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Replace deprecated functions
..


Replace deprecated functions

Change-Id: I0388ad67b34a38525247944db7eb6d943f1887f4
---
M src/BasicBackend.php
M src/Element.php
M src/LingoParser.php
3 files changed, 29 insertions(+), 20 deletions(-)

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



diff --git a/src/BasicBackend.php b/src/BasicBackend.php
index 87c2589..d7fa827 100644
--- a/src/BasicBackend.php
+++ b/src/BasicBackend.php
@@ -28,6 +28,7 @@
 namespace Lingo;
 
 use ApprovedRevs;
+use ContentHandler;
 use Page;
 use Parser;
 use ParserOptions;
@@ -50,9 +51,9 @@
 */
public function __construct( MessageLog &$messages = null ) {
 
-   global $wgexLingoPage, $wgRequest;
+   global $wgRequest;
 
-   $page = $wgexLingoPage ? $wgexLingoPage : wfMessage( 
'lingo-terminologypagename' )->inContentLanguage()->text();
+   $page = self::getLingoPage();
 
parent::__construct( $messages );
 
@@ -63,9 +64,9 @@
return;
}
 
-   // FIXME: This is a hack special-casing the submitting of the 
terminology
+   // This is a hack special-casing the submitting of the 
terminology
// page itself. In this case the Revision is not up to date 
when we get
-   // here, i.e. $rev->getText() would return outdated Test.
+   // here, i.e. $rev->getText() would return outdated Text.
// This hack takes the text directly out of the data from the 
web request.
if ( $wgRequest->getVal( 'action', 'view' ) === 'submit'
&& Title::newFromText( $wgRequest->getVal( 'title' ) 
)->getArticleID() === $title->getArticleID()
@@ -77,19 +78,30 @@
$rev = $this->getRevision( $title );
if ( !$rev ) {
$this->getMessageLog()->addWarning( wfMessage( 
'lingo-noterminologypage', $page )->inContentLanguage()->text() );
-   return false;
+   return;
}
 
-   $content = $rev->getText();
+   $content = ContentHandler::getContentText( 
$rev->getContent() );
 
}
 
$parser = new Parser;
-   // expand templates and variables in the text, producing valid, 
static wikitext
-   // have to use a new anonymous user to avoid any leakage as 
Lingo is caching only one user-independant glossary
+   // expand templates and variables in the text, producing valid, 
static
+   // wikitext have to use a new anonymous user to avoid any 
leakage as
+   // Lingo is caching only one user-independent glossary
$content = $parser->preprocess( $content, $title, new 
ParserOptions( new User() ) );
 
$this->mArticleLines = array_reverse( explode( "\n", $content ) 
);
+   }
+
+   /**
+* @param $wgexLingoPage
+* @return string
+*/
+   private static function getLingoPage() {
+   global $wgexLingoPage;
+
+   return $wgexLingoPage ? $wgexLingoPage : wfMessage( 
'lingo-terminologypagename' )->inContentLanguage()->text();
}
 
/**
@@ -101,8 +113,6 @@
 * @return Array | null
 */
public function next() {
-
-   wfProfileIn( __METHOD__ );
 
static $term = null;
static $definitions = array();
@@ -146,8 +156,6 @@
}
}
 
-   wfProfileOut( __METHOD__ );
-
return array_pop( $ret );
}
 
@@ -181,8 +189,7 @@
 */
public static function purgeCache( &$wikipage ) {
 
-   global $wgexLingoPage;
-   $page = $wgexLingoPage ? $wgexLingoPage : wfMessage( 
'lingo-terminologypagename' )->inContentLanguage()->text();
+   $page = self::getLingoPage();
 
if ( !is_null( $wikipage ) && ( 
$wikipage->getTitle()->getText() === $page ) ) {
 
diff --git a/src/Element.php b/src/Element.php
index 397d1ca..ba22f5a 100644
--- a/src/Element.php
+++ b/src/Element.php
@@ -203,10 +203,10 @@
$span->setAttribute( 'class', 'mw-lingo-tooltip ' . 
$this->mDefinitions[ 0 ][ self::ELEMENT_STYLE ] );
 
// Wrap term in  tag, hidden
-   wfSuppressWarnings();
+   \MediaWiki\suppressWarnings();
$spanTerm = $doc->createElement( 'span', htmlentities( 
$this->mTerm, ENT_COMPAT, 'UTF-8' ) );
+   \MediaWiki\restoreWarnings();
 
-   wfRestoreWarnings();
$spanTerm->setAttribute( 'class', 'mw-lingo-tooltip-abbr' );
 
// Wrap 

[MediaWiki-commits] [Gerrit] Replace deprecated functions - change (mediawiki...Lingo)

2016-03-06 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Replace deprecated functions
..

Replace deprecated functions

Change-Id: I0388ad67b34a38525247944db7eb6d943f1887f4
---
M src/BasicBackend.php
M src/Element.php
M src/LingoParser.php
3 files changed, 29 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/57/275357/1

diff --git a/src/BasicBackend.php b/src/BasicBackend.php
index 87c2589..d7fa827 100644
--- a/src/BasicBackend.php
+++ b/src/BasicBackend.php
@@ -28,6 +28,7 @@
 namespace Lingo;
 
 use ApprovedRevs;
+use ContentHandler;
 use Page;
 use Parser;
 use ParserOptions;
@@ -50,9 +51,9 @@
 */
public function __construct( MessageLog &$messages = null ) {
 
-   global $wgexLingoPage, $wgRequest;
+   global $wgRequest;
 
-   $page = $wgexLingoPage ? $wgexLingoPage : wfMessage( 
'lingo-terminologypagename' )->inContentLanguage()->text();
+   $page = self::getLingoPage();
 
parent::__construct( $messages );
 
@@ -63,9 +64,9 @@
return;
}
 
-   // FIXME: This is a hack special-casing the submitting of the 
terminology
+   // This is a hack special-casing the submitting of the 
terminology
// page itself. In this case the Revision is not up to date 
when we get
-   // here, i.e. $rev->getText() would return outdated Test.
+   // here, i.e. $rev->getText() would return outdated Text.
// This hack takes the text directly out of the data from the 
web request.
if ( $wgRequest->getVal( 'action', 'view' ) === 'submit'
&& Title::newFromText( $wgRequest->getVal( 'title' ) 
)->getArticleID() === $title->getArticleID()
@@ -77,19 +78,30 @@
$rev = $this->getRevision( $title );
if ( !$rev ) {
$this->getMessageLog()->addWarning( wfMessage( 
'lingo-noterminologypage', $page )->inContentLanguage()->text() );
-   return false;
+   return;
}
 
-   $content = $rev->getText();
+   $content = ContentHandler::getContentText( 
$rev->getContent() );
 
}
 
$parser = new Parser;
-   // expand templates and variables in the text, producing valid, 
static wikitext
-   // have to use a new anonymous user to avoid any leakage as 
Lingo is caching only one user-independant glossary
+   // expand templates and variables in the text, producing valid, 
static
+   // wikitext have to use a new anonymous user to avoid any 
leakage as
+   // Lingo is caching only one user-independent glossary
$content = $parser->preprocess( $content, $title, new 
ParserOptions( new User() ) );
 
$this->mArticleLines = array_reverse( explode( "\n", $content ) 
);
+   }
+
+   /**
+* @param $wgexLingoPage
+* @return string
+*/
+   private static function getLingoPage() {
+   global $wgexLingoPage;
+
+   return $wgexLingoPage ? $wgexLingoPage : wfMessage( 
'lingo-terminologypagename' )->inContentLanguage()->text();
}
 
/**
@@ -101,8 +113,6 @@
 * @return Array | null
 */
public function next() {
-
-   wfProfileIn( __METHOD__ );
 
static $term = null;
static $definitions = array();
@@ -146,8 +156,6 @@
}
}
 
-   wfProfileOut( __METHOD__ );
-
return array_pop( $ret );
}
 
@@ -181,8 +189,7 @@
 */
public static function purgeCache( &$wikipage ) {
 
-   global $wgexLingoPage;
-   $page = $wgexLingoPage ? $wgexLingoPage : wfMessage( 
'lingo-terminologypagename' )->inContentLanguage()->text();
+   $page = self::getLingoPage();
 
if ( !is_null( $wikipage ) && ( 
$wikipage->getTitle()->getText() === $page ) ) {
 
diff --git a/src/Element.php b/src/Element.php
index 397d1ca..ba22f5a 100644
--- a/src/Element.php
+++ b/src/Element.php
@@ -203,10 +203,10 @@
$span->setAttribute( 'class', 'mw-lingo-tooltip ' . 
$this->mDefinitions[ 0 ][ self::ELEMENT_STYLE ] );
 
// Wrap term in  tag, hidden
-   wfSuppressWarnings();
+   \MediaWiki\suppressWarnings();
$spanTerm = $doc->createElement( 'span', htmlentities( 
$this->mTerm, ENT_COMPAT, 'UTF-8' ) );
+   \MediaWiki\restoreWarnings();
 
-   wfRestoreWarnings();
$spanTerm->setAttribute( 'class', 

[MediaWiki-commits] [Gerrit] Simplify names of classes and namespaces - change (mediawiki...Lingo)

2016-03-06 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Simplify names of classes and namespaces
..


Simplify names of classes and namespaces

Change-Id: I52497bf5a22857f59ede574e14be2a3e72663859
---
M extension.json
R src/Backend.php
R src/BasicBackend.php
R src/Element.php
R src/Hooks.php
M src/LingoParser.php
R src/MessageLog.php
R src/Tree.php
R tests/phpunit/Unit/BackendTest.php
C tests/phpunit/Unit/BasicBackendTest.php
R tests/phpunit/Unit/ElementTest.php
D tests/phpunit/Unit/LingoBasicBackendTest.php
M tests/phpunit/Unit/LingoI18NTest.php
D tests/phpunit/Unit/LingoMessageLogTest.php
M tests/phpunit/Unit/LingoParserTest.php
C tests/phpunit/Unit/MessageLogTest.php
R tests/phpunit/Unit/TreeTest.php
17 files changed, 97 insertions(+), 203 deletions(-)

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



diff --git a/extension.json b/extension.json
index 3c399ad..664c901 100644
--- a/extension.json
+++ b/extension.json
@@ -7,7 +7,7 @@
"..."
],
"url": "https://www.mediawiki.org/wiki/Extension:Lingo;,
-   "@descriptionmsg": "The description message is set by 
LingoHooks::setCredits().",
+   "@descriptionmsg": "The description message is set by 
Lingo\\Hooks::setCredits().",
"license-name": "GPL-2.0+",
"type": "parserhook",
"requires": {
@@ -44,7 +44,7 @@
},
"config": {
"_prefix": "wgex",
-   "LingoBackend": "Extensions\\Lingo\\LingoBasicBackend",
+   "LingoBackend": "Lingo\\BasicBackend",
"LingoPage": null,
"LingoDisplayOnce": false,
"LingoCacheType": null,
@@ -60,30 +60,30 @@
"LingoMagic": "src/Lingo.i18n.magic.php"
},
"AutoloadClasses": {
-   "Extensions\\Lingo\\LingoHooks": "/src/LingoHooks.php",
-   "Extensions\\Lingo\\LingoParser": "/src/LingoParser.php",
-   "Extensions\\Lingo\\LingoTree": "/src/LingoTree.php",
-   "Extensions\\Lingo\\LingoElement": "/src/LingoElement.php",
-   "Extensions\\Lingo\\LingoBackend": "/src/LingoBackend.php",
-   "Extensions\\Lingo\\LingoBasicBackend": 
"/src/LingoBasicBackend.php",
-   "Extensions\\Lingo\\LingoMessageLog": "/src/LingoMessageLog.php"
+   "Lingo\\Hooks": "/src/Hooks.php",
+   "Lingo\\LingoParser": "/src/LingoParser.php",
+   "Lingo\\Tree": "/src/Tree.php",
+   "Lingo\\Element": "/src/Element.php",
+   "Lingo\\Backend": "/src/Backend.php",
+   "Lingo\\BasicBackend": "/src/BasicBackend.php",
+   "Lingo\\MessageLog": "/src/MessageLog.php"
},
"Hooks": {
"ParserFirstCallInit": [
-   "Extensions\\Lingo\\LingoHooks::registerTags"
+   "Lingo\\Hooks::registerTags"
],
"ArticlePurge": [
-   "Extensions\\Lingo\\LingoBasicBackend::purgeCache"
+   "Lingo\\BasicBackend::purgeCache"
],
"ArticleSave": [
-   "Extensions\\Lingo\\LingoBasicBackend::purgeCache"
+   "Lingo\\BasicBackend::purgeCache"
],
"ParserAfterParse": [
-   "Extensions\\Lingo\\LingoHooks::parse"
+   "Lingo\\Hooks::parse"
]
},
"ExtensionFunctions": [
-   "Extensions\\Lingo\\LingoHooks::initExtension"
+   "Lingo\\Hooks::initExtension"
],
"manifest_version": 1
 }
diff --git a/src/LingoBackend.php b/src/Backend.php
similarity index 76%
rename from src/LingoBackend.php
rename to src/Backend.php
index 1463f85..e2ece01 100644
--- a/src/LingoBackend.php
+++ b/src/Backend.php
@@ -1,7 +1,7 @@
 mMessageLog = new LingoMessageLog();
+   $this->mMessageLog = new MessageLog();
} else {
$this->mMessageLog = $messages;
}
}
 
/**
-* @return LingoMessageLog
+* @return MessageLog
 */
public function getMessageLog() {
return $this->mMessageLog;
@@ -61,7 +61,7 @@
 * This function returns true if the backend is cache-enabled.
 *
 * Actual caching is done by the parser, but to be cache-enabled the 
backend
-* has to call Extensions\Lingo\LingoParser::purgeCache when necessary.
+* has to call Lingo\LingoParser::purgeCache when necessary.
 *
 * @return boolean
 */
@@ -74,7 +74,7 @@
 * strings: Term, Definition, Link, Source. If there is no next element 
the
 * function returns null.
 *
-* @return LingoElement | null
+* @return Element | null
 */

[MediaWiki-commits] [Gerrit] Simplify names of classes and namespaces - change (mediawiki...Lingo)

2016-03-06 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Simplify names of classes and namespaces
..

Simplify names of classes and namespaces

Change-Id: I52497bf5a22857f59ede574e14be2a3e72663859
---
M extension.json
R src/Backend.php
R src/BasicBackend.php
R src/Element.php
R src/Hooks.php
M src/LingoParser.php
R src/MessageLog.php
R src/Tree.php
R tests/phpunit/Unit/BackendTest.php
C tests/phpunit/Unit/BasicBackendTest.php
R tests/phpunit/Unit/ElementTest.php
D tests/phpunit/Unit/LingoBasicBackendTest.php
M tests/phpunit/Unit/LingoI18NTest.php
D tests/phpunit/Unit/LingoMessageLogTest.php
M tests/phpunit/Unit/LingoParserTest.php
C tests/phpunit/Unit/MessageLogTest.php
R tests/phpunit/Unit/TreeTest.php
17 files changed, 102 insertions(+), 211 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/06/275306/1

diff --git a/extension.json b/extension.json
index 3c399ad..8498f56 100644
--- a/extension.json
+++ b/extension.json
@@ -7,7 +7,7 @@
"..."
],
"url": "https://www.mediawiki.org/wiki/Extension:Lingo;,
-   "@descriptionmsg": "The description message is set by 
LingoHooks::setCredits().",
+   "@descriptionmsg": "The description message is set by 
Hooks::setCredits().",
"license-name": "GPL-2.0+",
"type": "parserhook",
"requires": {
@@ -44,7 +44,7 @@
},
"config": {
"_prefix": "wgex",
-   "LingoBackend": "Extensions\\Lingo\\LingoBasicBackend",
+   "Backend": "Lingo\\BasicBackend",
"LingoPage": null,
"LingoDisplayOnce": false,
"LingoCacheType": null,
@@ -60,30 +60,30 @@
"LingoMagic": "src/Lingo.i18n.magic.php"
},
"AutoloadClasses": {
-   "Extensions\\Lingo\\LingoHooks": "/src/LingoHooks.php",
-   "Extensions\\Lingo\\LingoParser": "/src/LingoParser.php",
-   "Extensions\\Lingo\\LingoTree": "/src/LingoTree.php",
-   "Extensions\\Lingo\\LingoElement": "/src/LingoElement.php",
-   "Extensions\\Lingo\\LingoBackend": "/src/LingoBackend.php",
-   "Extensions\\Lingo\\LingoBasicBackend": 
"/src/LingoBasicBackend.php",
-   "Extensions\\Lingo\\LingoMessageLog": "/src/LingoMessageLog.php"
+   "Lingo\\Hooks": "/src/Hooks.php",
+   "Lingo\\LingoParser": "/src/LingoParser.php",
+   "Lingo\\Tree": "/src/Tree.php",
+   "Lingo\\Element": "/src/Element.php",
+   "Lingo\\Backend": "/src/Backend.php",
+   "Lingo\\BasicBackend": "/src/BasicBackend.php",
+   "Lingo\\MessageLog": "/src/MessageLog.php"
},
"Hooks": {
"ParserFirstCallInit": [
-   "Extensions\\Lingo\\LingoHooks::registerTags"
+   "Lingo\\Hooks::registerTags"
],
"ArticlePurge": [
-   "Extensions\\Lingo\\LingoBasicBackend::purgeCache"
+   "Lingo\\BasicBackend::purgeCache"
],
"ArticleSave": [
-   "Extensions\\Lingo\\LingoBasicBackend::purgeCache"
+   "Lingo\\BasicBackend::purgeCache"
],
"ParserAfterParse": [
-   "Extensions\\Lingo\\LingoHooks::parse"
+   "Lingo\\Hooks::parse"
]
},
"ExtensionFunctions": [
-   "Extensions\\Lingo\\LingoHooks::initExtension"
+   "Lingo\\Hooks::initExtension"
],
"manifest_version": 1
 }
diff --git a/src/LingoBackend.php b/src/Backend.php
similarity index 76%
rename from src/LingoBackend.php
rename to src/Backend.php
index 1463f85..e2ece01 100644
--- a/src/LingoBackend.php
+++ b/src/Backend.php
@@ -1,7 +1,7 @@
 mMessageLog = new LingoMessageLog();
+   $this->mMessageLog = new MessageLog();
} else {
$this->mMessageLog = $messages;
}
}
 
/**
-* @return LingoMessageLog
+* @return MessageLog
 */
public function getMessageLog() {
return $this->mMessageLog;
@@ -61,7 +61,7 @@
 * This function returns true if the backend is cache-enabled.
 *
 * Actual caching is done by the parser, but to be cache-enabled the 
backend
-* has to call Extensions\Lingo\LingoParser::purgeCache when necessary.
+* has to call Lingo\LingoParser::purgeCache when necessary.
 *
 * @return boolean
 */
@@ -74,7 +74,7 @@
 * strings: Term, Definition, Link, Source. If there is no next element 
the
 * function returns null.
 *
-* @return LingoElement | null
+* @return 

[MediaWiki-commits] [Gerrit] Update installation instructions - change (mediawiki...Lingo)

2016-03-06 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Update installation instructions
..


Update installation instructions

Change-Id: I849d9a676a8ed77dce93b6c19816c46fcc1c413e
---
M README.md
1 file changed, 23 insertions(+), 11 deletions(-)

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



diff --git a/README.md b/README.md
index 2a6f52d..2c66a5d 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
 # Lingo
-[![Build 
Status](https://travis-ci.org/wikimedia/mediawiki-extensions-Lingo.svg?branch=master)](https://travis-ci.org/wikimedia/mediawiki-extensions-Lingo)
+[![Build 
Status](https://travis-ci.org/wikimedia/mediawiki-extensions-Lingo.svg?branch=master)](https://travis-ci.org/wikimedia/mediawiki-extensions-Lingo/builds)
 [![Code 
Coverage](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
 [![Code 
Quality](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
 [![Dependency 
Status](https://www.versioneye.com/php/mediawiki:lingo/badge.png)](https://www.versioneye.com/php/mediawiki:lingo)
@@ -17,17 +17,30 @@
 - PHP 5.3.3 or later
 - MediaWiki 1.26 or later
 
-## Installation
+## Installation & Activation
 
-The recommended way to install this extension is by using 
[Composer][composer]. Just add the following to the MediaWiki `composer.json` 
file and run the `php composer.phar install/update` command.
+The recommended way to install this extension is by using [Composer][composer].
 
-```json
-{
-   "require": {
-   "mediawiki/lingo": "~2.0"
-   }
-}
-```
+1. Add the following to the MediaWiki `composer.local.json` file
+ ```json
+ {
+   "require": {
+   "mediawiki/lingo": "~2.0"
+   }
+ }
+ ```
+
+2.  Run `php composer.phar update mediawiki/lingo` from the MediaWiki
+installation directory.
+
+3. Add the following code to your LocalSettings.php:
+ ```php
+ wfLoadExtension('Lingo');
+ ```
+
+## Updating
+
+Run `php composer.phar update mediawiki/lingo` from the MediaWiki installation 
directory.
 
 ## Customization
 
@@ -45,7 +58,6 @@
 
 If you want to use these settings, just include them in LocalSettings.php AFTER
 the require_once("$IP/extensions/Lingo/Lingo.php");
-
 
 ## Usage
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I849d9a676a8ed77dce93b6c19816c46fcc1c413e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Update installation instructions - change (mediawiki...Lingo)

2016-03-06 Thread Foxtrott (Code Review)
Foxtrott has uploaded a new change for review.

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

Change subject: Update installation instructions
..

Update installation instructions

Change-Id: I849d9a676a8ed77dce93b6c19816c46fcc1c413e
---
M README.md
1 file changed, 23 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/84/275284/1

diff --git a/README.md b/README.md
index 2a6f52d..2c66a5d 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
 # Lingo
-[![Build 
Status](https://travis-ci.org/wikimedia/mediawiki-extensions-Lingo.svg?branch=master)](https://travis-ci.org/wikimedia/mediawiki-extensions-Lingo)
+[![Build 
Status](https://travis-ci.org/wikimedia/mediawiki-extensions-Lingo.svg?branch=master)](https://travis-ci.org/wikimedia/mediawiki-extensions-Lingo/builds)
 [![Code 
Coverage](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
 [![Code 
Quality](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
 [![Dependency 
Status](https://www.versioneye.com/php/mediawiki:lingo/badge.png)](https://www.versioneye.com/php/mediawiki:lingo)
@@ -17,17 +17,30 @@
 - PHP 5.3.3 or later
 - MediaWiki 1.26 or later
 
-## Installation
+## Installation & Activation
 
-The recommended way to install this extension is by using 
[Composer][composer]. Just add the following to the MediaWiki `composer.json` 
file and run the `php composer.phar install/update` command.
+The recommended way to install this extension is by using [Composer][composer].
 
-```json
-{
-   "require": {
-   "mediawiki/lingo": "~2.0"
-   }
-}
-```
+1. Add the following to the MediaWiki `composer.local.json` file
+ ```json
+ {
+   "require": {
+   "mediawiki/lingo": "~2.0"
+   }
+ }
+ ```
+
+2.  Run `php composer.phar update mediawiki/lingo` from the MediaWiki
+installation directory.
+
+3. Add the following code to your LocalSettings.php:
+ ```php
+ wfLoadExtension('Lingo');
+ ```
+
+## Updating
+
+Run `php composer.phar update mediawiki/lingo` from the MediaWiki installation 
directory.
 
 ## Customization
 
@@ -45,7 +58,6 @@
 
 If you want to use these settings, just include them in LocalSettings.php AFTER
 the require_once("$IP/extensions/Lingo/Lingo.php");
-
 
 ## Usage
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I849d9a676a8ed77dce93b6c19816c46fcc1c413e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Refactor LingoElement - change (mediawiki...Lingo)

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

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

Change subject: Refactor LingoElement
..

Refactor LingoElement

Change-Id: I5679311e9ef0e0cc813d2aa6177cab08d1cbc46d
---
M src/LingoElement.php
1 file changed, 156 insertions(+), 149 deletions(-)


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

diff --git a/src/LingoElement.php b/src/LingoElement.php
index a5bf9c6..97aa9e6 100644
--- a/src/LingoElement.php
+++ b/src/LingoElement.php
@@ -49,13 +49,11 @@
const ELEMENT_STYLE = 4;
 
const ELEMENT_FIELDCOUNT = 5;  // number of fields stored for each 
element; (last field's index) + 1
-
+   static private $mLinkTemplate = null;
private $mFullDefinition = null;
private $mDefinitions = array();
private $mTerm = null;
private $mHasBeenDisplayed = false;
-
-   static private $mLinkTemplate = null;
 
/**
 * Extensions\Lingo\LingoElement constructor.
@@ -86,31 +84,174 @@
 
global $wgexLingoDisplayOnce;
 
-   // return textnode if
if ( $wgexLingoDisplayOnce && $this->mHasBeenDisplayed ) {
return $doc->createTextNode( $this->mTerm );
}
 
+   $this->buildFullDefinition( $doc );
+   $this->mHasBeenDisplayed = true;
+
+   return $this->mFullDefinition->cloneNode( true );
+   }
+
+   /**
+* @param DOMDocument $doc
+* @return DOMDocument
+*/
+   private function buildFullDefinition( DOMDocument &$doc ) {
+
// only create if not yet created
if ( $this->mFullDefinition === null || 
$this->mFullDefinition->ownerDocument !== $doc ) {
 
-   // if there is only one link available, just insert the 
link
-   if ( count( $this->mDefinitions ) === 1
-   && !is_string( $this->mDefinitions[ 0 ][ 
self::ELEMENT_DEFINITION ] )
-   && is_string( $this->mDefinitions[ 0 ][ 
self::ELEMENT_LINK ] )
-   ) {
-
+   if ( $this->isSimpleLink() ) {
$this->mFullDefinition = 
$this->getFullDefinitionAsLink( $doc );
-
-   } else { // else insert the complete tooltip
-
+   } else {
$this->mFullDefinition = 
$this->getFullDefinitionAsTooltip( $doc );
}
+   }
+   }
 
-   $this->mHasBeenDisplayed = true;
+   /**
+* @return bool
+*/
+   private function isSimpleLink() {
+   return count( $this->mDefinitions ) === 1 &&
+   !is_string( $this->mDefinitions[ 0 ][ 
self::ELEMENT_DEFINITION ] ) &&
+   is_string( $this->mDefinitions[ 0 ][ self::ELEMENT_LINK 
] );
+   }
+
+   /**
+* @param DOMDocument $doc
+*
+* @return DOMElement
+* @throws MWException
+*/
+   protected function getFullDefinitionAsLink( DOMDocument &$doc ) {
+
+   // create Title object for target page
+   $target = Title::newFromText( $this->mDefinitions[ 0 ][ 
self::ELEMENT_LINK ] );
+
+   // create link element
+   $link = $doc->createElement( 'a', $this->mDefinitions[ 0 ][ 
self::ELEMENT_TERM ] );
+
+   // set the link target
+   $link->setAttribute( 'href', $target->getLinkUrl() );
+   $link = $this->addClassAttributeToLink( $target, $link );
+   $link = $this->addTitleAttributeToLink( $target, $link );
+
+   return $link;
+   }
+
+   /**
+* @param $target
+* @param $link
+*/
+   protected function ( $target, &$link ) {
+
+   // TODO: should this be more elaborate? See Linker::linkAttribs
+   // Cleanest would probably be to use Linker::link and parse it
+   // back into a DOMElement, but we are in a somewhat 
time-critical
+   // part here.
+   $classes = '';
+
+   if ( !$target->isKnown() ) {
+   $classes .= 'new ';
}
 
-   return $this->mFullDefinition->cloneNode( true );
+   if ( $target->isExternal() ) {
+   $classes .= 'extiw ';
+   }
+
+   // set style
+   $classes .= $this->mDefinitions[ 0 ][ self::ELEMENT_STYLE ];
+
+   if ( $classes !== '' ) {
+   $link->setAttribute( 'class', $classes );
+   }
+
+   return $link;
+   }
+
+   /**
+* @param $target
+* @param $link
+*/
+   protected function ( $target, &$link ) {
+
+   if ( 

[MediaWiki-commits] [Gerrit] Refactor LingoElement - change (mediawiki...Lingo)

2016-03-05 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Refactor LingoElement
..


Refactor LingoElement

Change-Id: I5679311e9ef0e0cc813d2aa6177cab08d1cbc46d
---
M src/LingoElement.php
1 file changed, 156 insertions(+), 149 deletions(-)

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



diff --git a/src/LingoElement.php b/src/LingoElement.php
index a5bf9c6..97aa9e6 100644
--- a/src/LingoElement.php
+++ b/src/LingoElement.php
@@ -49,13 +49,11 @@
const ELEMENT_STYLE = 4;
 
const ELEMENT_FIELDCOUNT = 5;  // number of fields stored for each 
element; (last field's index) + 1
-
+   static private $mLinkTemplate = null;
private $mFullDefinition = null;
private $mDefinitions = array();
private $mTerm = null;
private $mHasBeenDisplayed = false;
-
-   static private $mLinkTemplate = null;
 
/**
 * Extensions\Lingo\LingoElement constructor.
@@ -86,31 +84,174 @@
 
global $wgexLingoDisplayOnce;
 
-   // return textnode if
if ( $wgexLingoDisplayOnce && $this->mHasBeenDisplayed ) {
return $doc->createTextNode( $this->mTerm );
}
 
+   $this->buildFullDefinition( $doc );
+   $this->mHasBeenDisplayed = true;
+
+   return $this->mFullDefinition->cloneNode( true );
+   }
+
+   /**
+* @param DOMDocument $doc
+* @return DOMDocument
+*/
+   private function buildFullDefinition( DOMDocument &$doc ) {
+
// only create if not yet created
if ( $this->mFullDefinition === null || 
$this->mFullDefinition->ownerDocument !== $doc ) {
 
-   // if there is only one link available, just insert the 
link
-   if ( count( $this->mDefinitions ) === 1
-   && !is_string( $this->mDefinitions[ 0 ][ 
self::ELEMENT_DEFINITION ] )
-   && is_string( $this->mDefinitions[ 0 ][ 
self::ELEMENT_LINK ] )
-   ) {
-
+   if ( $this->isSimpleLink() ) {
$this->mFullDefinition = 
$this->getFullDefinitionAsLink( $doc );
-
-   } else { // else insert the complete tooltip
-
+   } else {
$this->mFullDefinition = 
$this->getFullDefinitionAsTooltip( $doc );
}
+   }
+   }
 
-   $this->mHasBeenDisplayed = true;
+   /**
+* @return bool
+*/
+   private function isSimpleLink() {
+   return count( $this->mDefinitions ) === 1 &&
+   !is_string( $this->mDefinitions[ 0 ][ 
self::ELEMENT_DEFINITION ] ) &&
+   is_string( $this->mDefinitions[ 0 ][ self::ELEMENT_LINK 
] );
+   }
+
+   /**
+* @param DOMDocument $doc
+*
+* @return DOMElement
+* @throws MWException
+*/
+   protected function getFullDefinitionAsLink( DOMDocument &$doc ) {
+
+   // create Title object for target page
+   $target = Title::newFromText( $this->mDefinitions[ 0 ][ 
self::ELEMENT_LINK ] );
+
+   // create link element
+   $link = $doc->createElement( 'a', $this->mDefinitions[ 0 ][ 
self::ELEMENT_TERM ] );
+
+   // set the link target
+   $link->setAttribute( 'href', $target->getLinkUrl() );
+   $link = $this->addClassAttributeToLink( $target, $link );
+   $link = $this->addTitleAttributeToLink( $target, $link );
+
+   return $link;
+   }
+
+   /**
+* @param $target
+* @param $link
+*/
+   protected function ( $target, &$link ) {
+
+   // TODO: should this be more elaborate? See Linker::linkAttribs
+   // Cleanest would probably be to use Linker::link and parse it
+   // back into a DOMElement, but we are in a somewhat 
time-critical
+   // part here.
+   $classes = '';
+
+   if ( !$target->isKnown() ) {
+   $classes .= 'new ';
}
 
-   return $this->mFullDefinition->cloneNode( true );
+   if ( $target->isExternal() ) {
+   $classes .= 'extiw ';
+   }
+
+   // set style
+   $classes .= $this->mDefinitions[ 0 ][ self::ELEMENT_STYLE ];
+
+   if ( $classes !== '' ) {
+   $link->setAttribute( 'class', $classes );
+   }
+
+   return $link;
+   }
+
+   /**
+* @param $target
+* @param $link
+*/
+   protected function ( $target, &$link ) {
+
+   if ( $target->getPrefixedText() === '' ) {
+  

[MediaWiki-commits] [Gerrit] Fix minor issues - change (mediawiki...Lingo)

2016-03-05 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Fix minor issues
..


Fix minor issues

Change-Id: I0bc5f513e90c0ff989aa0ac09e55f11d9a23ffc1
---
M src/LingoBasicBackend.php
M src/LingoParser.php
2 files changed, 2 insertions(+), 14 deletions(-)

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



diff --git a/src/LingoBasicBackend.php b/src/LingoBasicBackend.php
index 04395ef..69a9874 100644
--- a/src/LingoBasicBackend.php
+++ b/src/LingoBasicBackend.php
@@ -60,7 +60,7 @@
$title = Title::newFromText( $page );
if ( $title->getInterwiki() ) {
$this->getMessageLog()->addError( wfMessage( 
'lingo-terminologypagenotlocal', $page )->inContentLanguage()->text() );
-   return false;
+   return;
}
 
// FIXME: This is a hack special-casing the submitting of the 
terminology
diff --git a/src/LingoParser.php b/src/LingoParser.php
index 2e85dc9..1d4942f 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -64,18 +64,6 @@
}
 
/**
-* @param Parser $parser
-* @return string
-*/
-   private static function uniqPrefix( Parser &$parser ) {
-   if ( defined( "Parser::MARKER_PREFIX" ) ) {
-   return Parser::MARKER_PREFIX;
-   } else {
-   return $parser->uniqPrefix();
-   }
-   }
-
-   /**
 *
 * @param Parser $parser
 * @param string $text
@@ -88,7 +76,7 @@
 
// The RegEx to split a chunk of text into words
// Words are: placeholders for stripped items, 
sequences of letters and numbers, single characters that are neither letter nor 
number
-   self::$regex = '/' . preg_quote( self::uniqPrefix( 
$parser ), '/' ) . '.*?' . preg_quote( Parser::MARKER_SUFFIX, '/' ) . 
'|[\p{L}\p{N}]+|[^\p{L}\p{N}]/u';
+   self::$regex = '/' . preg_quote( Parser::MARKER_PREFIX, 
'/' ) . '.*?' . preg_quote( Parser::MARKER_SUFFIX, '/' ) . 
'|[\p{L}\p{N}]+|[^\p{L}\p{N}]/u';
}
 
self::$parserSingleton->realParse( $parser, $text );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0bc5f513e90c0ff989aa0ac09e55f11d9a23ffc1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Fix minor issues - change (mediawiki...Lingo)

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

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

Change subject: Fix minor issues
..

Fix minor issues

Change-Id: I0bc5f513e90c0ff989aa0ac09e55f11d9a23ffc1
---
M src/LingoBasicBackend.php
M src/LingoParser.php
2 files changed, 2 insertions(+), 14 deletions(-)


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

diff --git a/src/LingoBasicBackend.php b/src/LingoBasicBackend.php
index 04395ef..69a9874 100644
--- a/src/LingoBasicBackend.php
+++ b/src/LingoBasicBackend.php
@@ -60,7 +60,7 @@
$title = Title::newFromText( $page );
if ( $title->getInterwiki() ) {
$this->getMessageLog()->addError( wfMessage( 
'lingo-terminologypagenotlocal', $page )->inContentLanguage()->text() );
-   return false;
+   return;
}
 
// FIXME: This is a hack special-casing the submitting of the 
terminology
diff --git a/src/LingoParser.php b/src/LingoParser.php
index 2e85dc9..1d4942f 100644
--- a/src/LingoParser.php
+++ b/src/LingoParser.php
@@ -64,18 +64,6 @@
}
 
/**
-* @param Parser $parser
-* @return string
-*/
-   private static function uniqPrefix( Parser &$parser ) {
-   if ( defined( "Parser::MARKER_PREFIX" ) ) {
-   return Parser::MARKER_PREFIX;
-   } else {
-   return $parser->uniqPrefix();
-   }
-   }
-
-   /**
 *
 * @param Parser $parser
 * @param string $text
@@ -88,7 +76,7 @@
 
// The RegEx to split a chunk of text into words
// Words are: placeholders for stripped items, 
sequences of letters and numbers, single characters that are neither letter nor 
number
-   self::$regex = '/' . preg_quote( self::uniqPrefix( 
$parser ), '/' ) . '.*?' . preg_quote( Parser::MARKER_SUFFIX, '/' ) . 
'|[\p{L}\p{N}]+|[^\p{L}\p{N}]/u';
+   self::$regex = '/' . preg_quote( Parser::MARKER_PREFIX, 
'/' ) . '.*?' . preg_quote( Parser::MARKER_SUFFIX, '/' ) . 
'|[\p{L}\p{N}]+|[^\p{L}\p{N}]/u';
}
 
self::$parserSingleton->realParse( $parser, $text );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bc5f513e90c0ff989aa0ac09e55f11d9a23ffc1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Use namespaces - change (mediawiki...Lingo)

2016-03-05 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Use namespaces
..


Use namespaces

Change-Id: I3b6d10401dc9319e3d87466ea6514c1904206125
---
M extension.json
M src/LingoBackend.php
M src/LingoBasicBackend.php
M src/LingoElement.php
M src/LingoHooks.php
M src/LingoMessageLog.php
M src/LingoParser.php
M src/LingoTree.php
M tests/phpunit/Unit/LingoBackendTest.php
M tests/phpunit/Unit/LingoBasicBackendTest.php
M tests/phpunit/Unit/LingoElementTest.php
M tests/phpunit/Unit/LingoMessageLogTest.php
M tests/phpunit/Unit/LingoParserTest.php
M tests/phpunit/Unit/LingoTreeTest.php
14 files changed, 89 insertions(+), 51 deletions(-)

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



diff --git a/extension.json b/extension.json
index 3f822ba..3c399ad 100644
--- a/extension.json
+++ b/extension.json
@@ -44,7 +44,7 @@
},
"config": {
"_prefix": "wgex",
-   "LingoBackend": "LingoBasicBackend",
+   "LingoBackend": "Extensions\\Lingo\\LingoBasicBackend",
"LingoPage": null,
"LingoDisplayOnce": false,
"LingoCacheType": null,
@@ -60,30 +60,30 @@
"LingoMagic": "src/Lingo.i18n.magic.php"
},
"AutoloadClasses": {
-   "LingoHooks": "/src/LingoHooks.php",
-   "LingoParser": "/src/LingoParser.php",
-   "LingoTree": "/src/LingoTree.php",
-   "LingoElement": "/src/LingoElement.php",
-   "LingoBackend": "/src/LingoBackend.php",
-   "LingoBasicBackend": "/src/LingoBasicBackend.php",
-   "LingoMessageLog": "/src/LingoMessageLog.php"
+   "Extensions\\Lingo\\LingoHooks": "/src/LingoHooks.php",
+   "Extensions\\Lingo\\LingoParser": "/src/LingoParser.php",
+   "Extensions\\Lingo\\LingoTree": "/src/LingoTree.php",
+   "Extensions\\Lingo\\LingoElement": "/src/LingoElement.php",
+   "Extensions\\Lingo\\LingoBackend": "/src/LingoBackend.php",
+   "Extensions\\Lingo\\LingoBasicBackend": 
"/src/LingoBasicBackend.php",
+   "Extensions\\Lingo\\LingoMessageLog": "/src/LingoMessageLog.php"
},
"Hooks": {
"ParserFirstCallInit": [
-   "LingoHooks::registerTags"
+   "Extensions\\Lingo\\LingoHooks::registerTags"
],
"ArticlePurge": [
-   "LingoBasicBackend::purgeCache"
+   "Extensions\\Lingo\\LingoBasicBackend::purgeCache"
],
"ArticleSave": [
-   "LingoBasicBackend::purgeCache"
+   "Extensions\\Lingo\\LingoBasicBackend::purgeCache"
],
"ParserAfterParse": [
-   "LingoHooks::parse"
+   "Extensions\\Lingo\\LingoHooks::parse"
]
},
"ExtensionFunctions": [
-   "LingoHooks::initExtension"
+   "Extensions\\Lingo\\LingoHooks::initExtension"
],
"manifest_version": 1
 }
diff --git a/src/LingoBackend.php b/src/LingoBackend.php
index 383ee69..1463f85 100644
--- a/src/LingoBackend.php
+++ b/src/LingoBackend.php
@@ -1,7 +1,7 @@
 setHook( 'noglossary', 
'LingoHooks::noglossaryTagRenderer' );
+   $parser->setHook( 'noglossary', 
'Extensions\Lingo\LingoHooks::noglossaryTagRenderer' );
return true;
}
 
diff --git a/src/LingoMessageLog.php b/src/LingoMessageLog.php
index 089169a..62a15fd 100644
--- a/src/LingoMessageLog.php
+++ b/src/LingoMessageLog.php
@@ -1,7 +1,7 @@
 mLingoTree;
}
 
+   /**
+* @return LingoTree
+*/
protected function () {
 
$lingoTree = new LingoTree();
diff --git a/src/LingoTree.php b/src/LingoTree.php
index 604bb48..ed410c6 100644
--- a/src/LingoTree.php
+++ b/src/LingoTree.php
@@ -1,7 +1,7 @@
 
  * @covers ::
  *
@@ -42,7 +42,7 @@
 
public function testUseCache() {
 
-   $stub = $this->getMockForAbstractClass( '\LingoBackend' );
+   $stub = $this->getMockForAbstractClass( 
'\Extensions\Lingo\LingoBackend' );
 
$this->assertFalse( $stub->useCache() );
}
diff --git a/tests/phpunit/Unit/LingoBasicBackendTest.php 
b/tests/phpunit/Unit/LingoBasicBackendTest.php
index ffe3a13..ac2137f 100644
--- a/tests/phpunit/Unit/LingoBasicBackendTest.php
+++ b/tests/phpunit/Unit/LingoBasicBackendTest.php
@@ -31,7 +31,7 @@
  * @group extensions-lingo-unit
  * @group mediawiki-databaseless
  *
- * @coversDefaultClass \LingoBasicBackend
+ * @coversDefaultClass \Extensions\Lingo\LingoBasicBackend
  * @covers ::
  * @covers ::
  *
@@ -46,8 +46,8 @@
public function testCanConstruct() {
 
$this->assertInstanceOf(
-   

[MediaWiki-commits] [Gerrit] Use namespaces - change (mediawiki...Lingo)

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

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

Change subject: Use namespaces
..

Use namespaces

Change-Id: I3b6d10401dc9319e3d87466ea6514c1904206125
---
M extension.json
M src/LingoBackend.php
M src/LingoBasicBackend.php
M src/LingoElement.php
M src/LingoHooks.php
M src/LingoMessageLog.php
M src/LingoParser.php
M src/LingoTree.php
M tests/phpunit/Unit/LingoBackendTest.php
M tests/phpunit/Unit/LingoBasicBackendTest.php
M tests/phpunit/Unit/LingoElementTest.php
M tests/phpunit/Unit/LingoMessageLogTest.php
M tests/phpunit/Unit/LingoParserTest.php
M tests/phpunit/Unit/LingoTreeTest.php
14 files changed, 89 insertions(+), 51 deletions(-)


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

diff --git a/extension.json b/extension.json
index 3f822ba..3c399ad 100644
--- a/extension.json
+++ b/extension.json
@@ -44,7 +44,7 @@
},
"config": {
"_prefix": "wgex",
-   "LingoBackend": "LingoBasicBackend",
+   "LingoBackend": "Extensions\\Lingo\\LingoBasicBackend",
"LingoPage": null,
"LingoDisplayOnce": false,
"LingoCacheType": null,
@@ -60,30 +60,30 @@
"LingoMagic": "src/Lingo.i18n.magic.php"
},
"AutoloadClasses": {
-   "LingoHooks": "/src/LingoHooks.php",
-   "LingoParser": "/src/LingoParser.php",
-   "LingoTree": "/src/LingoTree.php",
-   "LingoElement": "/src/LingoElement.php",
-   "LingoBackend": "/src/LingoBackend.php",
-   "LingoBasicBackend": "/src/LingoBasicBackend.php",
-   "LingoMessageLog": "/src/LingoMessageLog.php"
+   "Extensions\\Lingo\\LingoHooks": "/src/LingoHooks.php",
+   "Extensions\\Lingo\\LingoParser": "/src/LingoParser.php",
+   "Extensions\\Lingo\\LingoTree": "/src/LingoTree.php",
+   "Extensions\\Lingo\\LingoElement": "/src/LingoElement.php",
+   "Extensions\\Lingo\\LingoBackend": "/src/LingoBackend.php",
+   "Extensions\\Lingo\\LingoBasicBackend": 
"/src/LingoBasicBackend.php",
+   "Extensions\\Lingo\\LingoMessageLog": "/src/LingoMessageLog.php"
},
"Hooks": {
"ParserFirstCallInit": [
-   "LingoHooks::registerTags"
+   "Extensions\\Lingo\\LingoHooks::registerTags"
],
"ArticlePurge": [
-   "LingoBasicBackend::purgeCache"
+   "Extensions\\Lingo\\LingoBasicBackend::purgeCache"
],
"ArticleSave": [
-   "LingoBasicBackend::purgeCache"
+   "Extensions\\Lingo\\LingoBasicBackend::purgeCache"
],
"ParserAfterParse": [
-   "LingoHooks::parse"
+   "Extensions\\Lingo\\LingoHooks::parse"
]
},
"ExtensionFunctions": [
-   "LingoHooks::initExtension"
+   "Extensions\\Lingo\\LingoHooks::initExtension"
],
"manifest_version": 1
 }
diff --git a/src/LingoBackend.php b/src/LingoBackend.php
index 383ee69..1463f85 100644
--- a/src/LingoBackend.php
+++ b/src/LingoBackend.php
@@ -1,7 +1,7 @@
 setHook( 'noglossary', 
'LingoHooks::noglossaryTagRenderer' );
+   $parser->setHook( 'noglossary', 
'Extensions\Lingo\LingoHooks::noglossaryTagRenderer' );
return true;
}
 
diff --git a/src/LingoMessageLog.php b/src/LingoMessageLog.php
index 089169a..62a15fd 100644
--- a/src/LingoMessageLog.php
+++ b/src/LingoMessageLog.php
@@ -1,7 +1,7 @@
 mLingoTree;
}
 
+   /**
+* @return LingoTree
+*/
protected function () {
 
$lingoTree = new LingoTree();
diff --git a/src/LingoTree.php b/src/LingoTree.php
index 604bb48..ed410c6 100644
--- a/src/LingoTree.php
+++ b/src/LingoTree.php
@@ -1,7 +1,7 @@
 
  * @covers ::
  *
@@ -42,7 +42,7 @@
 
public function testUseCache() {
 
-   $stub = $this->getMockForAbstractClass( '\LingoBackend' );
+   $stub = $this->getMockForAbstractClass( 
'\Extensions\Lingo\LingoBackend' );
 
$this->assertFalse( $stub->useCache() );
}
diff --git a/tests/phpunit/Unit/LingoBasicBackendTest.php 
b/tests/phpunit/Unit/LingoBasicBackendTest.php
index ffe3a13..ac2137f 100644
--- a/tests/phpunit/Unit/LingoBasicBackendTest.php
+++ b/tests/phpunit/Unit/LingoBasicBackendTest.php
@@ -31,7 +31,7 @@
  * @group extensions-lingo-unit
  * @group mediawiki-databaseless
  *
- * @coversDefaultClass \LingoBasicBackend
+ * @coversDefaultClass \Extensions\Lingo\LingoBasicBackend
  * @covers ::
  * @covers ::
  *
@@ -46,8 +46,8 @@
public function testCanConstruct() {
 

[MediaWiki-commits] [Gerrit] Cleanup - change (mediawiki...Lingo)

2016-03-05 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Cleanup
..


Cleanup

Change-Id: I1c50f179eafc7f45133ca5f9d77c1586a26418fa
---
M src/Lingo.i18n.magic.php
M src/LingoBackend.php
M src/LingoBasicBackend.php
M src/LingoElement.php
M src/LingoHooks.php
M src/LingoMessageLog.php
M src/LingoParser.php
M src/LingoTree.php
8 files changed, 202 insertions(+), 153 deletions(-)

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



diff --git a/src/Lingo.i18n.magic.php b/src/Lingo.i18n.magic.php
index 3a3218d..af1f283 100644
--- a/src/Lingo.i18n.magic.php
+++ b/src/Lingo.i18n.magic.php
@@ -9,81 +9,81 @@
 $magicWords = array();
 
 /** English (English) */
-$magicWords['en'] = array(
+$magicWords[ 'en' ] = array(
'noglossary' => array( 0, '__NOGLOSSARY__' ),
 );
 
 /** Arabic (العربية) */
-$magicWords['ar'] = array(
+$magicWords[ 'ar' ] = array(
'noglossary' => array( 0, '__لا_قاموس__' ),
 );
 
 /** Egyptian Arabic (مصرى) */
-$magicWords['arz'] = array(
+$magicWords[ 'arz' ] = array(
'noglossary' => array( 0, '__من_غير_قاموس__' ),
 );
 
 /** German (Deutsch) */
-$magicWords['de'] = array(
+$magicWords[ 'de' ] = array(
'noglossary' => array( 0, '__KEINGLOSSAR__', '__KEIN_GLOSSAR__' ),
 );
 
 /** Zazaki (Zazaki) */
-$magicWords['diq'] = array(
+$magicWords[ 'diq' ] = array(
'noglossary' => array( 0, 'QISEBENDÇINİYO' ),
 );
 
 /** Esperanto (Esperanto) */
-$magicWords['eo'] = array(
+$magicWords[ 'eo' ] = array(
'noglossary' => array( 0, '__NEDIFINO__' ),
 );
 
 /** French (français) */
-$magicWords['fr'] = array(
+$magicWords[ 'fr' ] = array(
'noglossary' => array( 0, '__SANSGLOSSAIRE__' ),
 );
 
 /** Italian (italiano) */
-$magicWords['it'] = array(
+$magicWords[ 'it' ] = array(
'noglossary' => array( 0, '__NOGLOSSARIO__' ),
 );
 
 /** Korean (한국어) */
-$magicWords['ko'] = array(
+$magicWords[ 'ko' ] = array(
'noglossary' => array( 0, '__용어집없음__' ),
 );
 
 /** Macedonian (македонски) */
-$magicWords['mk'] = array(
+$magicWords[ 'mk' ] = array(
'noglossary' => array( 0, '__БЕЗПОИМНИК__' ),
 );
 
 /** Malayalam (മലയാളം) */
-$magicWords['ml'] = array(
+$magicWords[ 'ml' ] = array(
'noglossary' => array( 0, '__ചുരുക്കംവേണ്ട__' ),
 );
 
 /** Low Saxon (Netherlands) (Nedersaksies) */
-$magicWords['nds-nl'] = array(
+$magicWords[ 'nds-nl' ] = array(
'noglossary' => array( 0, '__GIEN_GLOSSARIUM__' ),
 );
 
 /** Dutch (Nederlands) */
-$magicWords['nl'] = array(
+$magicWords[ 'nl' ] = array(
'noglossary' => array( 0, '___GEENWOORDENLIJST__' ),
 );
 
 /** Serbian (Latin script) (srpski (latinica)‎) */
-$magicWords['sr-el'] = array(
+$magicWords[ 'sr-el' ] = array(
'noglossary' => array( 0, '__BEZREČNIKA__', '__BEZ_REČNIKA__' ),
 );
 
 /** Turkish (Türkçe) */
-$magicWords['tr'] = array(
+$magicWords[ 'tr' ] = array(
'noglossary' => array( 0, '__SÖZLÜKYOK__' ),
 );
 
 /** Simplified Chinese (中文(简体)‎) */
-$magicWords['zh-hans'] = array(
+$magicWords[ 'zh-hans' ] = array(
'noglossary' => array( 0, '__无词汇表__' ),
-);
\ No newline at end of file
+);
diff --git a/src/LingoBackend.php b/src/LingoBackend.php
index e64741a..383ee69 100644
--- a/src/LingoBackend.php
+++ b/src/LingoBackend.php
@@ -35,6 +35,10 @@
 
protected $mMessageLog;
 
+   /**
+* LingoBackend constructor.
+* @param LingoMessageLog|null $messages
+*/
public function __construct( LingoMessageLog &$messages = null ) {
 
if ( !$messages ) {
@@ -44,6 +48,9 @@
}
}
 
+   /**
+* @return LingoMessageLog
+*/
public function getMessageLog() {
return $this->mMessageLog;
}
@@ -65,7 +72,7 @@
 * strings: Term, Definition, Link, Source. If there is no next element 
the
 * function returns null.
 *
-* @return the next element or null
+* @return LingoElement | null
 */
abstract public function next();
 }
diff --git a/src/LingoBasicBackend.php b/src/LingoBasicBackend.php
index 84d80c2..d872cd0 100644
--- a/src/LingoBasicBackend.php
+++ b/src/LingoBasicBackend.php
@@ -35,6 +35,10 @@
 
protected $mArticleLines = array();
 
+   /**
+* LingoBasicBackend constructor.
+* @param LingoMessageLog|null $messages
+*/
public function __construct( LingoMessageLog &$messages = null ) {
 
global $wgexLingoPage, $wgRequest;
@@ -46,7 +50,7 @@
// Get Terminology page
$title = Title::newFromText( $page );
if ( $title->getInterwiki() ) {
-   $this->getMessageLog()->addError( wfMessage( 
'lingo-terminologypagenotlocal' , $page )->inContentLanguage()->text() );
+   $this->getMessageLog()->addError( wfMessage( 

[MediaWiki-commits] [Gerrit] Cleanup - change (mediawiki...Lingo)

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

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

Change subject: Cleanup
..

Cleanup

Change-Id: I1c50f179eafc7f45133ca5f9d77c1586a26418fa
---
M src/Lingo.i18n.magic.php
M src/LingoBackend.php
M src/LingoBasicBackend.php
M src/LingoElement.php
M src/LingoHooks.php
M src/LingoMessageLog.php
M src/LingoParser.php
M src/LingoTree.php
8 files changed, 202 insertions(+), 153 deletions(-)


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

diff --git a/src/Lingo.i18n.magic.php b/src/Lingo.i18n.magic.php
index 3a3218d..af1f283 100644
--- a/src/Lingo.i18n.magic.php
+++ b/src/Lingo.i18n.magic.php
@@ -9,81 +9,81 @@
 $magicWords = array();
 
 /** English (English) */
-$magicWords['en'] = array(
+$magicWords[ 'en' ] = array(
'noglossary' => array( 0, '__NOGLOSSARY__' ),
 );
 
 /** Arabic (العربية) */
-$magicWords['ar'] = array(
+$magicWords[ 'ar' ] = array(
'noglossary' => array( 0, '__لا_قاموس__' ),
 );
 
 /** Egyptian Arabic (مصرى) */
-$magicWords['arz'] = array(
+$magicWords[ 'arz' ] = array(
'noglossary' => array( 0, '__من_غير_قاموس__' ),
 );
 
 /** German (Deutsch) */
-$magicWords['de'] = array(
+$magicWords[ 'de' ] = array(
'noglossary' => array( 0, '__KEINGLOSSAR__', '__KEIN_GLOSSAR__' ),
 );
 
 /** Zazaki (Zazaki) */
-$magicWords['diq'] = array(
+$magicWords[ 'diq' ] = array(
'noglossary' => array( 0, 'QISEBENDÇINİYO' ),
 );
 
 /** Esperanto (Esperanto) */
-$magicWords['eo'] = array(
+$magicWords[ 'eo' ] = array(
'noglossary' => array( 0, '__NEDIFINO__' ),
 );
 
 /** French (français) */
-$magicWords['fr'] = array(
+$magicWords[ 'fr' ] = array(
'noglossary' => array( 0, '__SANSGLOSSAIRE__' ),
 );
 
 /** Italian (italiano) */
-$magicWords['it'] = array(
+$magicWords[ 'it' ] = array(
'noglossary' => array( 0, '__NOGLOSSARIO__' ),
 );
 
 /** Korean (한국어) */
-$magicWords['ko'] = array(
+$magicWords[ 'ko' ] = array(
'noglossary' => array( 0, '__용어집없음__' ),
 );
 
 /** Macedonian (македонски) */
-$magicWords['mk'] = array(
+$magicWords[ 'mk' ] = array(
'noglossary' => array( 0, '__БЕЗПОИМНИК__' ),
 );
 
 /** Malayalam (മലയാളം) */
-$magicWords['ml'] = array(
+$magicWords[ 'ml' ] = array(
'noglossary' => array( 0, '__ചുരുക്കംവേണ്ട__' ),
 );
 
 /** Low Saxon (Netherlands) (Nedersaksies) */
-$magicWords['nds-nl'] = array(
+$magicWords[ 'nds-nl' ] = array(
'noglossary' => array( 0, '__GIEN_GLOSSARIUM__' ),
 );
 
 /** Dutch (Nederlands) */
-$magicWords['nl'] = array(
+$magicWords[ 'nl' ] = array(
'noglossary' => array( 0, '___GEENWOORDENLIJST__' ),
 );
 
 /** Serbian (Latin script) (srpski (latinica)‎) */
-$magicWords['sr-el'] = array(
+$magicWords[ 'sr-el' ] = array(
'noglossary' => array( 0, '__BEZREČNIKA__', '__BEZ_REČNIKA__' ),
 );
 
 /** Turkish (Türkçe) */
-$magicWords['tr'] = array(
+$magicWords[ 'tr' ] = array(
'noglossary' => array( 0, '__SÖZLÜKYOK__' ),
 );
 
 /** Simplified Chinese (中文(简体)‎) */
-$magicWords['zh-hans'] = array(
+$magicWords[ 'zh-hans' ] = array(
'noglossary' => array( 0, '__无词汇表__' ),
-);
\ No newline at end of file
+);
diff --git a/src/LingoBackend.php b/src/LingoBackend.php
index e64741a..383ee69 100644
--- a/src/LingoBackend.php
+++ b/src/LingoBackend.php
@@ -35,6 +35,10 @@
 
protected $mMessageLog;
 
+   /**
+* LingoBackend constructor.
+* @param LingoMessageLog|null $messages
+*/
public function __construct( LingoMessageLog &$messages = null ) {
 
if ( !$messages ) {
@@ -44,6 +48,9 @@
}
}
 
+   /**
+* @return LingoMessageLog
+*/
public function getMessageLog() {
return $this->mMessageLog;
}
@@ -65,7 +72,7 @@
 * strings: Term, Definition, Link, Source. If there is no next element 
the
 * function returns null.
 *
-* @return the next element or null
+* @return LingoElement | null
 */
abstract public function next();
 }
diff --git a/src/LingoBasicBackend.php b/src/LingoBasicBackend.php
index 84d80c2..d872cd0 100644
--- a/src/LingoBasicBackend.php
+++ b/src/LingoBasicBackend.php
@@ -35,6 +35,10 @@
 
protected $mArticleLines = array();
 
+   /**
+* LingoBasicBackend constructor.
+* @param LingoMessageLog|null $messages
+*/
public function __construct( LingoMessageLog &$messages = null ) {
 
global $wgexLingoPage, $wgRequest;
@@ -46,7 +50,7 @@
// Get Terminology page
$title = Title::newFromText( $page );
if ( $title->getInterwiki() ) {
-   $this->getMessageLog()->addError( wfMessage( 
'lingo-terminologypagenotlocal' , $page )->inContentLanguage()->text() );
+   

[MediaWiki-commits] [Gerrit] Add license text to files - change (mediawiki...Lingo)

2016-03-05 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Add license text to files
..


Add license text to files

Change-Id: I0b15f674ef4b7fdede48e67ba0f031cf4c00854c
---
M README.md
M libs/Lingo.js
M src/LingoBackend.php
M src/LingoBasicBackend.php
M src/LingoElement.php
M src/LingoHooks.php
M src/LingoMessageLog.php
M src/LingoParser.php
M src/LingoTree.php
M styles/Lingo.css
10 files changed, 172 insertions(+), 4 deletions(-)

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



diff --git a/README.md b/README.md
index 2d1837f..2a6f52d 100644
--- a/README.md
+++ b/README.md
@@ -14,8 +14,8 @@
 
 ## Requirements
 
-- PHP 5.3.2 or later
-- MediaWiki 1.25 or later
+- PHP 5.3.3 or later
+- MediaWiki 1.26 or later
 
 ## Installation
 
diff --git a/libs/Lingo.js b/libs/Lingo.js
index e281509..e1db33c 100644
--- a/libs/Lingo.js
+++ b/libs/Lingo.js
@@ -1,7 +1,28 @@
 /**
  * Javascript handler for the Lingo extension
  *
+ * This file is part of the MediaWiki extension Lingo.
+ *
+ * @copyright 2011 - 2016, Stephan Gambke
+ * @license   GNU General Public License, version 2 (or any later version)
+ *
+ * The Lingo extension is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the 
Free
+ * Software Foundation; either version 2 of the License, or (at your option) 
any
+ * later version.
+ *
+ * The Lingo extension is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 
more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see .
+ *
  * @author Stephan Gambke
+ *
+ * @file
+ * @ingroup Lingo
  */
 
 /*global jQuery, mediaWiki */
diff --git a/src/LingoBackend.php b/src/LingoBackend.php
index 4d4f2a2..e64741a 100644
--- a/src/LingoBackend.php
+++ b/src/LingoBackend.php
@@ -3,6 +3,24 @@
 /**
  * File holding the LingoBackend class
  *
+ * This file is part of the MediaWiki extension Lingo.
+ *
+ * @copyright 2011 - 2016, Stephan Gambke
+ * @license   GNU General Public License, version 2 (or any later version)
+ *
+ * The Lingo extension is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the 
Free
+ * Software Foundation; either version 2 of the License, or (at your option) 
any
+ * later version.
+ *
+ * The Lingo extension is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 
more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see .
+ *
  * @author Stephan Gambke
  * @file
  * @ingroup Lingo
diff --git a/src/LingoBasicBackend.php b/src/LingoBasicBackend.php
index 7d0bb47..84d80c2 100644
--- a/src/LingoBasicBackend.php
+++ b/src/LingoBasicBackend.php
@@ -3,6 +3,24 @@
 /**
  * File holding the LingoBackend class
  *
+ * This file is part of the MediaWiki extension Lingo.
+ *
+ * @copyright 2011 - 2016, Stephan Gambke
+ * @license   GNU General Public License, version 2 (or any later version)
+ *
+ * The Lingo extension is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the 
Free
+ * Software Foundation; either version 2 of the License, or (at your option) 
any
+ * later version.
+ *
+ * The Lingo extension is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 
more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see .
+ *
  * @author Stephan Gambke
  * @file
  * @ingroup Lingo
diff --git a/src/LingoElement.php b/src/LingoElement.php
index cbe7574..9614ce8 100644
--- a/src/LingoElement.php
+++ b/src/LingoElement.php
@@ -3,6 +3,24 @@
 /**
  * File holding the LingoElement class.
  *
+ * This file is part of the MediaWiki extension Lingo.
+ *
+ * @copyright 2011 - 2016, Stephan Gambke
+ * @license   GNU General Public License, version 2 (or any later version)
+ *
+ * The Lingo extension is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the 
Free
+ * Software Foundation; either version 2 of the License, or (at your option) 
any
+ * later version.
+ *
+ * The Lingo extension is distributed in the hope that it will be 

[MediaWiki-commits] [Gerrit] Add license text to files - change (mediawiki...Lingo)

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

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

Change subject: Add license text to files
..

Add license text to files

Change-Id: I0b15f674ef4b7fdede48e67ba0f031cf4c00854c
---
M README.md
M libs/Lingo.js
M src/LingoBackend.php
M src/LingoBasicBackend.php
M src/LingoElement.php
M src/LingoHooks.php
M src/LingoMessageLog.php
M src/LingoParser.php
M src/LingoTree.php
M styles/Lingo.css
10 files changed, 172 insertions(+), 4 deletions(-)


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

diff --git a/README.md b/README.md
index 2d1837f..2a6f52d 100644
--- a/README.md
+++ b/README.md
@@ -14,8 +14,8 @@
 
 ## Requirements
 
-- PHP 5.3.2 or later
-- MediaWiki 1.25 or later
+- PHP 5.3.3 or later
+- MediaWiki 1.26 or later
 
 ## Installation
 
diff --git a/libs/Lingo.js b/libs/Lingo.js
index e281509..e1db33c 100644
--- a/libs/Lingo.js
+++ b/libs/Lingo.js
@@ -1,7 +1,28 @@
 /**
  * Javascript handler for the Lingo extension
  *
+ * This file is part of the MediaWiki extension Lingo.
+ *
+ * @copyright 2011 - 2016, Stephan Gambke
+ * @license   GNU General Public License, version 2 (or any later version)
+ *
+ * The Lingo extension is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the 
Free
+ * Software Foundation; either version 2 of the License, or (at your option) 
any
+ * later version.
+ *
+ * The Lingo extension is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 
more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see .
+ *
  * @author Stephan Gambke
+ *
+ * @file
+ * @ingroup Lingo
  */
 
 /*global jQuery, mediaWiki */
diff --git a/src/LingoBackend.php b/src/LingoBackend.php
index 4d4f2a2..e64741a 100644
--- a/src/LingoBackend.php
+++ b/src/LingoBackend.php
@@ -3,6 +3,24 @@
 /**
  * File holding the LingoBackend class
  *
+ * This file is part of the MediaWiki extension Lingo.
+ *
+ * @copyright 2011 - 2016, Stephan Gambke
+ * @license   GNU General Public License, version 2 (or any later version)
+ *
+ * The Lingo extension is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the 
Free
+ * Software Foundation; either version 2 of the License, or (at your option) 
any
+ * later version.
+ *
+ * The Lingo extension is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 
more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see .
+ *
  * @author Stephan Gambke
  * @file
  * @ingroup Lingo
diff --git a/src/LingoBasicBackend.php b/src/LingoBasicBackend.php
index 7d0bb47..84d80c2 100644
--- a/src/LingoBasicBackend.php
+++ b/src/LingoBasicBackend.php
@@ -3,6 +3,24 @@
 /**
  * File holding the LingoBackend class
  *
+ * This file is part of the MediaWiki extension Lingo.
+ *
+ * @copyright 2011 - 2016, Stephan Gambke
+ * @license   GNU General Public License, version 2 (or any later version)
+ *
+ * The Lingo extension is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the 
Free
+ * Software Foundation; either version 2 of the License, or (at your option) 
any
+ * later version.
+ *
+ * The Lingo extension is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 
more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see .
+ *
  * @author Stephan Gambke
  * @file
  * @ingroup Lingo
diff --git a/src/LingoElement.php b/src/LingoElement.php
index cbe7574..9614ce8 100644
--- a/src/LingoElement.php
+++ b/src/LingoElement.php
@@ -3,6 +3,24 @@
 /**
  * File holding the LingoElement class.
  *
+ * This file is part of the MediaWiki extension Lingo.
+ *
+ * @copyright 2011 - 2016, Stephan Gambke
+ * @license   GNU General Public License, version 2 (or any later version)
+ *
+ * The Lingo extension is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by the 
Free
+ * Software Foundation; either version 2 of the License, or (at your option) 
any
+ * later version.
+ *
+ * The Lingo 

[MediaWiki-commits] [Gerrit] Travis: Fix setup for postgres and sqlite - change (mediawiki...Lingo)

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

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

Change subject: Travis: Fix setup for postgres and sqlite
..

Travis: Fix setup for postgres and sqlite

Change-Id: Ibd9787a53bad3b266f9d4980130b249c9ff217a0
---
M .travis.yml
M build/travis/script.sh
2 files changed, 38 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/07/275207/1

diff --git a/.travis.yml b/.travis.yml
index b40ba4e..f9d438f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,7 +29,7 @@
   include:
 - env: DBTYPE=mysql; MW=master
   php: 5.6
-- env: DBTYPE=postgres; MW=master
+- env: DBTYPE=postgres; MW=1.26.2
   php: 5.5
 - env: DBTYPE=sqlite; MW=1.26.0
   php: 5.3
diff --git a/build/travis/script.sh b/build/travis/script.sh
index e08b10c..17d9cd7 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -44,8 +44,43 @@
 
composer install --prefer-source
 
-   mysql -e 'create database its_a_mw;'
-   php maintenance/install.php --dbtype $DBTYPE --dbuser root --dbname 
its_a_mw --dbpath $(pwd) --pass nyan TravisWiki admin
+   case "$DBTYPE" in
+   "mysql")
+
+   mysql -e 'create database its_a_mw;'
+   php maintenance/install.php --dbtype $DBTYPE --dbuser root 
--dbname its_a_mw --pass nyan --scriptpath /TravisWiki TravisWiki admin
+
+   ;;
+
+   "postgres")
+
+   # See 
https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/458
+   sudo /etc/init.d/postgresql stop
+
+   # Travis@support: Try adding a sleep of a few seconds between 
starting PostgreSQL
+   # and the first command that accesses PostgreSQL
+   sleep 3
+
+   sudo /etc/init.d/postgresql start
+   sleep 3
+
+   psql -c 'create database its_a_mw;' -U postgres
+   php maintenance/install.php --dbtype $DBTYPE --dbuser postgres 
--dbname its_a_mw --pass nyan --scriptpath /TravisWiki TravisWiki admin
+
+   ;;
+
+   "sqlite")
+
+   php maintenance/install.php --dbtype $DBTYPE --dbuser root  
--dbname its_a_mw --dbpath $(pwd) --pass nyan --scriptpath /TravisWiki 
TravisWiki admin
+
+   ;;
+
+   *)
+   echo "$DBTYPE is not a recognized database type."
+   exit 1
+
+   esac
+
 }
 
 function installExtensionViaComposerOnMediaWikiRoot {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd9787a53bad3b266f9d4980130b249c9ff217a0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Travis: Fix setup for postgres and sqlite - change (mediawiki...Lingo)

2016-03-05 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Travis: Fix setup for postgres and sqlite
..


Travis: Fix setup for postgres and sqlite

Change-Id: Ibd9787a53bad3b266f9d4980130b249c9ff217a0
---
M .travis.yml
M build/travis/script.sh
2 files changed, 38 insertions(+), 3 deletions(-)

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



diff --git a/.travis.yml b/.travis.yml
index b40ba4e..f9d438f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,7 +29,7 @@
   include:
 - env: DBTYPE=mysql; MW=master
   php: 5.6
-- env: DBTYPE=postgres; MW=master
+- env: DBTYPE=postgres; MW=1.26.2
   php: 5.5
 - env: DBTYPE=sqlite; MW=1.26.0
   php: 5.3
diff --git a/build/travis/script.sh b/build/travis/script.sh
index e08b10c..17d9cd7 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -44,8 +44,43 @@
 
composer install --prefer-source
 
-   mysql -e 'create database its_a_mw;'
-   php maintenance/install.php --dbtype $DBTYPE --dbuser root --dbname 
its_a_mw --dbpath $(pwd) --pass nyan TravisWiki admin
+   case "$DBTYPE" in
+   "mysql")
+
+   mysql -e 'create database its_a_mw;'
+   php maintenance/install.php --dbtype $DBTYPE --dbuser root 
--dbname its_a_mw --pass nyan --scriptpath /TravisWiki TravisWiki admin
+
+   ;;
+
+   "postgres")
+
+   # See 
https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/458
+   sudo /etc/init.d/postgresql stop
+
+   # Travis@support: Try adding a sleep of a few seconds between 
starting PostgreSQL
+   # and the first command that accesses PostgreSQL
+   sleep 3
+
+   sudo /etc/init.d/postgresql start
+   sleep 3
+
+   psql -c 'create database its_a_mw;' -U postgres
+   php maintenance/install.php --dbtype $DBTYPE --dbuser postgres 
--dbname its_a_mw --pass nyan --scriptpath /TravisWiki TravisWiki admin
+
+   ;;
+
+   "sqlite")
+
+   php maintenance/install.php --dbtype $DBTYPE --dbuser root  
--dbname its_a_mw --dbpath $(pwd) --pass nyan --scriptpath /TravisWiki 
TravisWiki admin
+
+   ;;
+
+   *)
+   echo "$DBTYPE is not a recognized database type."
+   exit 1
+
+   esac
+
 }
 
 function installExtensionViaComposerOnMediaWikiRoot {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibd9787a53bad3b266f9d4980130b249c9ff217a0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Avoid test fail when Scrutinizer is down - change (mediawiki...Lingo)

2016-03-05 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Avoid test fail when Scrutinizer is down
..


Avoid test fail when Scrutinizer is down

Change-Id: I7940069f708bae5d702c00407ba46a6e11f5714e
---
M README.md
M build/travis/script.sh
2 files changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/README.md b/README.md
index ea5f97a..2d1837f 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 # Lingo
-[![Build 
Status](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/build.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/build-status/master)
+[![Build 
Status](https://travis-ci.org/wikimedia/mediawiki-extensions-Lingo.svg?branch=master)](https://travis-ci.org/wikimedia/mediawiki-extensions-Lingo)
 [![Code 
Coverage](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
-[![Scrutinizer Code 
Quality](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
+[![Code 
Quality](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
 [![Dependency 
Status](https://www.versioneye.com/php/mediawiki:lingo/badge.png)](https://www.versioneye.com/php/mediawiki:lingo)
 [![Latest Stable 
Version](https://poser.pugx.org/mediawiki/lingo/version.png)](https://packagist.org/packages/mediawiki/lingo)
 [![Packagist download 
count](https://poser.pugx.org/mediawiki/lingo/d/total.png)](https://packagist.org/packages/mediawiki/lingo)
diff --git a/build/travis/script.sh b/build/travis/script.sh
index 617264c..e08b10c 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -96,6 +96,8 @@
 if [ "$MW" == "master" ]
 then
php ../../tests/phpunit/phpunit.php --group extensions-lingo -c 
phpunit.xml.dist --coverage-clover=coverage.clover
+
+   set +e
uploadCoverageReport
 else
php ../../tests/phpunit/phpunit.php --group extensions-lingo -c 
phpunit.xml.dist

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7940069f708bae5d702c00407ba46a6e11f5714e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Avoid test fail when Scrutinizer is down - change (mediawiki...Lingo)

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

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

Change subject: Avoid test fail when Scrutinizer is down
..

Avoid test fail when Scrutinizer is down

Change-Id: I7940069f708bae5d702c00407ba46a6e11f5714e
---
M README.md
M build/travis/script.sh
2 files changed, 4 insertions(+), 2 deletions(-)


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

diff --git a/README.md b/README.md
index ea5f97a..2d1837f 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 # Lingo
-[![Build 
Status](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/build.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/build-status/master)
+[![Build 
Status](https://travis-ci.org/wikimedia/mediawiki-extensions-Lingo.svg?branch=master)](https://travis-ci.org/wikimedia/mediawiki-extensions-Lingo)
 [![Code 
Coverage](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
-[![Scrutinizer Code 
Quality](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
+[![Code 
Quality](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
 [![Dependency 
Status](https://www.versioneye.com/php/mediawiki:lingo/badge.png)](https://www.versioneye.com/php/mediawiki:lingo)
 [![Latest Stable 
Version](https://poser.pugx.org/mediawiki/lingo/version.png)](https://packagist.org/packages/mediawiki/lingo)
 [![Packagist download 
count](https://poser.pugx.org/mediawiki/lingo/d/total.png)](https://packagist.org/packages/mediawiki/lingo)
diff --git a/build/travis/script.sh b/build/travis/script.sh
index 617264c..e08b10c 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -96,6 +96,8 @@
 if [ "$MW" == "master" ]
 then
php ../../tests/phpunit/phpunit.php --group extensions-lingo -c 
phpunit.xml.dist --coverage-clover=coverage.clover
+
+   set +e
uploadCoverageReport
 else
php ../../tests/phpunit/phpunit.php --group extensions-lingo -c 
phpunit.xml.dist

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7940069f708bae5d702c00407ba46a6e11f5714e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Travis setup improvements; documentation - change (mediawiki...Lingo)

2016-03-05 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Travis setup improvements; documentation
..


Travis setup improvements; documentation

Change-Id: Ifab7c71fb9be47bcb31015aa72c539a699eefeb5
---
M .travis.yml
M README.md
M build/travis/script.sh
3 files changed, 10 insertions(+), 19 deletions(-)

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



diff --git a/.travis.yml b/.travis.yml
index c89d7ef..b40ba4e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,16 +24,15 @@
 #
 
 language: php
-#sudo: false
 
 matrix:
   include:
 - env: DBTYPE=mysql; MW=master
   php: 5.6
-#- env: DBTYPE=postgres; MW=master
-#  php: 5.5
-#- env: DBTYPE=sqlite; MW=1.25.5
-#  php: 5.3
+- env: DBTYPE=postgres; MW=master
+  php: 5.5
+- env: DBTYPE=sqlite; MW=1.26.0
+  php: 5.3
 
 script:
 - bash ./build/travis/script.sh
diff --git a/README.md b/README.md
index 3d79669..ea5f97a 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,10 @@
 # Lingo
+[![Build 
Status](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/build.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/build-status/master)
+[![Code 
Coverage](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
+[![Scrutinizer Code 
Quality](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
+[![Dependency 
Status](https://www.versioneye.com/php/mediawiki:lingo/badge.png)](https://www.versioneye.com/php/mediawiki:lingo)
 [![Latest Stable 
Version](https://poser.pugx.org/mediawiki/lingo/version.png)](https://packagist.org/packages/mediawiki/lingo)
 [![Packagist download 
count](https://poser.pugx.org/mediawiki/lingo/d/total.png)](https://packagist.org/packages/mediawiki/lingo)
-[![Dependency 
Status](https://www.versioneye.com/php/mediawiki:lingo/badge.png)](https://www.versioneye.com/php/mediawiki:lingo)
 
 Lingo is a glossary extension to MediaWiki, that lets you define abbreviations
 and their definitions on a wiki page. It displays these definitions whenever an
diff --git a/build/travis/script.sh b/build/travis/script.sh
index 4612753..617264c 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -42,11 +42,7 @@
 
cd mw
 
-   ## MW 1.25+ installs packages using composer
-   if [ -f composer.json ]
-   then
-   composer install --prefer-source
-   fi
+   composer install --prefer-source
 
mysql -e 'create database its_a_mw;'
php maintenance/install.php --dbtype $DBTYPE --dbuser root --dbname 
its_a_mw --dbpath $(pwd) --pass nyan TravisWiki admin
@@ -54,14 +50,7 @@
 
 function installExtensionViaComposerOnMediaWikiRoot {
 
-   if [ ! -f composer.json ]
-   then
-   composer init
-   fi
-
-   composer remove --dev --update-with-dependencies 'phpunit/phpunit'
-   composer require 'composer/installers=>1.0.12'
-   composer require 'phpunit/phpunit=~4.0' 'mediawiki/lingo=@dev' 
--prefer-source
+   composer require --prefer-source --dev --update-with-dependencies 
'phpunit/phpunit=~4.0' 'mediawiki/lingo=@dev'
 
cd extensions/Lingo
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifab7c71fb9be47bcb31015aa72c539a699eefeb5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Travis setup improvements; documentation - change (mediawiki...Lingo)

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

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

Change subject: Travis setup improvements; documentation
..

Travis setup improvements; documentation

Change-Id: Ifab7c71fb9be47bcb31015aa72c539a699eefeb5
---
M .travis.yml
M README.md
M build/travis/script.sh
3 files changed, 10 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/99/275199/1

diff --git a/.travis.yml b/.travis.yml
index c89d7ef..b40ba4e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,16 +24,15 @@
 #
 
 language: php
-#sudo: false
 
 matrix:
   include:
 - env: DBTYPE=mysql; MW=master
   php: 5.6
-#- env: DBTYPE=postgres; MW=master
-#  php: 5.5
-#- env: DBTYPE=sqlite; MW=1.25.5
-#  php: 5.3
+- env: DBTYPE=postgres; MW=master
+  php: 5.5
+- env: DBTYPE=sqlite; MW=1.26.0
+  php: 5.3
 
 script:
 - bash ./build/travis/script.sh
diff --git a/README.md b/README.md
index 3d79669..ea5f97a 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,10 @@
 # Lingo
+[![Build 
Status](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/build.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/build-status/master)
+[![Code 
Coverage](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
+[![Scrutinizer Code 
Quality](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-Lingo/?branch=master)
+[![Dependency 
Status](https://www.versioneye.com/php/mediawiki:lingo/badge.png)](https://www.versioneye.com/php/mediawiki:lingo)
 [![Latest Stable 
Version](https://poser.pugx.org/mediawiki/lingo/version.png)](https://packagist.org/packages/mediawiki/lingo)
 [![Packagist download 
count](https://poser.pugx.org/mediawiki/lingo/d/total.png)](https://packagist.org/packages/mediawiki/lingo)
-[![Dependency 
Status](https://www.versioneye.com/php/mediawiki:lingo/badge.png)](https://www.versioneye.com/php/mediawiki:lingo)
 
 Lingo is a glossary extension to MediaWiki, that lets you define abbreviations
 and their definitions on a wiki page. It displays these definitions whenever an
diff --git a/build/travis/script.sh b/build/travis/script.sh
index 4612753..617264c 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -42,11 +42,7 @@
 
cd mw
 
-   ## MW 1.25+ installs packages using composer
-   if [ -f composer.json ]
-   then
-   composer install --prefer-source
-   fi
+   composer install --prefer-source
 
mysql -e 'create database its_a_mw;'
php maintenance/install.php --dbtype $DBTYPE --dbuser root --dbname 
its_a_mw --dbpath $(pwd) --pass nyan TravisWiki admin
@@ -54,14 +50,7 @@
 
 function installExtensionViaComposerOnMediaWikiRoot {
 
-   if [ ! -f composer.json ]
-   then
-   composer init
-   fi
-
-   composer remove --dev --update-with-dependencies 'phpunit/phpunit'
-   composer require 'composer/installers=>1.0.12'
-   composer require 'phpunit/phpunit=~4.0' 'mediawiki/lingo=@dev' 
--prefer-source
+   composer require --prefer-source --dev --update-with-dependencies 
'phpunit/phpunit=~4.0' 'mediawiki/lingo=@dev'
 
cd extensions/Lingo
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifab7c71fb9be47bcb31015aa72c539a699eefeb5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Travis - change (mediawiki...Lingo)

2016-03-05 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Travis
..


Travis

Change-Id: I0f73bd3fa84f24677809f0c7af780cfc174b
---
M build/travis/script.sh
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/build/travis/script.sh b/build/travis/script.sh
index 9ef275a..4612753 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -94,7 +94,7 @@
 
 function uploadCoverageReport {
wget https://scrutinizer-ci.com/ocular.phar
-   php ocular.phar code-coverage:upload 
--repository='g/wikimedia/mediawiki-lingo' --format=php-clover coverage.clover
+   php ocular.phar code-coverage:upload 
--repository='g/wikimedia/mediawiki-extensions-lingo' --format=php-clover 
coverage.clover
 }
 
 composer self-update

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0f73bd3fa84f24677809f0c7af780cfc174b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Travis - change (mediawiki...Lingo)

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

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

Change subject: Travis
..

Travis

Change-Id: I0f73bd3fa84f24677809f0c7af780cfc174b
---
M build/travis/script.sh
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/build/travis/script.sh b/build/travis/script.sh
index 9ef275a..4612753 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -94,7 +94,7 @@
 
 function uploadCoverageReport {
wget https://scrutinizer-ci.com/ocular.phar
-   php ocular.phar code-coverage:upload 
--repository='g/wikimedia/mediawiki-lingo' --format=php-clover coverage.clover
+   php ocular.phar code-coverage:upload 
--repository='g/wikimedia/mediawiki-extensions-lingo' --format=php-clover 
coverage.clover
 }
 
 composer self-update

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f73bd3fa84f24677809f0c7af780cfc174b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Travis - change (mediawiki...Lingo)

2016-03-05 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Travis
..


Travis

Change-Id: I99c2832ee4eb16a69cc9507b142237763666588e
---
M build/travis/script.sh
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/build/travis/script.sh b/build/travis/script.sh
index 253314d..9ef275a 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -60,7 +60,7 @@
fi
 
composer remove --dev --update-with-dependencies 'phpunit/phpunit'
-   composer require 'composer/installer=>1.0.12'
+   composer require 'composer/installers=>1.0.12'
composer require 'phpunit/phpunit=~4.0' 'mediawiki/lingo=@dev' 
--prefer-source
 
cd extensions/Lingo

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I99c2832ee4eb16a69cc9507b142237763666588e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Travis - change (mediawiki...Lingo)

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

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

Change subject: Travis
..

Travis

Change-Id: I99c2832ee4eb16a69cc9507b142237763666588e
---
M build/travis/script.sh
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/91/275191/1

diff --git a/build/travis/script.sh b/build/travis/script.sh
index 253314d..9ef275a 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -60,7 +60,7 @@
fi
 
composer remove --dev --update-with-dependencies 'phpunit/phpunit'
-   composer require 'composer/installer=>1.0.12'
+   composer require 'composer/installers=>1.0.12'
composer require 'phpunit/phpunit=~4.0' 'mediawiki/lingo=@dev' 
--prefer-source
 
cd extensions/Lingo

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I99c2832ee4eb16a69cc9507b142237763666588e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Travis - change (mediawiki...Lingo)

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

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

Change subject: Travis
..

Travis

Change-Id: I8166b5e0d759caec3c6a899ad487fa15fce560df
---
M build/travis/script.sh
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/89/275189/1

diff --git a/build/travis/script.sh b/build/travis/script.sh
index 1ddb087..253314d 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -60,6 +60,7 @@
fi
 
composer remove --dev --update-with-dependencies 'phpunit/phpunit'
+   composer require 'composer/installer=>1.0.12'
composer require 'phpunit/phpunit=~4.0' 'mediawiki/lingo=@dev' 
--prefer-source
 
cd extensions/Lingo

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8166b5e0d759caec3c6a899ad487fa15fce560df
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Travis - change (mediawiki...Lingo)

2016-03-05 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Travis
..


Travis

Change-Id: I8166b5e0d759caec3c6a899ad487fa15fce560df
---
M build/travis/script.sh
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/build/travis/script.sh b/build/travis/script.sh
index 1ddb087..253314d 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -60,6 +60,7 @@
fi
 
composer remove --dev --update-with-dependencies 'phpunit/phpunit'
+   composer require 'composer/installer=>1.0.12'
composer require 'phpunit/phpunit=~4.0' 'mediawiki/lingo=@dev' 
--prefer-source
 
cd extensions/Lingo

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8166b5e0d759caec3c6a899ad487fa15fce560df
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Add wfLoadExtension to test install script - change (mediawiki...Lingo)

2016-03-05 Thread Foxtrott (Code Review)
Foxtrott has submitted this change and it was merged.

Change subject: Add wfLoadExtension to test install script
..


Add wfLoadExtension to test install script

Change-Id: I5fd771b64f548a5b0c196dfcdbbaf5326c98b1d8
---
M .travis.yml
M build/travis/script.sh
M composer.json
3 files changed, 8 insertions(+), 9 deletions(-)

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



diff --git a/.travis.yml b/.travis.yml
index 6c96c31..c89d7ef 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,16 +24,16 @@
 #
 
 language: php
-sudo: false
+#sudo: false
 
 matrix:
   include:
 - env: DBTYPE=mysql; MW=master
   php: 5.6
-- env: DBTYPE=postgres; MW=master
-  php: 5.4
-- env: DBTYPE=sqlite; MW=1.25.5
-  php: 5.3
+#- env: DBTYPE=postgres; MW=master
+#  php: 5.5
+#- env: DBTYPE=sqlite; MW=1.25.5
+#  php: 5.3
 
 script:
 - bash ./build/travis/script.sh
diff --git a/build/travis/script.sh b/build/travis/script.sh
index 95af129..1ddb087 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -59,11 +59,8 @@
composer init
fi
 
-#  composer remove --dev --update-with-dependencies 'phpunit/phpunit'
+   composer remove --dev --update-with-dependencies 'phpunit/phpunit'
composer require 'phpunit/phpunit=~4.0' 'mediawiki/lingo=@dev' 
--prefer-source
-
-   pwd
-   ls -al
 
cd extensions/Lingo
 
@@ -89,6 +86,7 @@
echo '$wgShowExceptionDetails = true;' >> LocalSettings.php
echo '$wgDevelopmentWarnings = true;' >> LocalSettings.php
echo "putenv( 'MW_INSTALL_PATH=$(pwd)' );" >> LocalSettings.php
+   echo "wfLoadExtension('Lingo');" >> LocalSettings.php
 
php maintenance/update.php --quick
 }
diff --git a/composer.json b/composer.json
index 40a3388..cdc8c2a 100644
--- a/composer.json
+++ b/composer.json
@@ -28,6 +28,7 @@
"require": {
"php": ">=5.3.2",
"ext-dom": "*",
+   "composer/installers": ">1.0.12",
"justinrainbow/json-schema": "~1.0"
},
"suggest": {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5fd771b64f548a5b0c196dfcdbbaf5326c98b1d8
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 
Gerrit-Reviewer: Foxtrott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] null change to trigger travis - change (mediawiki...Lingo)

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

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

Change subject: null change to trigger travis
..

null change to trigger travis

Change-Id: I2a72b8f25c2276c7c48413c5cf4bfed16124803b
---
M build/travis/script.sh
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/87/275187/1

diff --git a/build/travis/script.sh b/build/travis/script.sh
index 95af129..5297c3f 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -67,6 +67,7 @@
 
cd extensions/Lingo
 
+
# Pull request number, "false" if it's not a pull request
if [ "$TRAVIS_PULL_REQUEST" != "false" ]
then

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a72b8f25c2276c7c48413c5cf4bfed16124803b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


[MediaWiki-commits] [Gerrit] Add wfLoadExtension to test install script - change (mediawiki...Lingo)

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

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

Change subject: Add wfLoadExtension to test install script
..

Add wfLoadExtension to test install script

Change-Id: I5fd771b64f548a5b0c196dfcdbbaf5326c98b1d8
---
M .travis.yml
M build/travis/script.sh
M composer.json
3 files changed, 8 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/88/275188/1

diff --git a/.travis.yml b/.travis.yml
index 6c96c31..c89d7ef 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,16 +24,16 @@
 #
 
 language: php
-sudo: false
+#sudo: false
 
 matrix:
   include:
 - env: DBTYPE=mysql; MW=master
   php: 5.6
-- env: DBTYPE=postgres; MW=master
-  php: 5.4
-- env: DBTYPE=sqlite; MW=1.25.5
-  php: 5.3
+#- env: DBTYPE=postgres; MW=master
+#  php: 5.5
+#- env: DBTYPE=sqlite; MW=1.25.5
+#  php: 5.3
 
 script:
 - bash ./build/travis/script.sh
diff --git a/build/travis/script.sh b/build/travis/script.sh
index 5297c3f..1ddb087 100755
--- a/build/travis/script.sh
+++ b/build/travis/script.sh
@@ -59,14 +59,10 @@
composer init
fi
 
-#  composer remove --dev --update-with-dependencies 'phpunit/phpunit'
+   composer remove --dev --update-with-dependencies 'phpunit/phpunit'
composer require 'phpunit/phpunit=~4.0' 'mediawiki/lingo=@dev' 
--prefer-source
 
-   pwd
-   ls -al
-
cd extensions/Lingo
-
 
# Pull request number, "false" if it's not a pull request
if [ "$TRAVIS_PULL_REQUEST" != "false" ]
@@ -90,6 +86,7 @@
echo '$wgShowExceptionDetails = true;' >> LocalSettings.php
echo '$wgDevelopmentWarnings = true;' >> LocalSettings.php
echo "putenv( 'MW_INSTALL_PATH=$(pwd)' );" >> LocalSettings.php
+   echo "wfLoadExtension('Lingo');" >> LocalSettings.php
 
php maintenance/update.php --quick
 }
diff --git a/composer.json b/composer.json
index 40a3388..cdc8c2a 100644
--- a/composer.json
+++ b/composer.json
@@ -28,6 +28,7 @@
"require": {
"php": ">=5.3.2",
"ext-dom": "*",
+   "composer/installers": ">1.0.12",
"justinrainbow/json-schema": "~1.0"
},
"suggest": {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5fd771b64f548a5b0c196dfcdbbaf5326c98b1d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott 

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


  1   2   3   4   5   6   7   8   >