[MediaWiki-commits] [Gerrit] Rewrite wmf_civicrm_get_civi_id to use new apis - change (wikimedia...crm)

2014-05-17 Thread Adamw (Code Review)
Adamw has uploaded a new change for review.

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

Change subject: Rewrite wmf_civicrm_get_civi_id to use new apis
..

Rewrite wmf_civicrm_get_civi_id to use new apis

Change-Id: I7aa6f7dfcaf4e13ca48dd46ce4910d95e35cd2f2
---
A sites/all/modules/wmf_civicrm/tests/phpunit/WmfCivicrmTest.php
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
2 files changed, 55 insertions(+), 42 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/83/133883/1

diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/WmfCivicrmTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/WmfCivicrmTest.php
new file mode 100644
index 000..d3e7866
--- /dev/null
+++ b/sites/all/modules/wmf_civicrm/tests/phpunit/WmfCivicrmTest.php
@@ -0,0 +1,25 @@
+?php
+
+class WmfCivicrmTest extends BaseWmfDrupalPhpUnitTestCase {
+public static function getInfo() {
+return array(
+'name' = 'Wmf CiviCRM module tests',
+'group' = 'Pipeline',
+'description' = 'wmf_civicrm module utilities get a workout',
+);
+}
+
+public function testGetCiviId() {
+$id = wmf_civicrm_get_civi_id( 'contribution_type_id', 'Donation' );
+$this-assertTrue( is_numeric( $id ) );
+$this-assertTrue( $id  0 );
+
+$id = wmf_civicrm_get_civi_id( 'payment_instrument_id', 'Credit Card' 
);
+$this-assertTrue( is_numeric( $id ) );
+$this-assertTrue( $id  0 );
+
+$id = wmf_civicrm_get_civi_id( 'tag_id', 'Review' );
+$this-assertTrue( is_numeric( $id ) );
+$this-assertTrue( $id  0 );
+}
+}
diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 94261dc..3e3e6fd 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -207,7 +207,7 @@
 
 // Tag contact for review
 try {
-$tag = wmf_civicrm_tag_contact_for_review( $contact );
+wmf_civicrm_tag_contact_for_review( $contact );
 } catch (WmfException $ex) {
 // XXX copying old logic, continues without a review tag
 }
@@ -352,11 +352,10 @@
 }
 
 /**
- * @fixme TODO: make the v3 API calls use the wrapper function
  *
  * @param $type
  * @param $name
- * @return bool
+ * @return integer
  */
 function wmf_civicrm_get_civi_id($type, $name)
 {
@@ -368,55 +367,44 @@
 return $civi_ids[$type][$name];
 }
 
+$api = civicrm_api_classapi();
+
 switch ($type) {
 case 'contribution_type_id':
-//fixme: This is probably the upside-down way to do it. Really 
ought to go through the API.
-//
-$result = CRM_Contribute_BAO_ContributionType::retrieve($params, 
$dummy);
-if (!is_null($result)){
-$civi_ids[$type][$name] = $result-id;
-watchdog('wmf_civicrm', Found id for contribution_type $name: 
 . $civi_ids[$type][$name]);
-} else {
-//make it. Or, throw an error here. Either way.
-//XXX nonono
-watchdog('wmf_civicrm', Id for contribution_type $name not 
found. Creating...);
-$params['description'] = '';
-$params['accounting_code'] = strtoupper($name);
-$params['is_deductible'] = 1;
-$params['is_active'] = 1;
-$result = CRM_Contribute_BAO_ContributionType::add($params, 
$dummy);
-$civi_ids[$type][$name] = $result-id;
-watchdog('wmf_civicrm', New id for contribution_type $name : 
. $civi_ids[$type][$name]);
-}
-$id = $civi_ids[$type][$name];
-if (empty($id)) {
+$success = $api-FinancialType-get( array(
+'name' = $name,
+) );
+if ( !$success ) {
 throw new WmfException( CIVI_CONFIG,
 t( 'Contribution Type !name not found!', array( '!name' 
= $name ) )
 );
 }
-return $id;
+$civi_ids[$type][$name] = $api-values[0]-id;
+watchdog('wmf_civicrm', Found ID for contribution_type $name:  . 
$civi_ids[$type][$name]);
+return $civi_ids[$type][$name];
 case 'payment_instrument_id':
-require_once 'api/v3/OptionValue.php';
-$group_id = civicrm_api3_option_value_get(
-array('option_group_name' = 'payment_instrument', 'label'= 
$name, 'version' = '3'));
-if($group_id['count'] == 1){
-$civi_ids[$type][$name] = 
$group_id['values'][strval($group_id['id'])]['value'];
-watchdog('wmf_civicrm', Found value for payment_instrument 
$name : . $civi_ids[$type][$name]);
-return $civi_ids[$type][$name];
-} else {
-throw new 

[MediaWiki-commits] [Gerrit] Add qtip-shadow class - change (mediawiki...Lingo)

2014-05-17 Thread Mwjames (Code Review)
Mwjames has uploaded a new change for review.

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

Change subject: Add qtip-shadow class
..

Add qtip-shadow class

This allows that when switching to v2.2 (for SMW and be used by SG [0] ) the
shadows persists.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/315

Change-Id: Ia002f2c0144d4d884f453b7351e954e8dcc1183b
---
M libs/Lingo.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/libs/Lingo.js b/libs/Lingo.js
index cd42474..e281509 100644
--- a/libs/Lingo.js
+++ b/libs/Lingo.js
@@ -28,7 +28,7 @@
delay: 300
},
style   : {
-   classes: tooltip.attr( 'class' ),
+   classes: tooltip.attr( 'class' ) + ' 
qtip-shadow',
def: false
}
 

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

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

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


[MediaWiki-commits] [Gerrit] bump submodule to unpatched Civi 4.4 - change (wikimedia...crm)

2014-05-17 Thread Adamw (Code Review)
Adamw has uploaded a new change for review.

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

Change subject: bump submodule to unpatched Civi 4.4
..

bump submodule to unpatched Civi 4.4

Change-Id: I06d9c01701afa7da009af03c96a6ca7a2bad735a
---
M civicrm
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/82/133882/1

diff --git a/civicrm b/civicrm
index d800ac3..68e94c7 16
--- a/civicrm
+++ b/civicrm
-Subproject commit d800ac383a885270928109670aee9586b2fa3795
+Subproject commit 68e94c784799a95d563e7ca6d5cf8c8791a92aab

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I06d9c01701afa7da009af03c96a6ca7a2bad735a
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: civi-4.4
Gerrit-Owner: Adamw awi...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] update bootstrap.inc to use new API - change (wikimedia...crm)

2014-05-17 Thread Adamw (Code Review)
Adamw has uploaded a new change for review.

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

Change subject: update bootstrap.inc to use new API
..

update bootstrap.inc to use new API

Change-Id: Id26fc65183de3ee6c3985100fbaf2c2bedb8fab8
---
M sites/all/modules/wmf_civicrm/bootstrap.inc
A sites/all/modules/wmf_civicrm/tests/phpunit/BootstrapTest.php
2 files changed, 45 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/84/133884/1

diff --git a/sites/all/modules/wmf_civicrm/bootstrap.inc 
b/sites/all/modules/wmf_civicrm/bootstrap.inc
index 9802178..e28fe4a 100644
--- a/sites/all/modules/wmf_civicrm/bootstrap.inc
+++ b/sites/all/modules/wmf_civicrm/bootstrap.inc
@@ -31,23 +31,27 @@
 
 function wmf_civicrm_create_contribution_types($contribution_types)
 {
+$api = wmf_civicrm_bootstrap_civi();
+
 foreach ($contribution_types as $type)
 {
-$contribution_type_id = CRM_Utils_Array::key(
-$type,
-CRM_Contribute_PseudoConstant::contributionType()
-);
-
-if (!$contribution_type_id)
+$success = $api-FinancialType-get( array(
+'name' = $type,
+) );
+if ( !$success ) {
+throw new Exception( Failed to use the Civi API: 
{$api-errorMsg()} );
+}
+if ( !$api-values )
 {
-$params = array(
+$success = $api-FinancialType-create( array(
+'name' = $type,
 'is_active' = 1,
 'is_deductible' = 1,
 'accounting_code' = strtoupper($type),
-'name' = $type,
-);
-$ids = array();
-CRM_Contribute_BAO_ContributionType::add($params, $ids);
+) );
+if ( !$success ) {
+throw new Exception( Failed to create new contribution type: 
{$api-errorMsg()} );
+}
 }
 }
 }
diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/BootstrapTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/BootstrapTest.php
new file mode 100644
index 000..61a7052
--- /dev/null
+++ b/sites/all/modules/wmf_civicrm/tests/phpunit/BootstrapTest.php
@@ -0,0 +1,30 @@
+?php
+
+class BootstrapTest extends BaseWmfDrupalPhpUnitTestCase {
+public static function getInfo() {
+return array(
+'name' = 'Wmf CiviCRM bootstrap tests',
+'group' = 'Pipeline',
+'description' = 'Test utilities used during installation and 
migration',
+);
+}
+
+public function setUp() {
+parent::setUp();
+
+civicrm_initialize();
+require_once __DIR__ . '/../../bootstrap.inc';
+}
+
+public function testCreateContributionTypes() {
+$types = array(
+'Test type' . mt_rand(),
+'Test type' . mt_rand(),
+);
+
+wmf_civicrm_create_contribution_types( $types );
+
+$this-assertNotNull( wmf_civicrm_get_civi_id( 'contribution_type_id', 
$types[0] ) );
+$this-assertNotNull( wmf_civicrm_get_civi_id( 'contribution_type_id', 
$types[1] ) );
+}
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id26fc65183de3ee6c3985100fbaf2c2bedb8fab8
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: civi-4.4
Gerrit-Owner: Adamw awi...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] backport Financial* APIs from 4.5 - change (wikimedia...civicrm)

2014-05-17 Thread Adamw (Code Review)
Adamw has uploaded a new change for review.

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

Change subject: backport Financial* APIs from 4.5
..

backport Financial* APIs from 4.5

Change-Id: Idb6d86c08a5f1a34936bd21dec1b6b350f10da09
---
A api/v3/FinancialAccount.php
A api/v3/FinancialType.php
2 files changed, 154 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/85/133885/1

diff --git a/api/v3/FinancialAccount.php b/api/v3/FinancialAccount.php
new file mode 100644
index 000..42e8219
--- /dev/null
+++ b/api/v3/FinancialAccount.php
@@ -0,0 +1,77 @@
+?php
+
+/*
+ ++
+ | CiviCRM version 4.5|
+ ++
+ | Copyright CiviCRM LLC (c) 2004-2014|
+ ++
+ | This file is a part of CiviCRM.|
+ ||
+ | CiviCRM is free software; you can copy, modify, and distribute it  |
+ | under the terms of the GNU Affero General Public License   |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
+ ||
+ | CiviCRM 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 Affero General Public License for more details.|
+ ||
+ | You should have received a copy of the GNU Affero General Public   |
+ | License and the CiviCRM Licensing Exception along  |
+ | with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the|
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing|
+ ++
+*/
+
+/**
+ * File for the CiviCRM APIv3 financial_account functions
+ *
+ * @package CiviCRM_APIv3
+ * @subpackage API_financial_account
+ *
+ */
+
+/**
+ * Save a financial_account
+ *
+ * Allowed @params array keys are:
+ * {@getfields financial_account_create}
+ * @example financial_accountCreate.php
+ *
+ * @return array of newly created financial_account property values.
+ * @access public
+ */
+function civicrm_api3_financial_account_create($params) {
+  return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), 
$params);
+}
+
+/**
+ * Get a financial_account
+ *
+ * Allowed @params array keys are:
+ * {@getfields financial_account_get}
+ * @example financial_accountCreate.php
+ *
+ * @return array of retrieved financial_account property values.
+ * @access public
+ */
+function civicrm_api3_financial_account_get($params) {
+  return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+}
+
+/**
+ * Delete a financial_account
+ *
+ * Allowed @params array keys are:
+ * {@getfields financial_account_delete}
+ * @example financial_accountCreate.php
+ *
+ * @return array of deleted values.
+ * @access public
+ */
+function civicrm_api3_financial_account_delete($params) {
+  return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), 
$params);
+}
diff --git a/api/v3/FinancialType.php b/api/v3/FinancialType.php
new file mode 100644
index 000..9afe0ab
--- /dev/null
+++ b/api/v3/FinancialType.php
@@ -0,0 +1,77 @@
+?php
+
+/*
+ ++
+ | CiviCRM version 4.5|
+ ++
+ | Copyright CiviCRM LLC (c) 2004-2014|
+ ++
+ | This file is a part of CiviCRM.|
+ ||
+ | CiviCRM is free software; you can copy, modify, and distribute it  |
+ | under the terms of the GNU Affero General Public License   |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
+ ||
+ | CiviCRM 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 Affero General Public License for more details.|
+ |  

[MediaWiki-commits] [Gerrit] Kill GeoData Solr, decom servers - change (operations/puppet)

2014-05-17 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review.

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

Change subject: Kill GeoData Solr, decom servers
..

Kill GeoData Solr, decom servers

Change-Id: I3b82b7c5f884df04c9c74c6fb7ab5952c11f2b6b
---
M manifests/misc/maintenance.pp
M manifests/role/solr.pp
M manifests/site.pp
M modules/install-server/files/autoinstall/netboot.cfg
M modules/install-server/files/dhcpd/linux-host-entries.ttyS1-115200
D modules/solr/files/schema-geodata.xml
D templates/misc/clear-killlist.erb
D templates/misc/update-geodata.erb
8 files changed, 12 insertions(+), 400 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/86/133886/1

diff --git a/manifests/misc/maintenance.pp b/manifests/misc/maintenance.pp
index d7fee56..1fc0b2e 100644
--- a/manifests/misc/maintenance.pp
+++ b/manifests/misc/maintenance.pp
@@ -292,11 +292,19 @@
 class misc::maintenance::geodata( $enabled = false ) {
 file {
 '/usr/local/bin/update-geodata':
-ensure  = present,
+ensure  = $enabled ?{
+true= present,
+false   = absent,
+default = absent
+};
 content = template( 'misc/update-geodata.erb' ),
 mode= '0555';
 '/usr/local/bin/clear-killlist':
-ensure  = present,
+ensure  = $enabled ?{
+true= present,
+false   = absent,
+default = absent
+};
 content = template( 'misc/clear-killlist.erb' ),
 mode= '0555';
 }
diff --git a/manifests/role/solr.pp b/manifests/role/solr.pp
index f149227..3749c68 100644
--- a/manifests/role/solr.pp
+++ b/manifests/role/solr.pp
@@ -45,22 +45,3 @@
max_heap = 1G,
}
 }
-
-class role::solr::geodata($replication_master = 'solr1001.eqiad.wmnet', 
$max_heap = undef) {
-   system::role { solr-geodata: description = Solr server for GeoData 
}
-
-   include standard
-
-   class { role::solr:
-   schema = puppet:///modules/solr/schema-geodata.xml,
-   replication_master = $replication_master,
-   max_heap = $max_heap,
-   }
-}
-
-class role::solr::geodata::labs {
-   class { role::solr::geodata:
-   replication_master = undef,
-   max_heap = 256M,
-   }
-}
\ No newline at end of file
diff --git a/manifests/site.pp b/manifests/site.pp
index 71e96e0..e3e88c6 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2494,7 +2494,7 @@
 enabled = true,
 }
 class { 'misc::maintenance::geodata':
-enabled = true,
+enabled = false,
 }
 class { 'misc::maintenance::update_flaggedrev_stats':
 enabled = true,
@@ -2765,11 +2765,6 @@
 class { 'lvs::realserver':
 realserver_ips = ['10.2.2.28'],
 }
-}
-
-node /^solr100[1-3]\.eqiad\.wmnet/ {
-include standard
-include role::solr::geodata
 }
 
 node 'ytterbium.wikimedia.org' {
diff --git a/modules/install-server/files/autoinstall/netboot.cfg 
b/modules/install-server/files/autoinstall/netboot.cfg
index c08cb3d..7d28b5c 100755
--- a/modules/install-server/files/autoinstall/netboot.cfg
+++ b/modules/install-server/files/autoinstall/netboot.cfg
@@ -76,7 +76,7 @@
snapshot[1-4]|snapshot100[1-4]) echo partman/snapshot.cfg ;; \
stat1002) echo partman/lvm-noraid-large.a.cfg ;; \

argon|bast4001|cerium|copper|iridium|neon|praseodymium|ruthenium|ssl[1-3]0[0-9][0-9]|ssl[0-9]|titanium|ytterbium|xenon|zirconium)
 echo partman/raid1-lvm.cfg ;; \
-   solr100[1-3]) echo partman/lvm.cfg ;; \
+   ) echo partman/lvm.cfg ;; \
virt[5-9]|virt1[0-1]) echo partman/virt-raid10-cisco.cfg ;; \
virt100[1-9]) echo partman/virt-raid10-cisco.cfg ;; \
labnet1001) echo partman/lvm.cfg ;; \
diff --git a/modules/install-server/files/dhcpd/linux-host-entries.ttyS1-115200 
b/modules/install-server/files/dhcpd/linux-host-entries.ttyS1-115200
index 64dcfb2..fa23607 100644
--- a/modules/install-server/files/dhcpd/linux-host-entries.ttyS1-115200
+++ b/modules/install-server/files/dhcpd/linux-host-entries.ttyS1-115200
@@ -3055,21 +3055,6 @@
fixed-address sodium.wikimedia.org;
 }
 
-host solr1001 {
-   hardware ethernet 90:B1:1C:23:23:BF;
-   fixed-address solr1001.eqiad.wmnet;
-}
-
-host solr1002 {
-   hardware ethernet 90:B1:1C:1D:E7:E5;
-   fixed-address solr1002.eqiad.wmnet;
-}
-
-host solr1003 {
-   hardware ethernet 90:B1:1C:23:36:1D;
-   fixed-address solr1003.eqiad.wmnet;
-}
-
 host ssl1001 {
hardware ethernet 78:2b:cb:09:10:91;
fixed-address ssl1001.wikimedia.org;
diff --git a/modules/solr/files/schema-geodata.xml 
b/modules/solr/files/schema-geodata.xml
deleted file mode 100644
index f221817..000
--- 

[MediaWiki-commits] [Gerrit] TypesafeEnum PHPDoc: better explanation of final - change (mediawiki...Campaigns)

2014-05-17 Thread Adamw (Code Review)
Adamw has submitted this change and it was merged.

Change subject: TypesafeEnum PHPDoc: better explanation of final
..


TypesafeEnum PHPDoc: better explanation of final

Change-Id: I4af101c0b223b5892ed8495a387a9c7907185776
---
M includes/TypesafeEnum.php
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/includes/TypesafeEnum.php b/includes/TypesafeEnum.php
index d26c5a9..e4447de 100644
--- a/includes/TypesafeEnum.php
+++ b/includes/TypesafeEnum.php
@@ -8,8 +8,9 @@
 
 /**
  * To create some typesafe enums, just extend this class, declare some public
- * static properties without setting thier values, then call
- * YourClass::setUp(). Also, make your subclass final.
+ * static properties without setting their values, then call 
YourClass::setUp().
+ * If you want to prevent additional enums of the same type from being created,
+ * you can make your subclass final.
  * @see ITypesafeEnum
  */
 abstract class TypesafeEnum implements ITypesafeEnum {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4af101c0b223b5892ed8495a387a9c7907185776
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Campaigns
Gerrit-Branch: wip/editorcampaigns
Gerrit-Owner: AndyRussG andrew.green...@gmail.com
Gerrit-Reviewer: Adamw awi...@wikimedia.org
Gerrit-Reviewer: Ragesoss rages...@gmail.com
Gerrit-Reviewer: Swalling swall...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add tests of typical constructs for TypesafeEnum - change (mediawiki...Campaigns)

2014-05-17 Thread Adamw (Code Review)
Adamw has submitted this change and it was merged.

Change subject: Add tests of typical constructs for TypesafeEnum
..


Add tests of typical constructs for TypesafeEnum

Change-Id: Id35233b2c360f071fe8281fdd8155b6071789540
---
M tests/phpunit/TypesafeEnumTest.php
1 file changed, 55 insertions(+), 0 deletions(-)

Approvals:
  Adamw: Looks good to me, approved



diff --git a/tests/phpunit/TypesafeEnumTest.php 
b/tests/phpunit/TypesafeEnumTest.php
index d980538..e155ca7 100644
--- a/tests/phpunit/TypesafeEnumTest.php
+++ b/tests/phpunit/TypesafeEnumTest.php
@@ -36,6 +36,61 @@
AnotherTestEnum::$ENUM_THREE );
}
 
+   public function testSwitchOnEnum() {
+
+   $enums = array(
+   TestEnum::$ENUM_ONE,
+   TestEnum::$ENUM_TWO,
+   TestEnum::$ENUM_THREE
+   );
+
+   foreach ( $enums as $e ) {
+
+   switch ( $e ) {
+
+   case TestEnum::$ENUM_ONE:
+   $this-assertSame( TestEnum::$ENUM_ONE, 
$e );
+   break;
+
+   case TestEnum::$ENUM_TWO:
+   $this-assertSame( TestEnum::$ENUM_TWO, 
$e );
+   break;
+
+   case TestEnum::$ENUM_THREE:
+   $this-assertSame( 
TestEnum::$ENUM_THREE, $e );
+   break;
+
+   default:
+   $this-fail( 'Enum ' . $e . ' didn\'t 
follow the right path'
+   . ' in switch.');
+   }
+   }
+   }
+
+   public function testInArrayWithEnums() {
+
+   $enums = array(
+   TestEnum::$ENUM_ONE,
+   TestEnum::$ENUM_TWO
+   );
+
+   $this-assertTrue( in_array( TestEnum::$ENUM_ONE, $enums ) );
+   $this-assertTrue( in_array( TestEnum::$ENUM_TWO, $enums ) );
+   $this-assertFalse( in_array( TestEnum::$ENUM_THREE, $enums ) );
+   }
+
+   public function testArraySearchWithEnums() {
+
+   $enums = array(
+   TestEnum::$ENUM_ONE,
+   TestEnum::$ENUM_TWO
+   );
+
+   $this-assertEquals( 0, array_search( TestEnum::$ENUM_ONE, 
$enums ) );
+   $this-assertEquals( 1, array_search( TestEnum::$ENUM_TWO, 
$enums ) );
+   $this-assertFalse( array_search( TestEnum::$ENUM_THREE, $enums 
) );
+   }
+
public function testToStringReturnsEnumName() {
 
$this-assertEquals( 'ENUM_ONE', 
TestEnum::$ENUM_ONE-__toString() );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id35233b2c360f071fe8281fdd8155b6071789540
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Campaigns
Gerrit-Branch: wip/editorcampaigns
Gerrit-Owner: AndyRussG andrew.green...@gmail.com
Gerrit-Reviewer: Adamw awi...@wikimedia.org
Gerrit-Reviewer: Ragesoss rages...@gmail.com
Gerrit-Reviewer: Swalling swall...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Make singleton the default scope for DI - change (mediawiki...Campaigns)

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

Change subject: Make singleton the default scope for DI
..


Make singleton the default scope for DI

Change-Id: I74fe40c0739e03d11ac047786530e8f0d24178d9
---
M Campaigns.php
M includes/setup/Setup.php
M tests/phpunit/setup/SetupTest.php
3 files changed, 67 insertions(+), 23 deletions(-)

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



diff --git a/Campaigns.php b/Campaigns.php
index 431ab9d..1d38414 100644
--- a/Campaigns.php
+++ b/Campaigns.php
@@ -100,37 +100,30 @@
 
 $wgCampaignsDI['Campaigns\Domain\ICampaignRepository'] = array(
'realization' = 'Campaigns\Domain\Internal\CampaignRepository',
-   'scope'   = 'singleton'
 );
 
 $wgCampaignsDI['Campaigns\Domain\IParticipationRepository'] = array(
'realization' = 'Campaigns\Domain\Internal\ParticipationRepository',
-   'scope'   = 'singleton'
 );
 
 $wgCampaignsDI['Campaigns\Domain\ITransactionManager'] = array(
'realization' = 'Campaigns\Domain\Internal\TransactionManager',
-   'scope'   = 'singleton'
 );
 
 $wgCampaignsDI['Campaigns\Domain\Internal\ICampaignFactory'] = array(
'realization' = 'Campaigns\Domain\Internal\CampaignFactory',
-   'scope'   = 'singleton'
 );
 
 $wgCampaignsDI['Campaigns\Domain\Internal\IParticipationFactory'] = array(
'realization' = 'Campaigns\Domain\Internal\ParticipationFactory',
-   'scope'   = 'singleton'
 );
 
 $wgCampaignsDI['Campaigns\Persistence\IPersistenceManager'] = array(
'realization' = 
'Campaigns\Persistence\Internal\Db\DBPersistenceManager',
-   'scope'   = 'singleton'
 );
 
 $wgCampaignsDI['Campaigns\Persistence\Internal\Db\IDBMapper'] = array(
'realization' = 'Campaigns\Persistence\Internal\Db\DBMapper',
-   'scope'   = 'singleton'
 );
 
 
diff --git a/includes/setup/Setup.php b/includes/setup/Setup.php
index 2e7e58c..8c5c428 100644
--- a/includes/setup/Setup.php
+++ b/includes/setup/Setup.php
@@ -62,10 +62,14 @@
 
foreach ( $GLOBALS['wgCampaignsDI'] as $key = $val ) {
 
+   // Scope is optional but this isn't the place to set its
+   // default
+   $scope = isset( $val['scope'] ) ? $val['scope'] : null;
+
$this-register(
$key,
$val['realization'],
-   $val['scope']
+   $scope
);
}
}
@@ -79,7 +83,7 @@
 * @param string $scope For now, must be 'singleton'
 * @throws MWException
 */
-   public function register( $typeName, $realizationClassName, $scope ) {
+   public function register( $typeName, $realizationClassName, $scope=null 
) {
 
// Check this type hasn't already been registered
if ( isset( $this-registrations[$typeName] ) ) {
@@ -87,6 +91,11 @@
', but it\'s already registered.' );
}
 
+   // Default scope is singleton
+   if ( is_null( $scope ) ) {
+   $scope = 'singleton';
+   }
+
// Check that the registration isn't for an unsupported scope
if ( $scope !== 'singleton' ) {
throw new MWException( 'Attempted to register type ' . 
$typeName .
diff --git a/tests/phpunit/setup/SetupTest.php 
b/tests/phpunit/setup/SetupTest.php
index 4063f96..763e391 100644
--- a/tests/phpunit/setup/SetupTest.php
+++ b/tests/phpunit/setup/SetupTest.php
@@ -29,10 +29,10 @@
'singleton'
);
 
+   // Default scope is singleton
$setup-register(
'Campaigns\PHPUnit\Setup\IClassWithAConstructorParam',
-   'Campaigns\PHPUnit\Setup\ClassWithAConstructorParam',
-   'singleton'
+   'Campaigns\PHPUnit\Setup\ClassWithAConstructorParam'
);
 
return $setup;
@@ -79,11 +79,29 @@
 
$setup = $this-getSetupWithRegisrations();
 
+   // IClassWithNoConstructor is explicitly in the singleton scope
$obj1 = $setup-get(
'Campaigns\PHPUnit\Setup\IClassWithNoConstructor' );
 
$obj2 = $setup-get(
'Campaigns\PHPUnit\Setup\IClassWithNoConstructor' );
+
+   $this-assertSame( $obj1, $obj2 );
+   }
+
+   public function testSingletonIsDefaultScope() {
+
+   $setup = $this-getSetupWithRegisrations();
+
+   // IClassWithAConstructorParam is in the default scope.
+   // Above we verified that for types in the singleton scope, the 
same
+   // instance is always 

[MediaWiki-commits] [Gerrit] DI for classes that don't implement an interface - change (mediawiki...Campaigns)

2014-05-17 Thread Adamw (Code Review)
Adamw has submitted this change and it was merged.

Change subject: DI for classes that don't implement an interface
..


DI for classes that don't implement an interface

Change-Id: I0c7195289b3aecd2c6262fae12c0ea55c2faf9c7
---
M includes/setup/Setup.php
M tests/phpunit/setup/SetupTest.php
2 files changed, 28 insertions(+), 4 deletions(-)

Approvals:
  Adamw: Looks good to me, approved



diff --git a/includes/setup/Setup.php b/includes/setup/Setup.php
index 8c5c428..cb72d66 100644
--- a/includes/setup/Setup.php
+++ b/includes/setup/Setup.php
@@ -104,10 +104,12 @@
 
$reflClass = new ReflectionClass( $realizationClassName );
 
-   // Check that the realization class is a subclass of the type
-   if ( !$reflClass-isSubClassOf( $typeName ) ) {
+   // Check that the realization class is a subclass of or the 
same as type
+   if ( !$reflClass-isSubClassOf( $typeName ) 
+   $typeName !== $realizationClassName ) {
+
throw new MWException( $realizationClassName .
-   ' is not a subclass of ' . $typeName );
+   ' is not a subclass of or the same class as ' . 
$typeName );
}
 
// If the realization class has a constructor, check that all 
the
diff --git a/tests/phpunit/setup/SetupTest.php 
b/tests/phpunit/setup/SetupTest.php
index 763e391..9c6e70e 100644
--- a/tests/phpunit/setup/SetupTest.php
+++ b/tests/phpunit/setup/SetupTest.php
@@ -29,6 +29,12 @@
'singleton'
);
 
+   $setup-register(
+   
'Campaigns\PHPUnit\Setup\ClassWhereTypeAndRealizationAreTheSame',
+   
'Campaigns\PHPUnit\Setup\ClassWhereTypeAndRealizationAreTheSame',
+   'singleton'
+   );
+
// Default scope is singleton
$setup-register(
'Campaigns\PHPUnit\Setup\IClassWithAConstructorParam',
@@ -58,6 +64,20 @@
'Campaigns\PHPUnit\Setup\IClassWithAConstructorParam' );
 
$implClassName = 
'Campaigns\PHPUnit\Setup\ClassWithAConstructorParam';
+   $this-assertInstanceOf( $implClassName, $obj );
+   }
+
+   public function
+   
testGetProvidesObjectOfCorrectClassWhenTypeAndRealizationAreTheSame() {
+
+   $setup = $this-getSetupWithRegisrations();
+
+   $obj = $setup-get(
+   
'Campaigns\PHPUnit\Setup\ClassWhereTypeAndRealizationAreTheSame' );
+
+   $implClassName =
+   
'Campaigns\PHPUnit\Setup\ClassWhereTypeAndRealizationAreTheSame';
+
$this-assertInstanceOf( $implClassName, $obj );
}
 
@@ -140,7 +160,7 @@
 * @expectedExceptionMessage is not a subclass of
 */
public function
-   
testExceptionThrownWhenImplementationClassThatIsntASubclassOfTypeIsRegistered() 
{
+   
testExceptionThrownWhenImplementationClassThatIsntASubclassOfOrTheSameAsTypeIsRegistered()
 {
 
$setup = new Setup();
 
@@ -320,6 +340,8 @@
}
 }
 
+class ClassWhereTypeAndRealizationAreTheSame { }
+
 interface IUnregisteredType { }
 
 interface IClassWithAConstructorParamOfUnregisteredType { }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c7195289b3aecd2c6262fae12c0ea55c2faf9c7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Campaigns
Gerrit-Branch: wip/editorcampaigns
Gerrit-Owner: AndyRussG andrew.green...@gmail.com
Gerrit-Reviewer: Adamw awi...@wikimedia.org
Gerrit-Reviewer: Ragesoss rages...@gmail.com
Gerrit-Reviewer: Swalling swall...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Fix a detail of TypesafeEnumTest - change (mediawiki...Campaigns)

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

Change subject: Fix a detail of TypesafeEnumTest
..


Fix a detail of TypesafeEnumTest

Removed a few lines from TypesafeEnumTest that are not pertinent for
testing the current implementation of TypesafeEnum.

Change-Id: I2ebb4f7f0195739743cfcac34af0759a3b239925
---
M tests/phpunit/TypesafeEnumTest.php
1 file changed, 0 insertions(+), 4 deletions(-)

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



diff --git a/tests/phpunit/TypesafeEnumTest.php 
b/tests/phpunit/TypesafeEnumTest.php
index d980538..ae51ae3 100644
--- a/tests/phpunit/TypesafeEnumTest.php
+++ b/tests/phpunit/TypesafeEnumTest.php
@@ -98,10 +98,6 @@
public function testIsDeclaredReturnsFalseWhenExpectedForString() {
 
$this-assertFalse( TestEnum::isDeclared( 'UNKNOWN_ENUM' ) );
-
-   // Be sure this doesn't create a false positive, since it's 
declared
-   // as a static property, but is protected.
-   $this-assertFalse( TestEnum::isDeclared( 'values' ) );
}
 
public function testGetValueByNameReturnsCorrectValue() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2ebb4f7f0195739743cfcac34af0759a3b239925
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Campaigns
Gerrit-Branch: wip/editorcampaigns
Gerrit-Owner: AndyRussG andrew.green...@gmail.com
Gerrit-Reviewer: Adamw awi...@wikimedia.org
Gerrit-Reviewer: Ragesoss rages...@gmail.com
Gerrit-Reviewer: Swalling swall...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add a hook to discover and run all tests during --testsuite... - change (mediawiki...Campaigns)

2014-05-17 Thread Adamw (Code Review)
Adamw has uploaded a new change for review.

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

Change subject: Add a hook to discover and run all tests during --testsuite 
extensions
..

Add a hook to discover and run all tests during --testsuite extensions

Change-Id: I0945ae10792dc77b00cb084ac3c2bdf386bb08e9
---
M Campaigns.hooks.php
M Campaigns.php
2 files changed, 19 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Campaigns 
refs/changes/88/133888/1

diff --git a/Campaigns.hooks.php b/Campaigns.hooks.php
index 90102c3..def41a3 100644
--- a/Campaigns.hooks.php
+++ b/Campaigns.hooks.php
@@ -3,6 +3,8 @@
 namespace Campaigns;
 
 use \DatabaseUpdater;
+use \RecursiveDirectoryIterator;
+use \RecursiveIteratorIterator;
 
 /**
  * Static methods for hooks.
@@ -133,4 +135,20 @@
 
return true;
}
+
+   /**
+* Return test suites
+*/
+   public static function onUnitTestsList( $files ) {
+   // Search for tests
+   $dirIterator = new RecursiveDirectoryIterator( __DIR__ . 
'/tests' );
+   $iterator = new RecursiveIteratorIterator( $dirIterator, 
RecursiveIteratorIterator::LEAVES_ONLY );
+   foreach ( $iterator as $path = $fileObject ) {
+   if ( fnmatch( *Test.php, $fileObject-getFilename() ) 
) {
+   $files[] = $path;
+   }
+   }
+
+   return true;
+   }
 }
diff --git a/Campaigns.php b/Campaigns.php
index 1d38414..fc29480 100644
--- a/Campaigns.php
+++ b/Campaigns.php
@@ -79,6 +79,7 @@
 $wgHooks['AddNewAccount'][] = 'Campaigns\Hooks::onAddNewAccount';
 $wgHooks['UserLoginForm'][] = 'Campaigns\Hooks::onUserLoginForm';
 $wgHooks['LoadExtensionSchemaUpdates'][] = 
'Campaigns\Hooks::onLoadExtensionSchemaUpdate';
+$wgHooks['UnitTestsList'][] = 'Campaigns\Hooks::onUnitTestsList';
 
 
 // Modules

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0945ae10792dc77b00cb084ac3c2bdf386bb08e9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Campaigns
Gerrit-Branch: wip/editorcampaigns
Gerrit-Owner: Adamw awi...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Change branch .gitreview to point to this long-lived topic b... - change (mediawiki...Campaigns)

2014-05-17 Thread Adamw (Code Review)
Adamw has uploaded a new change for review.

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

Change subject: Change branch .gitreview to point to this long-lived topic 
branch
..

Change branch .gitreview to point to this long-lived topic branch

This will cause git review to push to refs/for/wip/editorcampaigns.
Donno what will happen when you merge this topic to master, hopefully
it won't merge on top of .gitreview there.

Change-Id: I63d7739a01c1317311b2c90f5e2187f3935208f7
---
M .gitreview
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/.gitreview b/.gitreview
index 969b6d8..8eb27b9 100644
--- a/.gitreview
+++ b/.gitreview
@@ -2,5 +2,5 @@
 host=gerrit.wikimedia.org
 port=29418
 project=mediawiki/extensions/Campaigns.git
-defaultbranch=master
+defaultbranch=wip/editorcampaigns
 defaultrebase=0

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63d7739a01c1317311b2c90f5e2187f3935208f7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Campaigns
Gerrit-Branch: wip/editorcampaigns
Gerrit-Owner: Adamw awi...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Sloppy fix for mysql vs sqlite syntax - change (mediawiki...Campaigns)

2014-05-17 Thread Adamw (Code Review)
Adamw has uploaded a new change for review.

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

Change subject: Sloppy fix for mysql vs sqlite syntax
..

Sloppy fix for mysql vs sqlite syntax

Change-Id: I6c770c6becd3e24d8d0b653ceab0f912baca7653
---
M tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php
1 file changed, 6 insertions(+), 5 deletions(-)


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

diff --git a/tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php 
b/tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php
index fd9e647..1a1ae91 100644
--- a/tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php
+++ b/tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php
@@ -29,11 +29,12 @@
// Create a table to use for test
$db = $this-db;
 
-   $db-query( 'CREATE TEMPORARY TABLE IF NOT EXISTS '
-   . $db-tableName( $this-table ) . ' (' .
-   'id int unsigned NOT NULL PRIMARY KEY auto_increment,' .
-   'field1 varchar(255) UNIQUE,' .
-   'field2 varchar(255) );',
+   $autoincrement = ($db-getType() === 'sqlite' ? 'autoincrement' 
: 'auto_increment');
+   $db-query( CREATE TEMPORARY TABLE IF NOT EXISTS
+   {$db-tableName( $this-table )} (
+   id int unsigned NOT NULL PRIMARY KEY {$autoincrement},
+   field1 varchar(255) UNIQUE,
+   field2 varchar(255) ),
__METHOD__ );
 
// TestHelper provides some convenience functionality that we 
use

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c770c6becd3e24d8d0b653ceab0f912baca7653
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Campaigns
Gerrit-Branch: wip/editorcampaigns
Gerrit-Owner: Adamw awi...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Add qtip-shadow class - change (mediawiki...Lingo)

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

Change subject: Add qtip-shadow class
..


Add qtip-shadow class

This allows that when switching to v2.2 (for SMW and be used by SG [0] ) the
shadows persists.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/315

Change-Id: Ia002f2c0144d4d884f453b7351e954e8dcc1183b
---
M libs/Lingo.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/libs/Lingo.js b/libs/Lingo.js
index cd42474..e281509 100644
--- a/libs/Lingo.js
+++ b/libs/Lingo.js
@@ -28,7 +28,7 @@
delay: 300
},
style   : {
-   classes: tooltip.attr( 'class' ),
+   classes: tooltip.attr( 'class' ) + ' 
qtip-shadow',
def: false
}
 

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

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

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


[MediaWiki-commits] [Gerrit] Phantom optimisations - change (VisualEditor/VisualEditor)

2014-05-17 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: Phantom optimisations
..

Phantom optimisations

* Only compute .css('float') once other checks have been
  completed. This saves at least one call per node.
* Pre-compute .css('float') for comparison against 'float'
  and ''. This halves the total number of calls.

Change-Id: Ia33e861e1b83b72a1433001ef98d73d8a294faf7
---
M modules/ve/ce/ve.ce.ProtectedNode.js
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/92/133892/1

diff --git a/modules/ve/ce/ve.ce.ProtectedNode.js 
b/modules/ve/ce/ve.ce.ProtectedNode.js
index f3342ca..deeb82f 100644
--- a/modules/ve/ce/ve.ce.ProtectedNode.js
+++ b/modules/ve/ce/ve.ce.ProtectedNode.js
@@ -89,12 +89,17 @@
if ( this.nodeType === Node.ELEMENT_NODE ) {
var $this = node.$( this );
if (
-   ( $this.css( 'float' ) === 'none' || $this.css( 
'float' ) === '' ) 
+   // Always shield the root
!$this.hasClass( 've-ce-protectedNode' ) 
// Phantoms are built off shields, so make sure 
$phantomable has a shield
!$this.is( node.$phantomable )
) {
-   return;
+   // .css( 'float' ) is *very* expensive so 
compute at
+   // last possible opportunity
+   var cssFloat = $this.css( 'float' );
+   if ( cssFloat === 'none' || cssFloat === '' ) {
+   return;
+   }
}
$shield = node.createShield()
.appendTo( $this )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia33e861e1b83b72a1433001ef98d73d8a294faf7
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders esand...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] (bugfix) manual is not a dict and can't be used for transl... - change (pywikibot/core)

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

Change subject: (bugfix) manual is not a dict and can't be used for 
translation
..


(bugfix) manual is not a dict and can't be used for translation

on the other hand we have these translations on mediawiki and the
L10N_msg is obsolete. Update this part from compat.

Change-Id: I9e0903f5a93dd4cd5da342a591c68c59267ffef7
---
M scripts/reflinks.py
1 file changed, 8 insertions(+), 15 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index 4ec04a1..cf88bc8 100644
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -60,14 +60,10 @@
 'params;': pagegenerators.parameterHelp
 }
 
-localized_msg = ('fr', )  # localized message at mediawik
+localized_msg = ('fr', 'it', 'pl')  # localized message at mediawiki
 
 # localized message at specific wikipedia site
 # should be moved to mediawiki pywikibot manual
-L10N_msg = {
-'it': u'Utente:Marco27Bot/refLinks.py',
-'pl': u'Wikipedysta:MastiBot/refLinks',
-}
 
 
 stopPage = {
@@ -404,16 +400,13 @@
 self.site = pywikibot.Site()
 # Check
 manual = 'mw:Manual:Pywikibot/refLinks'
-if self.site.family.name == 'wikipedia':
-manual = pywikibot.translate(self.site.code, manual)
-else:
-code = None
-for alt in [self.site.code] + i18n._altlang(self.site.code):
-if alt in localized_msg:
-code = alt
-break
-if code:
-manual += '/%s' % code
+code = None
+for alt in [self.site.code] + i18n._altlang(self.site.code):
+if alt in localized_msg:
+code = alt
+break
+if code:
+manual += '/%s' % code
 self.msg = i18n.twtranslate(self.site, 'reflinks-msg', locals())
 self.stopPage = pywikibot.Page(self.site,
pywikibot.translate(self.site, 
stopPage))

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9e0903f5a93dd4cd5da342a591c68c59267ffef7
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl
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 pagegenerators_tests.py to test suite - change (pywikibot/core)

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

Change subject: add pagegenerators_tests.py to test suite
..


add pagegenerators_tests.py to test suite

Change-Id: I3257a1ade83a80561ef088a2a30b1224050a
---
A tests/pagegenerators_tests.py
1 file changed, 133 insertions(+), 0 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
new file mode 100644
index 000..de98968
--- /dev/null
+++ b/tests/pagegenerators_tests.py
@@ -0,0 +1,133 @@
+#!/usr/bin/python
+# -*- coding: utf-8  -*-
+#
+# (C) Pywikibot team, 2014
+#
+# Distributed under the terms of the MIT license.
+__version__ = '$Id$'
+
+import sys
+import pywikibot
+from pywikibot import pagegenerators
+
+from tests.utils import unittest
+
+
+class TestPageGenerators(unittest.TestCase):
+Test pagegenerators methods
+
+titles = [
+# just a bunch of randomly selected titles
+uCities in Burkina Faso,
+uEastern Sayan,
+uThe Addams Family (pinball),
+uTalk:Hispanic (U.S. Census),
+uTalk:Stołpce,
+uTalk:Nowy Sącz,
+uTalk:Battle of Węgierska Górka,
+uTemplate:!,
+uTemplate:!/Doc,
+uTemplate:!/Meta,
+uTemplate:Template,
+uTemplate:Template/Doc,
+uTemplate:Template/Meta,
+]
+
+def setUp(self):
+self.site = pywikibot.Site('en', 'wikipedia')
+
+def assertFunction(self, obj):
+self.assertTrue(hasattr(pagegenerators, obj))
+self.assertTrue(hasattr(getattr(pagegenerators, obj), '__call__'))
+
+def test_module_import(self):
+self.assertTrue(pywikibot.pagegenerators in sys.modules)
+
+def test_PagesFromTitlesGenerator(self):
+self.assertFunction(PagesFromTitlesGenerator)
+gen = pagegenerators.PagesFromTitlesGenerator(self.titles)
+self.assertTrue(len(self.titles) == len(tuple(gen)))
+
+def test_NamespaceFilterPageGenerator(self):
+self.assertFunction(NamespaceFilterPageGenerator)
+gen = pagegenerators.PagesFromTitlesGenerator(self.titles)
+gen = pagegenerators.NamespaceFilterPageGenerator(gen, 0)
+self.assertTrue(len(tuple(gen)) == 3)
+gen = pagegenerators.PagesFromTitlesGenerator(self.titles)
+gen = pagegenerators.NamespaceFilterPageGenerator(gen, 1)
+self.assertTrue(len(tuple(gen)) == 4)
+gen = pagegenerators.PagesFromTitlesGenerator(self.titles)
+gen = pagegenerators.NamespaceFilterPageGenerator(gen, 10)
+self.assertTrue(len(tuple(gen)) == 6)
+gen = pagegenerators.PagesFromTitlesGenerator(self.titles)
+gen = pagegenerators.NamespaceFilterPageGenerator(gen, (1, 10))
+self.assertTrue(len(tuple(gen)) == 10)
+
+def test_RegexFilterPageGenerator(self):
+self.assertFunction(RegexFilterPageGenerator)
+gen = pagegenerators.PagesFromTitlesGenerator(self.titles)
+gen = pagegenerators.RegexFilterPageGenerator(gen, '/doc')
+self.assertTrue(len(tuple(gen)) == 2)
+gen = pagegenerators.PagesFromTitlesGenerator(self.titles)
+gen = pagegenerators.RegexFilterPageGenerator(gen, '/doc',
+  quantifier='none')
+self.assertTrue(len(tuple(gen)) == 11)
+gen = pagegenerators.PagesFromTitlesGenerator(self.titles)
+gen = pagegenerators.RegexFilterPageGenerator(gen, ['/doc', '/meta'])
+self.assertTrue(len(tuple(gen)) == 4)
+gen = pagegenerators.PagesFromTitlesGenerator(self.titles)
+gen = pagegenerators.RegexFilterPageGenerator(gen, ['/doc', '/meta'],
+  quantifier='none')
+self.assertTrue(len(tuple(gen)) == 9)
+gen = pagegenerators.PagesFromTitlesGenerator(self.titles)
+gen = pagegenerators.RegexFilterPageGenerator(gen, ['/doc', '/meta'],
+  quantifier='all')
+self.assertTrue(len(tuple(gen)) == 0)
+gen = pagegenerators.PagesFromTitlesGenerator(self.titles)
+gen = pagegenerators.RegexFilterPageGenerator(gen, ['Template', 
'/meta'],
+  quantifier='all')
+self.assertTrue(len(tuple(gen)) == 1)
+gen = pagegenerators.PagesFromTitlesGenerator(self.titles)
+gen = pagegenerators.RegexFilterPageGenerator(gen, ['template', 
'/meta'],
+  quantifier='any')
+self.assertTrue(len(tuple(gen)) == 4)
+gen = pagegenerators.PagesFromTitlesGenerator(self.titles,
+  site=self.site)
+gen = pagegenerators.RegexFilterPageGenerator(gen, ['template', 
'/meta'],
+  

[MediaWiki-commits] [Gerrit] Add Proofread Page preloading functions - change (pywikibot/core)

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

Change subject: Add Proofread Page preloading functions
..


Add Proofread Page preloading functions

Implement preload param in API:Properties module info to
preload text.

Application: on Wikisource, with Extension:Proofread Page, it is
possible to preload text from a not existing page in the Page
namespace, if the corresponding Index page is present.

If a djvu file is connected to an Index page, text is basically already
available, making this script less important.

See also Bug 58963 - prop=infoinprop=preload does not return text
and Bug 64853 - port djvutext.py to core

Change-Id: Ic534597fe42c09e8432300a19e77c23a21f21a8e
---
M pywikibot/data/api.py
M pywikibot/page.py
M pywikibot/site.py
3 files changed, 20 insertions(+), 2 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index ea462e2..5ef6cee 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1055,6 +1055,9 @@
 if pageprops in pagedict:
 page._pageprops = pagedict['pageprops']
 
+if 'preload' in pagedict:
+page._preloadedtext = pagedict['preload']
+
 if flowinfo in pagedict:
 page._flowinfo = pagedict['flowinfo']['flow']
 
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 0c765ce..c54fab5 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -393,6 +393,16 @@
 if hasattr(self, _text):
 del self._text
 
+def preloadText(self):
+Return the text returned by EditFormPreloadText See API module 
info.
+
+Application: on Wikisource wikis, text can be preloaded even if
+a page does not exist, if an Index page is present.
+
+
+self.site.loadpageinfo(self, preload=True)
+return self._preloadedtext
+
 def properties(self, force=False):
 
 Returns the various page properties stored for a page
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 3382686..f9e6223 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -1227,13 +1227,18 @@
 except pywikibot.data.api.APIError:  # May occur if you are not logged 
in (no API read permissions).
 return (0, 0, 0)
 
-def loadpageinfo(self, page):
+def loadpageinfo(self, page, preload=False):
 Load page info from api and save in page attributes
 title = page.title(withSection=False)
+inprop = 'protection'
+if preload:
+inprop += '|preload'
+
 query = self._generator(api.PropertyGenerator,
 type_arg=info,
 titles=title.encode(self.encoding()),
-inprop=protection)
+inprop=inprop)
+
 for pageitem in query:
 if not self.sametitle(pageitem['title'], title):
 pywikibot.warning(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic534597fe42c09e8432300a19e77c23a21f21a8e
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa mpaa.w...@gmail.com
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: Mpaa mpaa.w...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Unit test class for ip_regexp from compat - change (pywikibot/core)

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

Change subject: Unit test class for ip_regexp from compat
..


Unit test class for ip_regexp from compat

Change-Id: I041fdbc734a1174ba4c233e4c6947883711ae80b
---
A tests/ipregex_tests.py
1 file changed, 616 insertions(+), 0 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/ipregex_tests.py b/tests/ipregex_tests.py
new file mode 100644
index 000..1e05474
--- /dev/null
+++ b/tests/ipregex_tests.py
@@ -0,0 +1,616 @@
+#!/usr/bin/python
+# -*- coding: utf-8  -*-
+#
+# (C) Pywikibot team, 2014
+#
+# Distributed under the terms of the MIT license.
+__version__ = '$Id$'
+
+import pywikibot
+
+from tests.utils import unittest
+from pywikibot.page import ip_regexp
+
+
+class PyWikiIpRegexCase(unittest.TestCase):
+Unit test class for ip_regexp
+
+def setUp(self):
+self.total = 0
+self.fail = 0
+
+def tearDown(self):
+print '%d tests done, %d failed' % (self.total, self.fail)
+if self.fail:
+raise AssertionError
+
+def ipv6test(self, result, IP):
+self.total += 1
+failed = False
+try:
+self.assertEqual(result, bool(ip_regexp.match(IP)))
+except AssertionError:
+self.fail += 1
+failed = True
+if failed:
+print '%s should match %s - not OK' % (IP, result)
+
+def test_IP(self):
+# test from http://download.dartware.com/thirdparty/test-ipv6-regex.pl
+self.ipv6test(False, )  # empty string
+self.ipv6test(True, ::1)  # loopback, compressed, non-routable
+self.ipv6test(True, ::)  # unspecified, compressed, non-routable
+self.ipv6test(True, 0:0:0:0:0:0:0:1)  # loopback, full
+self.ipv6test(True, 0:0:0:0:0:0:0:0)  # unspecified, full
+self.ipv6test(True, 2001:DB8:0:0:8:800:200C:417A)  # unicast, full
+self.ipv6test(True, FF01:0:0:0:0:0:0:101)  # multicast, full
+self.ipv6test(True, 2001:DB8::8:800:200C:417A)  # unicast, compressed
+self.ipv6test(True, FF01::101)  # multicast, compressed
+self.ipv6test(False, 2001:DB8:0:0:8:800:200C:417A:221)  # unicast, 
full
+self.ipv6test(False, FF01::101::2)  # multicast, compressed
+self.ipv6test(True, fe80::217:f2ff:fe07:ed62)
+
+self.ipv6test(True, 2001::1234:::C1C0:ABCD:0876)
+self.ipv6test(True, 3ffe:0b00:::0001:::000a)
+self.ipv6test(True, FF02:::::::0001)
+self.ipv6test(True, :::::::0001)
+self.ipv6test(True, :::::::)
+self.ipv6test(False, 02001::1234:::C1C0:ABCD:0876)  # 
extra 0 not allowed!
+self.ipv6test(False, 2001::1234::1:C1C0:ABCD:0876)  # 
extra 0 not allowed!
+# self.ipv6test(True,  2001::1234:::C1C0:ABCD:0876)  # 
leading space
+# self.ipv6test(True, 2001::1234:::C1C0:ABCD:0876)  # 
trailing space
+# self.ipv6test(True,  2001::1234:::C1C0:ABCD:0876  )  # 
leading and trailing space
+self.ipv6test(False, 2001::1234:::C1C0:ABCD:0876  0)  # 
junk after valid address
+self.ipv6test(False, 2001::1234: ::C1C0:ABCD:0876)  # 
internal space
+
+self.ipv6test(False, 3ffe:0b00::0001:::000a)  # seven 
segments
+self.ipv6test(False, FF02::::::::0001)  
# nine segments
+self.ipv6test(False, 3ffe:b00::1::a)  # double ::
+self.ipv6test(False, :::::::::)  # double 
::
+self.ipv6test(True, 2::10)
+self.ipv6test(True, ff02::1)
+self.ipv6test(True, fe80::)
+self.ipv6test(True, 2002::)
+self.ipv6test(True, 2001:db8::)
+self.ipv6test(True, 2001:0db8:1234::)
+self.ipv6test(True, :::0:0)
+self.ipv6test(True, ::1)
+self.ipv6test(True, 1:2:3:4:5:6:7:8)
+self.ipv6test(True, 1:2:3:4:5:6::8)
+self.ipv6test(True, 1:2:3:4:5::8)
+self.ipv6test(True, 1:2:3:4::8)
+self.ipv6test(True, 1:2:3::8)
+self.ipv6test(True, 1:2::8)
+self.ipv6test(True, 1::8)
+self.ipv6test(True, 1::2:3:4:5:6:7)
+self.ipv6test(True, 1::2:3:4:5:6)
+self.ipv6test(True, 1::2:3:4:5)
+self.ipv6test(True, 1::2:3:4)
+self.ipv6test(True, 1::2:3)
+self.ipv6test(True, 1::8)
+self.ipv6test(True, ::2:3:4:5:6:7:8)
+self.ipv6test(True, ::2:3:4:5:6:7)
+self.ipv6test(True, ::2:3:4:5:6)
+self.ipv6test(True, ::2:3:4:5)
+self.ipv6test(True, ::2:3:4)
+self.ipv6test(True, ::2:3)
+self.ipv6test(True, ::8)
+self.ipv6test(True, 1:2:3:4:5:6::)
+self.ipv6test(True, 1:2:3:4:5::)
+

[MediaWiki-commits] [Gerrit] (bug 65013) Test QueryGenerator.limit - change (pywikibot/core)

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

Change subject: (bug 65013) Test QueryGenerator.limit
..


(bug 65013) Test QueryGenerator.limit

Change-Id: I1df4c4660b47d2a43b5e6dffe7204161d4d5
---
M tests/api_tests.py
1 file changed, 34 insertions(+), 0 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/api_tests.py b/tests/api_tests.py
index c5b02b5..510f41a 100644
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -73,6 +73,40 @@
 self.assertEqual(page.site, mysite)
 self.assertIn(page.title(), titles)
 
+def test_initial_limit(self):
+self.assertEqual(self.gen.limit, None)  # limit is initaly None
+
+def test_limit_as_number(self):
+for i in range(-2, 4):
+self.gen.set_maximum_items(i)
+self.assertEqual(self.gen.limit, i)
+
+def test_limit_as_string(self):
+for i in range(-2, 4):
+self.gen.set_maximum_items(str(i))
+self.assertEqual(self.gen.limit, i)
+
+def test_wrong_limit_setting(self):
+with self.assertRaisesRegexp(
+ValueError,
+invalid literal for int\(\) with base 10: 'test'):
+self.gen.set_maximum_items('test')
+
+def test_limits(self):
+Test that PageGenerator yields the requested amount of pages
+for i in range(4, 0, -1):
+self.gen.set_maximum_items(i)  # set total amount of pages
+results = [p for p in self.gen]
+self.assertEqual(len(results), i)
+
+self.gen.set_maximum_items(0)
+results = [p for p in self.gen]
+self.assertEqual(len(results), 4)  # total=0 but 4 expected (really?)
+
+self.gen.set_maximum_items(-1)
+results = [p for p in self.gen]
+self.assertEqual(len(results), 4)  # total=-1 but 4 expected
+
 
 class TestCachedRequest(unittest.TestCase):
 def testResults(self):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1df4c4660b47d2a43b5e6dffe7204161d4d5
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: Russell Blau russb...@imapmail.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Highlight chevron when the wrong direction is pressed - change (mediawiki...MultimediaViewer)

2014-05-17 Thread Gilles (Code Review)
Gilles has uploaded a new change for review.

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

Change subject: Highlight chevron when the wrong direction is pressed
..

Highlight chevron when the wrong direction is pressed

Change-Id: I0d43c58a16fa805611f9fdef329b5ab6a32ed651
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/554
---
M resources/mmv/ui/mmv.ui.metadataPanelScroller.js
M resources/mmv/ui/mmv.ui.metadataPanelScroller.less
M tests/qunit/mmv/mmv.lightboxinterface.test.js
M tests/qunit/mmv/ui/mmv.ui.metadataPanelScroller.test.js
4 files changed, 203 insertions(+), 181 deletions(-)


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

diff --git a/resources/mmv/ui/mmv.ui.metadataPanelScroller.js 
b/resources/mmv/ui/mmv.ui.metadataPanelScroller.js
index ceaf853..33b10fc 100644
--- a/resources/mmv/ui/mmv.ui.metadataPanelScroller.js
+++ b/resources/mmv/ui/mmv.ui.metadataPanelScroller.js
@@ -39,10 +39,19 @@
 */
this.hasAnimatedMetadata = undefined;
 
+   /**
+* Timer used to highlight the chevron when the wrong key is 
pressed
+* @property {number}
+* @private
+*/
+   this.highlightTimeout = undefined;
+
this.initialize();
}
oo.inheritClass( MetadataPanelScroller, mw.mmv.ui.Element );
MPSP = MetadataPanelScroller.prototype;
+
+   MPSP.highlightDuration = 500;
 
MPSP.attach = function() {
var panel = this;
@@ -100,7 +109,8 @@
 * Toggles the metadata div being totally visible.
 */
MPSP.toggle = function ( forceDirection ) {
-   var scrollTopWhenOpen = this.$container.outerHeight() - 
this.$controlBar.outerHeight(),
+   var self = this,
+   scrollTopWhenOpen = this.$container.outerHeight() - 
this.$controlBar.outerHeight(),
scrollTopWhenClosed = 0,
scrollTop = $.scrollTo().scrollTop(),
panelIsOpen = scrollTop  scrollTopWhenClosed,
@@ -110,7 +120,13 @@
scrollTopTarget = forceDirection === 'down' ? 
scrollTopWhenClosed : scrollTopWhenOpen;
if ( scrollTop === scrollTopTarget ) {
// The user pressed down when the panel was 
closed already (or up when fully open).
-   // Not a real toggle; do not log.
+   // Not a real toggle; highlight the chevron to 
attract attention.
+   this.$container.addClass( 
'mw-mmv-highlight-chevron' );
+
+   if ( this.highlightTimeout ) {
+   clearTimeout( this.highlightTimeout );
+   }
+   this.highlightTimeout = setTimeout( function() 
{ self.$container.removeClass( 'mw-mmv-highlight-chevron' ); }, 
self.highlightDuration );
return;
}
}
diff --git a/resources/mmv/ui/mmv.ui.metadataPanelScroller.less 
b/resources/mmv/ui/mmv.ui.metadataPanelScroller.less
index 1facb3a..0c290d0 100644
--- a/resources/mmv/ui/mmv.ui.metadataPanelScroller.less
+++ b/resources/mmv/ui/mmv.ui.metadataPanelScroller.less
@@ -86,7 +86,9 @@
background-position: center top;
.rotate(180deg);
}
-   .mw-mmv-post-image.invite  {
+
+   .mw-mmv-post-image.invite , 
.mw-mmv-post-image.mw-mmv-highlight-chevron  {
+   /* @embed */
background-image: url(img/drag-active.svg);
opacity: 0.9;
}
diff --git a/tests/qunit/mmv/mmv.lightboxinterface.test.js 
b/tests/qunit/mmv/mmv.lightboxinterface.test.js
index 0987c39..00e477c 100644
--- a/tests/qunit/mmv/mmv.lightboxinterface.test.js
+++ b/tests/qunit/mmv/mmv.lightboxinterface.test.js
@@ -240,183 +240,6 @@
restoreScrollTo();
} );
 
-   /**
-* We need to set up a proxy on the jQuery scrollTop function and the 
jQuery.scrollTo plugin,
-* that will let us pretend that the document really scrolled and that 
will return values
-* as if the scroll happened.
-* @param {sinon.sandbox} sandbox
-* @param {mw.mmv.LightboxInterface} ui
-*/
-   function stubScrollFunctions( sandbox, ui ) {
-   var memorizedScrollToScroll = 0,
-   originalJQueryScrollTop = $.fn.scrollTop,
-   originalJQueryScrollTo = $.scrollTo;
-
-   sandbox.stub( $.fn, 'scrollTop', function ( scrollTop ) {
-   // On some browsers $.scrollTo() != $document
-   if ( $.scrollTo().is( this ) ) {
-   if ( 

[MediaWiki-commits] [Gerrit] _autoload.php renamed to Autoload.php - change (mediawiki...Translate)

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

Change subject: _autoload.php renamed to Autoload.php
..


_autoload.php renamed to Autoload.php

The file was renamed to keep consistency over extensions and the references 
were resolved as well.

Change-Id: I6262c9eb497e32d0280bc6aafc9c8503843cfb3b
---
R Autoload.php
M Translate.php
M tests/phpunit/SpecialPagesTest.php
3 files changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/_autoload.php b/Autoload.php
similarity index 100%
rename from _autoload.php
rename to Autoload.php
diff --git a/Translate.php b/Translate.php
index 7679b39..acfcca9 100644
--- a/Translate.php
+++ b/Translate.php
@@ -40,7 +40,7 @@
  * Setup class autoloading.
  */
 $dir = __DIR__;
-require_once $dir/_autoload.php;
+require_once $dir/Autoload.php;
 /** @endcond */
 
 /**
diff --git a/tests/phpunit/SpecialPagesTest.php 
b/tests/phpunit/SpecialPagesTest.php
index 5c6e035..658d859 100644
--- a/tests/phpunit/SpecialPagesTest.php
+++ b/tests/phpunit/SpecialPagesTest.php
@@ -26,7 +26,7 @@
}
 
public static function provideSpecialPages() {
-   require __DIR__ . '/../../_autoload.php';
+   require __DIR__ . '/../../Autoload.php';
global $wgSpecialPages;
 
$pages = array();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6262c9eb497e32d0280bc6aafc9c8503843cfb3b
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: BPositive pr4tiklah...@gmail.com
Gerrit-Reviewer: Nemo bis federicol...@tiscali.it
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] mediawiki.page.watch.ajax: Disable watch link while waiting ... - change (mediawiki/core)

2014-05-17 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: mediawiki.page.watch.ajax: Disable watch link while waiting for 
API response
..

mediawiki.page.watch.ajax: Disable watch link while waiting for API response

Previously clicking the watch link several times in a row would fire
several requests to the API, and the final result would depend on the
order in which they arrived. Let's not allow that.

This also removes the special-case for the 'loading' class, it is now
always added or removed.

Bug: 65434
Change-Id: Ib91ec8505d04945dc77e48ab70b5c94e3da47d9c
---
M resources/src/mediawiki.page/mediawiki.page.watch.ajax.js
1 file changed, 8 insertions(+), 7 deletions(-)


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

diff --git a/resources/src/mediawiki.page/mediawiki.page.watch.ajax.js 
b/resources/src/mediawiki.page/mediawiki.page.watch.ajax.js
index 3b0aeee..15e9aba 100644
--- a/resources/src/mediawiki.page/mediawiki.page.watch.ajax.js
+++ b/resources/src/mediawiki.page/mediawiki.page.watch.ajax.js
@@ -57,13 +57,10 @@
$li.prop( 'id', 'ca-' + action );
}
 
-   // Special case for vector icon
-   if ( $li.hasClass( 'icon' ) ) {
-   if ( state === 'loading' ) {
-   $link.addClass( 'loading' );
-   } else {
-   $link.removeClass( 'loading' );
-   }
+   if ( state === 'loading' ) {
+   $link.addClass( 'loading' );
+   } else {
+   $link.removeClass( 'loading' );
}
}
 
@@ -133,6 +130,10 @@
 
$link = $( this );
 
+   if ( $link.hasClass( 'loading' ) ) {
+   return;
+   }
+
updateWatchLink( $link, action, 'loading' );
 
api = new mw.Api();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib91ec8505d04945dc77e48ab70b5c94e3da47d9c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński matma@gmail.com

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


[MediaWiki-commits] [Gerrit] vector: Suppress watch star focus outline when animating it - change (mediawiki/core)

2014-05-17 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: vector: Suppress watch star focus outline when animating it
..

vector: Suppress watch star focus outline when animating it

It looks really funny, but that's not the effect we're aiming for.
The star is not supposed to look clickable during the rotation
animation anyway.

Bug: 65434
Change-Id: I3a7c91f5b7df0d70abd532cc234e8aa1bac9e129
---
M skins/vector/components/watchstar.less
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/94/133894/1

diff --git a/skins/vector/components/watchstar.less 
b/skins/vector/components/watchstar.less
index 2c38516..1a6d1fc 100644
--- a/skins/vector/components/watchstar.less
+++ b/skins/vector/components/watchstar.less
@@ -34,6 +34,8 @@
 #ca-watch.icon a.loading {
.background-image-svg('images/watch-icon-loading.svg', 
'images/watch-icon-loading.png');
.rotation(700ms);
+   /* Suppress the hilarious rotating focus outline on Firefox */
+   outline: none;
background-position: 50% 60%;
-webkit-transform-origin: 50% 57%;
transform-origin: 50% 57%;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a7c91f5b7df0d70abd532cc234e8aa1bac9e129
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński matma@gmail.com

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


[MediaWiki-commits] [Gerrit] Use OOUI confirmation dialog rather than native confirm() fo... - change (mediawiki...VisualEditor)

2014-05-17 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: Use OOUI confirmation dialog rather than native confirm() for 
switching to source editing
..

Use OOUI confirmation dialog rather than native confirm() for switching to 
source editing

Per TTO on bug 51655, the implementation of confirm() in most browsers is 
crappy and we
shouldn't use it.

Change-Id: I755085a253c05958e4b50af57b19dab90f2f0fb6
---
M VisualEditor.php
M modules/ve-mw/i18n/en.json
M modules/ve-mw/i18n/qqq.json
M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
4 files changed, 24 insertions(+), 10 deletions(-)


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

diff --git a/VisualEditor.php b/VisualEditor.php
index 1b6f897..704fc28 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -672,6 +672,8 @@
'visualeditor-help-title',
'visualeditor-mweditmodesource-title',
'visualeditor-mweditmodesource-warning',
+   'visualeditor-mweditmodesource-warning-switch',
+   'visualeditor-mweditmodesource-warning-cancel',
'visualeditor-pagemenu-tooltip',
'visualeditor-pagetranslationwarning',
'visualeditor-savedialog-error-badtoken',
diff --git a/modules/ve-mw/i18n/en.json b/modules/ve-mw/i18n/en.json
index 8ff9629..3e78137 100644
--- a/modules/ve-mw/i18n/en.json
+++ b/modules/ve-mw/i18n/en.json
@@ -180,6 +180,8 @@
 visualeditor-mwalienextensioninspector-title: MediaWiki extension,
 visualeditor-mweditmodesource-title: Switch to source editing,
 visualeditor-mweditmodesource-warning: You are about to switch to 
source editing.\nAny changes you've made to this document will be kept, but you 
will not be able switch back to VisualEditor without saving or reloading the 
page.\nDo you want to continue?,
+visualeditor-mweditmodesource-warning-switch: Yes, switch,
+visualeditor-mweditmodesource-warning-cancel: No, cancel,
 visualeditor-mwgalleryinspector-placeholder: Example.jpg|Caption for 
image,
 visualeditor-mwgalleryinspector-title: Gallery,
 visualeditor-mwhieroinspector-title: Hieroglyphics,
diff --git a/modules/ve-mw/i18n/qqq.json b/modules/ve-mw/i18n/qqq.json
index c3db72f..05e0a5e 100644
--- a/modules/ve-mw/i18n/qqq.json
+++ b/modules/ve-mw/i18n/qqq.json
@@ -185,6 +185,8 @@
visualeditor-mwalienextensioninspector-title: Used as title for 
unknown MediaWiki extensions.\n{{Identical|MediaWiki extension}},
visualeditor-mweditmodesource-title: Label for changing edit mode to 
source editing.,
visualeditor-mweditmodesource-warning: Warning message show before 
changing edit mode to source editing.,
+   visualeditor-mweditmodesource-switch: Label for the OK button on the 
confirmation dialog for switching to source editing.,
+   visualeditor-mweditmodesource-cancel: Label for the cancel button on 
the confirmation dialog for switching to source editing.,
visualeditor-mwgalleryinspector-placeholder: Placeholder text for 
the gallery inspector demonstrating how gallery syntax works.,
visualeditor-mwgalleryinspector-title: Used as title for the gallery 
inspector.\n{{Identical|Gallery}},
visualeditor-mwhieroinspector-title: Used as title for the 
hieroglyphics inspector.,
diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
index 9b2f02e..4a418e8 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
@@ -890,19 +890,27 @@
  * @method
  */
 ve.init.mw.ViewPageTarget.prototype.editSource = function () {
-   var doc = this.surface.getModel().getDocument();
+   var confirmDialog = this.surface.dialogs.getWindow( 'confirm' );
 
this.$document.css( 'opacity', 0.5 );
 
-   if ( !confirm( ve.msg( 'visualeditor-mweditmodesource-warning' ) ) ) {
-   this.$document.css( 'opacity', 1 );
-   return;
-   }
-   // Get Wikitext from the DOM
-   this.serialize(
-   this.docToSave || ve.dm.converter.getDomFromModel( doc ),
-   ve.bind( this.submitWithSaveFields, this, { 'wpDiff': 1, 
'veswitched': 1 } )
-   );
+   confirmDialog.open( {
+   'prompt': ve.msg( 'visualeditor-mweditmodesource-warning' ),
+   'okLabel': ve.msg( 
'visualeditor-mweditmodesource-warning-switch' ),
+   'cancelLabel': ve.msg( 
'visualeditor-mweditmodesource-warning-cancel' )
+   } );
+   confirmDialog.connect( this, {
+   'ok': function () {
+   // Get Wikitext from the DOM
+   this.serialize(
+   

[MediaWiki-commits] [Gerrit] Refactored SemanticGlossaryBackend - change (mediawiki...SemanticGlossary)

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

Change subject: Refactored SemanticGlossaryBackend
..


Refactored SemanticGlossaryBackend

- Encapsulated LingoBackend using \SG\LingoBackendAdapter
- Added \SG\Cache\ElementsCacheBuilder

Change-Id: Id59164a9cc2c34a777313fb12524ceedf35801e5
---
A README.md
M SemanticGlossary.php
D SemanticGlossaryBackend.php
D SemanticGlossaryCacheHandling.php
A src/Cache/ElementsCacheBuilder.php
A src/LingoBackendAdapter.php
M tests/bootstrap.php
A tests/mw-phpunit-runner.php
A tests/phpunit/Cache/ElementsCacheBuilderTest.php
A tests/phpunit/LingoBackendAdapterTest.php
10 files changed, 596 insertions(+), 380 deletions(-)

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



diff --git a/README.md b/README.md
new file mode 100644
index 000..4982fc6
--- /dev/null
+++ b/README.md
@@ -0,0 +1,38 @@
+# Semantic Glossary
+[![Latest Stable 
Version](https://poser.pugx.org/mediawiki/semantic-glossary/version.png)](https://packagist.org/packages/mediawiki/chameleon-skin)
+[![Packagist download 
count](https://poser.pugx.org/mediawiki/semantic-glossary/d/total.png)](https://packagist.org/packages/mediawiki/chameleon-skin)
+[![Dependency 
Status](https://www.versioneye.com/php/mediawiki:semantic-glossary/badge.png)](https://www.versioneye.com/php/mediawiki:chameleon-skin)
+
+The [Semantic Glossary][mw-semantic-glossary] (a.k.a SG) is a [Semantic 
MediaWiki][smw] extension where terms and abbreviations can be defined using 
semantic properties.
+
+## Requirements
+
+- PHP 5.3.2 or later
+- MediaWiki 1.20 or later
+- [Lingo extension][mw-lingo] 1.0 or later
+
+## Installation
+
+The recommended way to install this skin is by using [Composer][composer]. 
Just add the following to the MediaWiki `composer.json` file and run the `php 
composer.phar install/update` command.
+
+```json
+{
+   require: {
+   mediawiki/semantic-glossary: ~1.0
+   }
+}
+```
+
+## Tests
+
+The extension provides unit tests that covers core-functionality normally run 
by a continues integration platform. Tests can also be executed manually using 
the `mw-phpunit-runner.php` script (loads necessary MediaWiki dependencies) or 
running `phpunit` with the [PHPUnit][mw-testing] configuration file found in 
the root directory.
+
+```sh
+php mw-phpunit-runner.php
+```
+
+[mw-semantic-glossary]: 
https://www.mediawiki.org/wiki/Extension:Semantic_Glossary
+[mw-lingo]: https://www.mediawiki.org/wiki/Extension:Lingo
+[smw]: https://www.mediawiki.org/wiki/Semantic_MediaWiki
+[mw-testing]: https://www.mediawiki.org/wiki/Manual:PHP_unit_testing
+[composer]: https://getcomposer.org/
\ No newline at end of file
diff --git a/SemanticGlossary.php b/SemanticGlossary.php
index 37509b8..68e2252 100644
--- a/SemanticGlossary.php
+++ b/SemanticGlossary.php
@@ -44,9 +44,8 @@
'version' = SG_VERSION,
);
 
-
// set SemanticGlossaryBackend as the backend to access the glossary
-   $GLOBALS[ 'wgexLingoBackend' ] = 'SemanticGlossaryBackend';
+   $GLOBALS[ 'wgexLingoBackend' ] = 'SG\LingoBackendAdapter';
 
// server-local path to this file
$dir = __DIR__;
@@ -57,11 +56,12 @@
 
// register class files with the Autoloader
$autoloadClasses = array(
-   'SemanticGlossaryBackend'  = $dir . 
'/SemanticGlossaryBackend.php',
'SG\PropertyRegistry'  = $dir . 
'/src/PropertyRegistry.php',
'SG\CacheInvalidator'  = $dir . 
'/src/CacheInvalidator.php',
'SG\CacheHelper'   = $dir . '/src/CacheHelper.php',
'SG\DataComparator'= $dir . '/src/DataComparator.php',
+   'SG\LingoBackendAdapter'   = $dir . 
'/src/LingoBackendAdapter.php',
+   'SG\Cache\ElementsCacheBuilder'= $dir . 
'/src/Cache/ElementsCacheBuilder.php'
);
 
$GLOBALS[ 'wgAutoloadClasses' ] = array_merge( $GLOBALS[ 
'wgAutoloadClasses' ], $autoloadClasses );
diff --git a/SemanticGlossaryBackend.php b/SemanticGlossaryBackend.php
deleted file mode 100644
index ad9797d..000
--- a/SemanticGlossaryBackend.php
+++ /dev/null
@@ -1,195 +0,0 @@
-?php
-
-/**
- * File holding the SemanticGlossaryBackend class
- *
- * @author Stephan Gambke
- * @file
- * @ingroup SemanticGlossary
- */
-if ( !defined( 'SG_VERSION' ) ) {
-   die( 'This file is part of the SemanticGlossary extension, it is not a 
valid entry point.' );
-}
-
-/**
- * The SemanticGlossaryBackend class.
- *
- * @ingroup SemanticGlossary
- */
-class SemanticGlossaryBackend extends LingoBackend {
-
-   //array of SMWDIWikiPage
-   protected $mQueryResults;
-
-   protected $mDiTerm;
-   protected $mDiDefinition;
-   protected $mDiLink;
-   protected $mDiStyle;
-
-   protected $mDvTerm;
-   protected $mDvDefinition;
-   protected $mDvLink;
-   protected $mDvStyle;
-
-   protected 

[MediaWiki-commits] [Gerrit] Add rebuildGlossaryCache maintenance script - change (mediawiki...SemanticGlossary)

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

Change subject: Add rebuildGlossaryCache maintenance script
..


Add rebuildGlossaryCache maintenance script

- Add rebuildGlossaryCache maintenance script php rebuildGlossaryCache.php
- Add SG\Tests\Maintenance\GlossaryCacheRebuilderTest
- Run tests using php mw-phpunit-runner.php

Change-Id: Ie45bc5bbbdf6db82c1f02dc32634f49972cc1237
---
M SemanticGlossary.php
A maintenance/rebuildGlossaryCache.php
A src/Maintenance/GlossaryCacheRebuilder.php
A tests/phpunit/Maintenance/GlossaryCacheRebuilderTest.php
4 files changed, 333 insertions(+), 0 deletions(-)

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



diff --git a/SemanticGlossary.php b/SemanticGlossary.php
index 68e2252..511b7e6 100644
--- a/SemanticGlossary.php
+++ b/SemanticGlossary.php
@@ -60,6 +60,7 @@
'SG\CacheInvalidator'  = $dir . 
'/src/CacheInvalidator.php',
'SG\CacheHelper'   = $dir . '/src/CacheHelper.php',
'SG\DataComparator'= $dir . '/src/DataComparator.php',
+   'SG\Maintenance\GlossaryCacheRebuilder' = $dir . 
'/src/Maintenance/GlossaryCacheRebuilder.php',
'SG\LingoBackendAdapter'   = $dir . 
'/src/LingoBackendAdapter.php',
'SG\Cache\ElementsCacheBuilder'= $dir . 
'/src/Cache/ElementsCacheBuilder.php'
);
diff --git a/maintenance/rebuildGlossaryCache.php 
b/maintenance/rebuildGlossaryCache.php
new file mode 100644
index 000..d58a118
--- /dev/null
+++ b/maintenance/rebuildGlossaryCache.php
@@ -0,0 +1,83 @@
+?php
+
+namespace SG\Maintenance;
+
+use SG\Maintenance\GlossaryCacheRebuilder;
+use SG\CacheHelper;
+
+use SMW\StoreFactory;
+
+$basePath = getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' 
) : __DIR__ . '/../../..';
+
+require_once $basePath . '/maintenance/Maintenance.php';
+
+/**
+ * Rebuild glossary cache and update pages that contain a glossary term 
annotation
+ *
+ * Usage:
+ * php rebuildGlossaryCache.php [options...]
+ *
+ * @ingroup SG
+ * @ingroup Maintenance
+ *
+ * @license GNU GPL v2+
+ * @since 1.1
+ *
+ * @author mwjames
+ */
+class RebuildGlossaryCache extends \Maintenance {
+
+   public function __construct() {
+   parent::__construct();
+
+   $this-addDescription( Rebuild glossary cache and update pages 
with glossary annotations. );
+   $this-addDefaultParams();
+   }
+
+   /**
+* @see Maintenance::addDefaultParams
+*/
+   protected function addDefaultParams() {
+   $this-addOption( 'verbose', 'Be verbose about the progress', 
false, false, 'v' );
+   $this-addOption( 'quiet', 'Do not give any output', false );
+   }
+
+   /**
+* @see Maintenance::execute
+*/
+   public function execute() {
+
+   if ( !defined( 'SMW_VERSION' ) ) {
+   $this-reportMessage( You need to have SMW enabled in 
order to run the maintenance script!\n\n );
+   return false;
+   }
+
+   $glossaryCacheRebuilder = new GlossaryCacheRebuilder(
+   StoreFactory::getStore(),
+   CacheHelper::getCache(),
+   array( $this, 'reportMessage' )
+   );
+
+   $glossaryCacheRebuilder-setParameters( $this-mOptions );
+
+   if ( $glossaryCacheRebuilder-rebuild() ) {
+   return true;
+   }
+
+   $this-reportMessage( $this-mDescription . \n\n . 'Use 
option --help for details.' . \n  );
+   return false;
+   }
+
+   /**
+* @since 1.1
+*
+* @param string $message
+*/
+   public function reportMessage( $message ) {
+   $this-output( $message );
+   }
+
+}
+
+$maintClass = 'SG\Maintenance\RebuildGlossaryCache';
+require_once( RUN_MAINTENANCE_IF_MAIN );
diff --git a/src/Maintenance/GlossaryCacheRebuilder.php 
b/src/Maintenance/GlossaryCacheRebuilder.php
new file mode 100644
index 000..1e78f24
--- /dev/null
+++ b/src/Maintenance/GlossaryCacheRebuilder.php
@@ -0,0 +1,160 @@
+?php
+
+namespace SG\Maintenance;
+
+use SG\PropertyRegistry;
+use SG\CacheHelper;
+
+use SMWUpdateJob as UpdateJob;
+use SMW\Store;
+
+use SMWQuery as Query;
+use SMWSomeProperty as SomeProperty;
+use SMWDIProperty as DIProperty;
+use SMWThingDescription as ThingDescription;
+
+use BagOStuff;
+
+/**
+ * Part of the `rebuildGlossaryCache.php` maintenance script
+ *
+ * @ingroup SG
+ *
+ * @license GNU GPL v2+
+ * @since 1.1
+ *
+ * @author mwjames
+ */
+class GlossaryCacheRebuilder {
+
+   /** @var Store */
+   protected $store;
+
+   /** @var BagOStuff */
+   protected $cache;
+
+   protected $reporter = null;
+   protected $rebuildCount = 0;
+   protected $verbose = false;
+
+   /**
+  

[MediaWiki-commits] [Gerrit] On file pages, only replace the (local) image description wh... - change (mediawiki...VisualEditor)

2014-05-17 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: On file pages, only replace the (local) image description when 
saving
..

On file pages, only replace the (local) image description when saving

Instead of overwriting everything else on the page (including the thumbnail!)

Bug: 65349
Change-Id: Ib6c4928646d6d278e29fbe31ae1902b0dc3b146a
---
M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
1 file changed, 10 insertions(+), 2 deletions(-)


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

diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
index 9b2f02e..24955d4 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
@@ -1514,8 +1514,16 @@
  * @param {string} categoriesHtml Rendered categories HTML from server
  */
 ve.init.mw.ViewPageTarget.prototype.replacePageContent = function ( html, 
categoriesHtml ) {
-   var $content = $( $.parseHTML( html ) );
-   mw.hook( 'wikipage.content' ).fire( $( '#mw-content-text' 
).empty().append( $content ) );
+   var $content = $( $.parseHTML( html ) ), $editableContent;
+
+   if ( $( '#mw-imagepage-content' ).length ) {
+   // On file pages, we only want to replace the (local) 
description.
+   $editableContent = $( '#mw-imagepage-content' );
+   } else {
+   $editableContent = $( '#mw-content-text' );
+   }
+
+   mw.hook( 'wikipage.content' ).fire( $editableContent.empty().append( 
$content ) );
$( '#catlinks' ).replaceWith( categoriesHtml );
 };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib6c4928646d6d278e29fbe31ae1902b0dc3b146a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk kren...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Unstrip strip items of 'general' category before lingo-parsing - change (mediawiki...Lingo)

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

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

Change subject: Unstrip strip items of 'general' category before lingo-parsing
..

Unstrip strip items of 'general' category before lingo-parsing

The unstripping will be done again by the MW parser when the hook used by Lingo 
returns, but it should not hurt to do this twice.
The only problem is with other hook handlers that might not expect strip items 
to be unstripped already.

Bug 55829

Change-Id: I422650da84c07122451e19bf3424ad14f55d07af
---
M LingoHooks.php
1 file changed, 7 insertions(+), 2 deletions(-)


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

diff --git a/LingoHooks.php b/LingoHooks.php
index 06c287a..57942f2 100644
--- a/LingoHooks.php
+++ b/LingoHooks.php
@@ -37,10 +37,15 @@
if ( !isset( $parser-mDoubleUnderscores['noglossary'] )  // 
__NOGLOSSARY__ not present and
(
!$title || // title not set or
-   !isset( $wgexLingoUseNamespaces[$title-getNamespace()] 
) || // namespace not explicitly forbidden 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
)
-   ) { 
+   ) {
+
+   // 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
+   // Only problem is with other hook handlers that might 
not expect strip items to be unstripped already
+   $text = $parser-mStripState-unstripGeneral( $text );
LingoParser::parse( $parser, $text );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I422650da84c07122451e19bf3424ad14f55d07af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott s7ep...@gmail.com

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


[MediaWiki-commits] [Gerrit] Unstrip strip items of 'general' category before lingo-parsing - change (mediawiki...Lingo)

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

Change subject: Unstrip strip items of 'general' category before lingo-parsing
..


Unstrip strip items of 'general' category before lingo-parsing

The unstripping will be done again by the MW parser when the hook used by Lingo 
returns, but it should not hurt to do this twice.
The only problem is with other hook handlers that might not expect strip items 
to be unstripped already.

Bug 55829

Change-Id: I422650da84c07122451e19bf3424ad14f55d07af
---
M LingoHooks.php
1 file changed, 7 insertions(+), 2 deletions(-)

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



diff --git a/LingoHooks.php b/LingoHooks.php
index 06c287a..57942f2 100644
--- a/LingoHooks.php
+++ b/LingoHooks.php
@@ -37,10 +37,15 @@
if ( !isset( $parser-mDoubleUnderscores['noglossary'] )  // 
__NOGLOSSARY__ not present and
(
!$title || // title not set or
-   !isset( $wgexLingoUseNamespaces[$title-getNamespace()] 
) || // namespace not explicitly forbidden 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
)
-   ) { 
+   ) {
+
+   // 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
+   // Only problem is with other hook handlers that might 
not expect strip items to be unstripped already
+   $text = $parser-mStripState-unstripGeneral( $text );
LingoParser::parse( $parser, $text );
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I422650da84c07122451e19bf3424ad14f55d07af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott s7ep...@gmail.com
Gerrit-Reviewer: Foxtrott s7ep...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Consistency tweaks in preparation for adding extension to tr... - change (mediawiki...SiteSettings)

2014-05-17 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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

Change subject: Consistency tweaks in preparation for adding extension to 
translatewiki.net
..

Consistency tweaks in preparation for adding extension to
translatewiki.net

* Help:Subpages is translatable, so use Special:MyLanguage in the link
* Wrap a file name into code/code

Change-Id: I3f7f9e424bb7614f7f87000b12c4f24bf057ecda
---
M i18n/en.json
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SiteSettings 
refs/changes/01/133901/1

diff --git a/i18n/en.json b/i18n/en.json
index 69df455..7f15200 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -13,7 +13,7 @@
 sitesettings-current-gmt: (current GMT time is $1 or $2),
 sitesettings-americandates: Use American-style dates,
 sitesettings-showpageviews: Show count of page views at the bottom of 
each page,
-sitesettings-usesubpages: Use a 
href=\http://www.mediawiki.org/wiki/Help:Subpages\;subpages/a,
+sitesettings-usesubpages: Use a 
href=\https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Subpages\;subpages/a,
 sitesettings-allowexternalimages: Allow external images,
 sitesettings-allowlowercasepagenames: Allow lowercase page names,
 sitesettings-copyrightdesc: Copyright description:,
@@ -52,7 +52,7 @@
 sitesettings-logoremoved: Logo was removed.,
 sitesettings-faviconheader: Favicon file,
 sitesettings-nofavicon: There is no current favicon.,
-sitesettings-uploadfavicon: Upload favicon (it should be called 
\favicon.ico\):,
+sitesettings-uploadfavicon: Upload favicon (it should be called 
\codefavicon.ico/code\):,
 sitesettings-currentfavicon: Current favicon:,
 sitesettings-removefavicon: Remove favicon,
 sitesettings-changefavicon: Change favicon:,

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

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

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


[MediaWiki-commits] [Gerrit] Add package dependencies from wikimedia-task-appserver - change (operations/puppet)

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

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

Change subject: Add package dependencies from wikimedia-task-appserver
..

Add package dependencies from wikimedia-task-appserver

The appserver package is difficult to maintain and largely obsolete. By
declaring package dependencies in Puppet, we can get rid of the package.

Change-Id: I4e2dee8aa46dec59c4245dde2a8e0994abadffb0
---
M modules/applicationserver/manifests/packages.pp
1 file changed, 59 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/03/133903/1

diff --git a/modules/applicationserver/manifests/packages.pp 
b/modules/applicationserver/manifests/packages.pp
index 12342eb..c72d1df 100644
--- a/modules/applicationserver/manifests/packages.pp
+++ b/modules/applicationserver/manifests/packages.pp
@@ -1,20 +1,28 @@
 # application server required packages
 class applicationserver::packages {
-
-package { [ 'libapache2-mod-php5', 'php5-common', 'php5-cli', 
'libmemcached11' ]:
-ensure = latest,
+package { [
+'apache2-mpm-prefork',
+'libapache2-mod-php5',
+'libmemcached11',
+'php-apc',
+'php-pear',
+'php5-cli',
+'php5-common',
+]:
+ensure = present,
 }
 
 # Standard PHP extensions
 package { [
 'php5-curl',
+'php5-geoip',
 'php5-intl',
 'php5-memcached',
 'php5-mysql',
 'php5-redis',
 'php5-xmlrpc',
 ]:
-ensure = latest,
+ensure = present,
 }
 
 # Wikimedia-specific PHP extensions
@@ -24,7 +32,7 @@
 'php5-wmerrors',
 'php5-fss',
 ]:
-ensure = latest,
+ensure = present,
 }
 
 # Pear modules
@@ -32,6 +40,51 @@
 'php-mail',
 'php-mail-mime',
 ]:
-ensure = latest,
+ensure = present,
+}
+
+# TeX packages
+package { [
+'texlive',
+'texlive-bibtex-extra',
+'texlive-font-utils',
+'texlive-fonts-extra',
+'texlive-lang-all',
+'texlive-latex-extra',
+'texlive-math-extra',
+'texlive-pictures',
+'texlive-pstricks',
+'texlive-publishers',
+]:
+ensure = present,
+}
+
+# Math
+package { [
+'dvipng',
+'gsfonts',
+'make',
+'ocaml',
+'ploticus',
+]:
+ensure = present,
+}
+
+# PDF and DjVu
+package { [
+'djvulibre-bin',
+'librsvg2-bin',
+'libtiff-tools',
+'xpdf-utils',
+]:
+ensure = present,
+}
+
+# Tidy
+package { [
+'libtidy-0.99-0',
+'tidy',
+]:
+ensure = present,
 }
 }

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

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

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


[MediaWiki-commits] [Gerrit] Delete applicationserver::cron - change (operations/puppet)

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

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

Change subject: Delete applicationserver::cron
..

Delete applicationserver::cron

I determined that the cron job was unnecessary by watching /tmp on the app
servers over the course of 24H.

Change-Id: I5f20c2ccc8ca7a4953ee220d425d20cada1a9b43
---
D modules/applicationserver/manifests/cron.pp
M modules/applicationserver/manifests/init.pp
2 files changed, 0 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/02/133902/1

diff --git a/modules/applicationserver/manifests/cron.pp 
b/modules/applicationserver/manifests/cron.pp
deleted file mode 100644
index 3e30600..000
--- a/modules/applicationserver/manifests/cron.pp
+++ /dev/null
@@ -1,10 +0,0 @@
-# application server required cron jobs
-class applicationserver::cron {
-cron { 'cleantmpphp':
-ensure  = present,
-command = 'find /tmp -name php* -type f -ctime +1 -exec rm -f {} 
\\;',
-user= root,
-hour= 5,
-minute  = 0,
-}
-}
diff --git a/modules/applicationserver/manifests/init.pp 
b/modules/applicationserver/manifests/init.pp
index d31e4f2..a095e90 100644
--- a/modules/applicationserver/manifests/init.pp
+++ b/modules/applicationserver/manifests/init.pp
@@ -1,6 +1,5 @@
 class applicationserver {
 include applicationserver::config::base
-include applicationserver::cron
 include applicationserver::service
 include applicationserver::sudo
 }

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

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

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


[MediaWiki-commits] [Gerrit] Delete applicationserver::cron - change (operations/puppet)

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

Change subject: Delete applicationserver::cron
..


Delete applicationserver::cron

I determined that the cron job was unnecessary by watching /tmp on the app
servers over the course of 24H.

Change-Id: I5f20c2ccc8ca7a4953ee220d425d20cada1a9b43
---
D modules/applicationserver/manifests/cron.pp
M modules/applicationserver/manifests/init.pp
2 files changed, 0 insertions(+), 11 deletions(-)

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



diff --git a/modules/applicationserver/manifests/cron.pp 
b/modules/applicationserver/manifests/cron.pp
deleted file mode 100644
index 3e30600..000
--- a/modules/applicationserver/manifests/cron.pp
+++ /dev/null
@@ -1,10 +0,0 @@
-# application server required cron jobs
-class applicationserver::cron {
-cron { 'cleantmpphp':
-ensure  = present,
-command = 'find /tmp -name php* -type f -ctime +1 -exec rm -f {} 
\\;',
-user= root,
-hour= 5,
-minute  = 0,
-}
-}
diff --git a/modules/applicationserver/manifests/init.pp 
b/modules/applicationserver/manifests/init.pp
index d31e4f2..a095e90 100644
--- a/modules/applicationserver/manifests/init.pp
+++ b/modules/applicationserver/manifests/init.pp
@@ -1,6 +1,5 @@
 class applicationserver {
 include applicationserver::config::base
-include applicationserver::cron
 include applicationserver::service
 include applicationserver::sudo
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5f20c2ccc8ca7a4953ee220d425d20cada1a9b43
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add package dependencies from wikimedia-task-appserver - change (operations/puppet)

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

Change subject: Add package dependencies from wikimedia-task-appserver
..


Add package dependencies from wikimedia-task-appserver

The appserver package is difficult to maintain and largely obsolete. By
declaring package dependencies in Puppet, we can get rid of the package.

Change-Id: I4e2dee8aa46dec59c4245dde2a8e0994abadffb0
---
M modules/applicationserver/manifests/packages.pp
1 file changed, 59 insertions(+), 6 deletions(-)

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



diff --git a/modules/applicationserver/manifests/packages.pp 
b/modules/applicationserver/manifests/packages.pp
index 12342eb..c72d1df 100644
--- a/modules/applicationserver/manifests/packages.pp
+++ b/modules/applicationserver/manifests/packages.pp
@@ -1,20 +1,28 @@
 # application server required packages
 class applicationserver::packages {
-
-package { [ 'libapache2-mod-php5', 'php5-common', 'php5-cli', 
'libmemcached11' ]:
-ensure = latest,
+package { [
+'apache2-mpm-prefork',
+'libapache2-mod-php5',
+'libmemcached11',
+'php-apc',
+'php-pear',
+'php5-cli',
+'php5-common',
+]:
+ensure = present,
 }
 
 # Standard PHP extensions
 package { [
 'php5-curl',
+'php5-geoip',
 'php5-intl',
 'php5-memcached',
 'php5-mysql',
 'php5-redis',
 'php5-xmlrpc',
 ]:
-ensure = latest,
+ensure = present,
 }
 
 # Wikimedia-specific PHP extensions
@@ -24,7 +32,7 @@
 'php5-wmerrors',
 'php5-fss',
 ]:
-ensure = latest,
+ensure = present,
 }
 
 # Pear modules
@@ -32,6 +40,51 @@
 'php-mail',
 'php-mail-mime',
 ]:
-ensure = latest,
+ensure = present,
+}
+
+# TeX packages
+package { [
+'texlive',
+'texlive-bibtex-extra',
+'texlive-font-utils',
+'texlive-fonts-extra',
+'texlive-lang-all',
+'texlive-latex-extra',
+'texlive-math-extra',
+'texlive-pictures',
+'texlive-pstricks',
+'texlive-publishers',
+]:
+ensure = present,
+}
+
+# Math
+package { [
+'dvipng',
+'gsfonts',
+'make',
+'ocaml',
+'ploticus',
+]:
+ensure = present,
+}
+
+# PDF and DjVu
+package { [
+'djvulibre-bin',
+'librsvg2-bin',
+'libtiff-tools',
+'xpdf-utils',
+]:
+ensure = present,
+}
+
+# Tidy
+package { [
+'libtidy-0.99-0',
+'tidy',
+]:
+ensure = present,
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4e2dee8aa46dec59c4245dde2a8e0994abadffb0
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add type hint in ApiClientInfo + fix test - change (mediawiki...Wikibase)

2014-05-17 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Add type hint in ApiClientInfo + fix test
..

Add type hint in ApiClientInfo + fix test

For compatibility with Ie6bf191 in core, though this
change also works ok with earlier versions of MediaWiki core.

Bug: 65440
Change-Id: Icd9627bc6fec90216d91949492db74b547eba83e
---
M client/includes/api/ApiClientInfo.php
M client/tests/phpunit/includes/api/ApiClientInfoTest.php
2 files changed, 6 insertions(+), 3 deletions(-)


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

diff --git a/client/includes/api/ApiClientInfo.php 
b/client/includes/api/ApiClientInfo.php
index b677080..cb4d714 100644
--- a/client/includes/api/ApiClientInfo.php
+++ b/client/includes/api/ApiClientInfo.php
@@ -3,6 +3,7 @@
 namespace Wikibase;
 
 use ApiBase;
+use ApiQuery;
 use Wikibase\Client\WikibaseClient;
 
 /**
@@ -25,10 +26,10 @@
/**
 * @since 0.4
 *
-* @param ApiBase $api
+* @param ApiQuery $api
 * @param string $moduleName
 */
-   public function __construct( $api, $moduleName ) {
+   public function __construct( ApiQuery $api, $moduleName ) {
parent::__construct( $api, $moduleName, 'wb' );
 
// @todo inject this instead of using singleton here
diff --git a/client/tests/phpunit/includes/api/ApiClientInfoTest.php 
b/client/tests/phpunit/includes/api/ApiClientInfoTest.php
index 1536c75..3dd37bf 100644
--- a/client/tests/phpunit/includes/api/ApiClientInfoTest.php
+++ b/client/tests/phpunit/includes/api/ApiClientInfoTest.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Test;
 
+use ApiQuery;
 use Wikibase\SettingsArray;
 use Wikibase\ApiClientInfo;
 
@@ -36,8 +37,9 @@
 
$context = $this-apiContext-newTestContext( $request, $user );
$apiMain = new \ApiMain( $context, true );
+   $apiQuery = new ApiQuery( $apiMain, 'wikibase' );
 
-   $apiModule = new ApiClientInfo( $apiMain, 'query' );
+   $apiModule = new ApiClientInfo( $apiQuery, 'query' );
$apiModule-setSettings( $settings );
 
return $apiModule;

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

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

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


[MediaWiki-commits] [Gerrit] Cleanup in ApiClientInfo and test - change (mediawiki...Wikibase)

2014-05-17 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Cleanup in ApiClientInfo and test
..

Cleanup in ApiClientInfo and test

Change-Id: I4814e119f14ed4b7b4123b83ea357fbce9e5c74e
---
M client/includes/api/ApiClientInfo.php
M client/tests/phpunit/includes/api/ApiClientInfoTest.php
2 files changed, 19 insertions(+), 7 deletions(-)


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

diff --git a/client/includes/api/ApiClientInfo.php 
b/client/includes/api/ApiClientInfo.php
index cb4d714..c05e0dc 100644
--- a/client/includes/api/ApiClientInfo.php
+++ b/client/includes/api/ApiClientInfo.php
@@ -4,6 +4,7 @@
 
 use ApiBase;
 use ApiQuery;
+use ApiQueryBase;
 use Wikibase\Client\WikibaseClient;
 
 /**
@@ -16,7 +17,7 @@
  * @licence GNU GPL v2+
  * @author Katie Filbert  aude.w...@gmail.com 
  */
-class ApiClientInfo extends \ApiQueryBase {
+class ApiClientInfo extends ApiQueryBase {
 
/**
 * @var SettingsArray
@@ -154,7 +155,7 @@
/**
 * @see ApiBase::getDescription
 *
-* @since 0.4i
+* @since 0.4
 *
 * @return string
 */
diff --git a/client/tests/phpunit/includes/api/ApiClientInfoTest.php 
b/client/tests/phpunit/includes/api/ApiClientInfoTest.php
index 3dd37bf..b8e94cf 100644
--- a/client/tests/phpunit/includes/api/ApiClientInfoTest.php
+++ b/client/tests/phpunit/includes/api/ApiClientInfoTest.php
@@ -2,7 +2,12 @@
 
 namespace Wikibase\Test;
 
+use ApiMain;
+use ApiTestContext;
 use ApiQuery;
+use FauxRequest;
+use MediaWikiTestCase;
+use User;
 use Wikibase\SettingsArray;
 use Wikibase\ApiClientInfo;
 
@@ -20,23 +25,29 @@
  * @licence GNU GPL v2+
  * @author Katie Filbert  aude.w...@gmail.com 
  */
-class ApiClientInfoTest extends \MediaWikiTestCase {
+class ApiClientInfoTest extends MediaWikiTestCase {
 
protected $apiContext;
 
public function setUp() {
parent::setUp();
 
-   $this-apiContext = new \ApiTestContext();
+   $this-apiContext = new ApiTestContext();
}
 
+   /**
+* @param array $params
+* @param SettingsArray $settings
+*
+* @return ApiClientInfo
+*/
public function getApiModule( array $params, SettingsArray $settings ) {
-   $request = new \FauxRequest( $params, true );
+   $request = new FauxRequest( $params, true );
 
-   $user = \User::newFromName( 'zombie' );
+   $user = User::newFromName( 'zombie' );
 
$context = $this-apiContext-newTestContext( $request, $user );
-   $apiMain = new \ApiMain( $context, true );
+   $apiMain = new ApiMain( $context, true );
$apiQuery = new ApiQuery( $apiMain, 'wikibase' );
 
$apiModule = new ApiClientInfo( $apiQuery, 'query' );

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

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

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


[MediaWiki-commits] [Gerrit] Express additional package dependencies of wikimedia-task-ap... - change (operations/puppet)

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

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

Change subject: Express additional package dependencies of 
wikimedia-task-appserver
..

Express additional package dependencies of wikimedia-task-appserver

* Add lilipond, imagemagick, libmemcached10
* Replace xpdf-utils (which is deprecated and transitional) with its
  replacement, poppler-utils.

Change-Id: Ib3dd521005f8b4cb9eea57ae3f5e6380b7dcd0ca
---
M modules/applicationserver/manifests/packages.pp
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/06/133906/1

diff --git a/modules/applicationserver/manifests/packages.pp 
b/modules/applicationserver/manifests/packages.pp
index c72d1df..9b26085 100644
--- a/modules/applicationserver/manifests/packages.pp
+++ b/modules/applicationserver/manifests/packages.pp
@@ -2,7 +2,9 @@
 class applicationserver::packages {
 package { [
 'apache2-mpm-prefork',
+'imagemagick',
 'libapache2-mod-php5',
+'libmemcached10',   # XXX still needed?
 'libmemcached11',
 'php-apc',
 'php-pear',
@@ -75,11 +77,16 @@
 'djvulibre-bin',
 'librsvg2-bin',
 'libtiff-tools',
-'xpdf-utils',
+'poppler-utils',
 ]:
 ensure = present,
 }
 
+# Score
+package { 'lilipond':
+ensure = present,
+}
+
 # Tidy
 package { [
 'libtidy-0.99-0',

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

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

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


[MediaWiki-commits] [Gerrit] Express additional package dependencies of wikimedia-task-ap... - change (operations/puppet)

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

Change subject: Express additional package dependencies of 
wikimedia-task-appserver
..


Express additional package dependencies of wikimedia-task-appserver

* Add lilipond, imagemagick, libmemcached10
* Replace xpdf-utils (which is deprecated and transitional) with its
  replacement, poppler-utils.

Change-Id: Ib3dd521005f8b4cb9eea57ae3f5e6380b7dcd0ca
---
M modules/applicationserver/manifests/packages.pp
1 file changed, 8 insertions(+), 1 deletion(-)

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



diff --git a/modules/applicationserver/manifests/packages.pp 
b/modules/applicationserver/manifests/packages.pp
index c72d1df..9b26085 100644
--- a/modules/applicationserver/manifests/packages.pp
+++ b/modules/applicationserver/manifests/packages.pp
@@ -2,7 +2,9 @@
 class applicationserver::packages {
 package { [
 'apache2-mpm-prefork',
+'imagemagick',
 'libapache2-mod-php5',
+'libmemcached10',   # XXX still needed?
 'libmemcached11',
 'php-apc',
 'php-pear',
@@ -75,11 +77,16 @@
 'djvulibre-bin',
 'librsvg2-bin',
 'libtiff-tools',
-'xpdf-utils',
+'poppler-utils',
 ]:
 ensure = present,
 }
 
+# Score
+package { 'lilipond':
+ensure = present,
+}
+
 # Tidy
 package { [
 'libtidy-0.99-0',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib3dd521005f8b4cb9eea57ae3f5e6380b7dcd0ca
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Correct typo in lilypond package name - change (operations/puppet)

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

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

Change subject: Correct typo in lilypond package name
..

Correct typo in lilypond package name

Introduced in Ib3dd52100.

Change-Id: Ib721b6a96c07bae8b4ad29e65d0787a6110a0696
---
M modules/applicationserver/manifests/packages.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/08/133908/1

diff --git a/modules/applicationserver/manifests/packages.pp 
b/modules/applicationserver/manifests/packages.pp
index 9b26085..27e804d 100644
--- a/modules/applicationserver/manifests/packages.pp
+++ b/modules/applicationserver/manifests/packages.pp
@@ -83,7 +83,7 @@
 }
 
 # Score
-package { 'lilipond':
+package { 'lilypond':
 ensure = present,
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] Correct typo in lilypond package name - change (operations/puppet)

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

Change subject: Correct typo in lilypond package name
..


Correct typo in lilypond package name

Introduced in Ib3dd52100.

Change-Id: Ib721b6a96c07bae8b4ad29e65d0787a6110a0696
---
M modules/applicationserver/manifests/packages.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/applicationserver/manifests/packages.pp 
b/modules/applicationserver/manifests/packages.pp
index 9b26085..27e804d 100644
--- a/modules/applicationserver/manifests/packages.pp
+++ b/modules/applicationserver/manifests/packages.pp
@@ -83,7 +83,7 @@
 }
 
 # Score
-package { 'lilipond':
+package { 'lilypond':
 ensure = present,
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] Remove duplicate packages from imagescaler manifest - change (operations/puppet)

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

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

Change subject: Remove duplicate packages from imagescaler manifest
..

Remove duplicate packages from imagescaler manifest

* Remove gsfonts, imagemagick, librsvg2-bin, djvulibre-bin from imagescaler
  manifest, as these packages are part of applicationserver::packages.
* Eradicate leftover references to applicationserver::cron

Change-Id: I05167ff6465496b4c425cb9ae1e6c618ba7b8476
---
M manifests/imagescaler.pp
M manifests/role/applicationserver.pp
2 files changed, 0 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/32/133932/1

diff --git a/manifests/imagescaler.pp b/manifests/imagescaler.pp
index 85767d3..e3813b8 100644
--- a/manifests/imagescaler.pp
+++ b/manifests/imagescaler.pp
@@ -21,12 +21,9 @@
 
 package {
 [
-'imagemagick',
 'ghostscript',
 'ffmpeg',
 'ffmpeg2theora',
-'librsvg2-bin',
-'djvulibre-bin',
 'netpbm',
 'libogg0',
 'libvorbisenc2',
@@ -72,7 +69,6 @@
 'fonts-unfonts-extra',
 'fonts-vlgothic', # bug 64002
 
-'gsfonts',
 'texlive-fonts-recommended',
 
 'ttf-alee',
diff --git a/manifests/role/applicationserver.pp 
b/manifests/role/applicationserver.pp
index 71661fd..e251809 100644
--- a/manifests/role/applicationserver.pp
+++ b/manifests/role/applicationserver.pp
@@ -239,7 +239,6 @@
 
 include applicationserver::config::base,
 applicationserver::packages,
-applicationserver::cron,
 applicationserver::sudo,
 role::applicationserver::configuration::php
 
@@ -275,7 +274,6 @@
 
 include applicationserver::config::base,
 applicationserver::packages,
-applicationserver::cron,
 applicationserver::sudo,
 role::applicationserver::configuration::php
 
@@ -295,7 +293,6 @@
 
 include applicationserver::config::base,
 applicationserver::packages,
-applicationserver::cron,
 applicationserver::sudo,
 role::applicationserver::configuration::php
 }

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

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

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


[MediaWiki-commits] [Gerrit] Remove duplicate packages from imagescaler manifest - change (operations/puppet)

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

Change subject: Remove duplicate packages from imagescaler manifest
..


Remove duplicate packages from imagescaler manifest

* Remove gsfonts, imagemagick, librsvg2-bin, djvulibre-bin from imagescaler
  manifest, as these packages are part of applicationserver::packages.
* Eradicate leftover references to applicationserver::cron

Change-Id: I05167ff6465496b4c425cb9ae1e6c618ba7b8476
---
M manifests/imagescaler.pp
M manifests/role/applicationserver.pp
2 files changed, 0 insertions(+), 7 deletions(-)

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



diff --git a/manifests/imagescaler.pp b/manifests/imagescaler.pp
index 85767d3..e3813b8 100644
--- a/manifests/imagescaler.pp
+++ b/manifests/imagescaler.pp
@@ -21,12 +21,9 @@
 
 package {
 [
-'imagemagick',
 'ghostscript',
 'ffmpeg',
 'ffmpeg2theora',
-'librsvg2-bin',
-'djvulibre-bin',
 'netpbm',
 'libogg0',
 'libvorbisenc2',
@@ -72,7 +69,6 @@
 'fonts-unfonts-extra',
 'fonts-vlgothic', # bug 64002
 
-'gsfonts',
 'texlive-fonts-recommended',
 
 'ttf-alee',
diff --git a/manifests/role/applicationserver.pp 
b/manifests/role/applicationserver.pp
index 71661fd..e251809 100644
--- a/manifests/role/applicationserver.pp
+++ b/manifests/role/applicationserver.pp
@@ -239,7 +239,6 @@
 
 include applicationserver::config::base,
 applicationserver::packages,
-applicationserver::cron,
 applicationserver::sudo,
 role::applicationserver::configuration::php
 
@@ -275,7 +274,6 @@
 
 include applicationserver::config::base,
 applicationserver::packages,
-applicationserver::cron,
 applicationserver::sudo,
 role::applicationserver::configuration::php
 
@@ -295,7 +293,6 @@
 
 include applicationserver::config::base,
 applicationserver::packages,
-applicationserver::cron,
 applicationserver::sudo,
 role::applicationserver::configuration::php
 }

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

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

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 191fb5e..825749a - change (mediawiki/extensions)

2014-05-17 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has uploaded a new change for review.

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

Change subject: Syncronize VisualEditor: 191fb5e..825749a
..

Syncronize VisualEditor: 191fb5e..825749a

Change-Id: Ib9aeb778e0a125e7fb6bd9756f3b44b648b24922
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/VisualEditor b/VisualEditor
index 191fb5e..825749a 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 191fb5e1f1108f042d141e767b10efb556d9739d
+Subproject commit 825749a52f121eb2b8974ecfa70b5bbbc86f9b77

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9aeb778e0a125e7fb6bd9756f3b44b648b24922
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 191fb5e..825749a - change (mediawiki/extensions)

2014-05-17 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has submitted this change and it was merged.

Change subject: Syncronize VisualEditor: 191fb5e..825749a
..


Syncronize VisualEditor: 191fb5e..825749a

Change-Id: Ib9aeb778e0a125e7fb6bd9756f3b44b648b24922
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Jenkins-mwext-sync: Verified; Looks good to me, approved



diff --git a/VisualEditor b/VisualEditor
index 191fb5e..825749a 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 191fb5e1f1108f042d141e767b10efb556d9739d
+Subproject commit 825749a52f121eb2b8974ecfa70b5bbbc86f9b77

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib9aeb778e0a125e7fb6bd9756f3b44b648b24922
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org
Gerrit-Reviewer: Jenkins-mwext-sync jenkins-...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Support unit-less quantity values - change (pywikibot/core)

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

Change subject: Support unit-less quantity values
..


Support unit-less quantity values

The class WbQuantity works similar to WbTime. Currently only unit-less
quantities are supported.

Values are being 'converted' the way the API expects resp. responds.

Change-Id: I0a81f8c17f5f5b1b977f4d8054acb5a0574816e1
---
M pywikibot/__init__.py
M pywikibot/page.py
M tests/wikibase_tests.py
3 files changed, 71 insertions(+), 0 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index ff2f61a..1709b0e 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -313,6 +313,64 @@
 utimezone=%(timezone)d, calendarmodel='%(calendarmodel)s') % 
self.__dict__
 
 
+class WbQuantity(object):
+ A Wikibase quantity representation
+
+def __init__(self, amount, unit=None, error=None):
+
+Creates a new WbQuantity object. The amount is a number representing
+this quantity. The unit is currently not used (only unit-less
+quantities are supported). The error is a number indicating the
+uncertainty of the amount (e.g. ±1). Alternatively the error can be
+expressed as a tuple, where the first value is the upper error and the
+second is the lower error value.
+
+if amount is None:
+raise ValueError('no amount given')
+if unit is not None and unit != '1':
+raise NotImplementedError('Currently only unit-less quantities are 
supported')
+if unit is None:
+unit = '1'
+self.amount = long(amount)
+self.unit = unit
+upperError = lowerError = 0
+if isinstance(error, tuple):
+upperError, lowerError = error
+elif error is not None:
+upperError = lowerError = error
+self.upperBound = self.amount + upperError
+self.lowerBound = self.amount - lowerError
+
+def toWikibase(self):
+
+Function which converts the data to a JSON object
+for the Wikibase API.
+
+json = {'amount': self.amount,
+'upperBound': self.upperBound,
+'lowerBound': self.lowerBound,
+'unit': self.unit
+}
+return json
+
+@staticmethod
+def fromWikibase(wb):
+amount = long(wb[u'amount'])
+upperBound = long(wb[u'upperBound'])
+lowerBound = long(wb[u'lowerBound'])
+error = (upperBound - amount, amount - lowerBound)
+return WbQuantity(amount, wb[u'unit'], error)
+
+def __str__(self):
+return str(self.toWikibase())
+
+def __eq__(self, other):
+return self.__dict__ == other.__dict__
+
+def __repr__(self):
+return uWbQuantity(amount=%(amount)d, upperBound=%(upperBound)d, 
lowerBound=%(lowerBound)d, unit=%(unit)s % self.__dict__
+
+
 def deprecated(instead=None):
 Decorator to output a method deprecation warning.
 
diff --git a/pywikibot/page.py b/pywikibot/page.py
index fe54ef6..b69d3d1 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -2886,6 +2886,9 @@
 elif claim.getType() == 'time':
 claim.target = pywikibot.WbTime.fromWikibase(
 data['mainsnak']['datavalue']['value'])
+elif claim.getType() == 'quantity':
+claim.target = pywikibot.WbQuantity.fromWikibase(
+data['mainsnak']['datavalue']['value'])
 else:
 # This covers string, url types
 claim.target = data['mainsnak']['datavalue']['value']
@@ -3069,6 +3072,8 @@
 value = self.getTarget().toWikibase()
 elif self.getType() == 'time':
 value = self.getTarget().toWikibase()
+elif self.getType() == 'quantity':
+value = self.getTarget().toWikibase()
 else:
 raise NotImplementedError('%s datatype is not supported yet.'
   % self.getType())
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index 4b6af74..5183b46 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -52,6 +52,14 @@
 self.assertRaises(ValueError, pywikibot.WbTime, site=wikidata, 
precision=15)
 self.assertRaises(ValueError, pywikibot.WbTime, site=wikidata, 
precision='invalid_precision')
 
+# test WbQuantity
+q = pywikibot.WbQuantity(amount=1234, error=1)
+self.assertEqual(q.toWikibase(), {'amount': 1234, 'lowerBound': 1233, 
'upperBound': 1235, 'unit': '1', })
+q = pywikibot.WbQuantity(amount=5, error=(2, 3))
+self.assertEqual(q.toWikibase(), {'amount': 5, 'lowerBound': 2, 
'upperBound': 7, 'unit': '1', })
+self.assertRaises(ValueError, pywikibot.WbQuantity, amount=None, 
error=1)
+  

[MediaWiki-commits] [Gerrit] Update API doc: replace deprecated language code - change (mediawiki...Wikibase)

2014-05-17 Thread Danmichaelo (Code Review)
Danmichaelo has uploaded a new change for review.

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

Change subject: Update API doc: replace deprecated language code
..

Update API doc: replace deprecated language code

Replacing 'no' with 'nb' in an example, since 'no'
is deprecated on Wikidata. See
https://www.wikidata.org/wiki/Wikidata:Project_chat/Archive/2014/05#.27als.27.2F.27gsw.27.3F_.27de-formal.27.3F

Change-Id: I9be0981e68ecc39f31895d19d8d6bf88a1ad4cd5
---
M repo/includes/api/EditEntity.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/repo/includes/api/EditEntity.php b/repo/includes/api/EditEntity.php
index 93e5473..55e2790 100644
--- a/repo/includes/api/EditEntity.php
+++ b/repo/includes/api/EditEntity.php
@@ -808,8 +808,8 @@
// Setting stuff

'api.php?action=wbeditentityid=Q42data={sitelinks:{nowiki:{site:nowiki,title:København}}}'
= 'Sets sitelink for nowiki, overwriting it if it 
already exists',
-   
'api.php?action=wbeditentityid=Q42data={descriptions:{no:{language:no,value:no-Description-Here}}}'
-   = 'Sets description for no, overwriting it if it 
already exists',
+   
'api.php?action=wbeditentityid=Q42data={descriptions:{nb:{language:nb,value:nb-Description-Here}}}'
+   = 'Sets description for nb, overwriting it if it 
already exists',

'api.php?action=wbeditentityid=Q42data={claims:[{mainsnak:{snaktype:value,property:P56,datavalue:{value:ExampleString,type:string}},type:statement,rank:normal}]}'
= 'Creates a new claim on the item for the property 
P56 and a value of ExampleString',

'api.php?action=wbeditentityid=Q42data={claims:[{id:Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F,remove:},{id:Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X,remove:}]}'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9be0981e68ecc39f31895d19d8d6bf88a1ad4cd5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Danmichaelo danmicha...@gmail.com

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


[MediaWiki-commits] [Gerrit] Make History list searchable - change (apps...wikipedia)

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

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

Change subject: Make History list searchable
..

Make History list searchable

Change-Id: I78063d4b3531511c754936fa8f2d4b73423b7893
---
M wikipedia/AndroidManifest.xml
M wikipedia/res/layout/activity_history.xml
M wikipedia/res/values-qq/strings.xml
M wikipedia/res/values/strings.xml
M wikipedia/src/main/java/org/wikipedia/history/HistoryActivity.java
5 files changed, 77 insertions(+), 22 deletions(-)


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

diff --git a/wikipedia/AndroidManifest.xml b/wikipedia/AndroidManifest.xml
index 749126d..55584f6 100644
--- a/wikipedia/AndroidManifest.xml
+++ b/wikipedia/AndroidManifest.xml
@@ -39,6 +39,7 @@
 android:name=.history.HistoryActivity
 android:label=@string/history_activity_title
 
android:configChanges=orientation|keyboardHidden|keyboard|screenSize
+android:windowSoftInputMode=stateHidden|adjustResize
 
 /activity
 
diff --git a/wikipedia/res/layout/activity_history.xml 
b/wikipedia/res/layout/activity_history.xml
index 9604e4d..443d249 100644
--- a/wikipedia/res/layout/activity_history.xml
+++ b/wikipedia/res/layout/activity_history.xml
@@ -10,10 +10,26 @@
 android:gravity=center
 android:text=@string/history_empty_message
 /
-ListView
-android:id=@+id/history_entry_list
-android:layout_width=match_parent
-android:layout_height=match_parent
-/
+LinearLayout
+android:orientation=vertical
+android:layout_width=match_parent
+android:layout_height=wrap_content
+
+org.wikipedia.styledviews.StyledEditText
+android:layout_width=match_parent
+android:layout_height=48dp
+android:id=@+id/history_search_list
+android:hint=@string/history_search_list_hint
+android:imeOptions=actionDone
+android:singleLine=true
+android:layout_marginLeft=8dp
+android:layout_marginRight=8dp
+/
+ListView
+android:id=@+id/history_entry_list
+android:layout_width=match_parent
+android:layout_height=match_parent
+/
+/LinearLayout
 
 /FrameLayout
\ No newline at end of file
diff --git a/wikipedia/res/values-qq/strings.xml 
b/wikipedia/res/values-qq/strings.xml
index be50778..cdba333 100644
--- a/wikipedia/res/values-qq/strings.xml
+++ b/wikipedia/res/values-qq/strings.xml
@@ -126,4 +126,6 @@
   string name=edit_save_action_ip_descriptionDescription for action that 
takes user to login screen so they can login before saving an edit/string
   string name=preference_title_eventlogging_opt_inTitle of preference that 
when checked enables data collection of user behavior./string
   string name=preference_summary_eventlogging_opt_inDescription of 
preference that when checked enables data collection of user behavior./string
+  string name=history_search_list_hintHint for textbox that searches list 
of items in browsing history as user typesj/string
+  string name=history_search_empty_messageMessage shown when no history 
itmes were found that match the user\'s query. %s is replaced with the query 
string./string
 /resources
diff --git a/wikipedia/res/values/strings.xml b/wikipedia/res/values/strings.xml
index cf3a5e2..2805956 100644
--- a/wikipedia/res/values/strings.xml
+++ b/wikipedia/res/values/strings.xml
@@ -133,4 +133,6 @@
 string name=preference_title_eventlogging_opt_inSend usage 
reports/string
 string name=preference_summary_eventlogging_opt_inAllow Wikimedia to 
collect information about how you use the app to make the app better/string
 string name=editing_error_spamblacklistLinks from blocked domains (%s) 
detected. Please remove them and try again./string
+string name=history_search_list_hintSearch/string
+string name=history_search_empty_messageNo pages found matching 
\'%s\'/string
 /resources
diff --git a/wikipedia/src/main/java/org/wikipedia/history/HistoryActivity.java 
b/wikipedia/src/main/java/org/wikipedia/history/HistoryActivity.java
index 310b288..c4c1806 100644
--- a/wikipedia/src/main/java/org/wikipedia/history/HistoryActivity.java
+++ b/wikipedia/src/main/java/org/wikipedia/history/HistoryActivity.java
@@ -10,6 +10,8 @@
 import android.support.v4.content.Loader;
 import android.support.v4.widget.CursorAdapter;
 import android.support.v7.app.*;
+import android.text.Editable;
+import android.text.TextWatcher;
 import android.view.*;
 import android.widget.*;
 import com.squareup.picasso.*;
@@ -22,8 +24,9 @@
 
 public class HistoryActivity extends ActionBarActivity implements 
LoaderManager.LoaderCallbacksCursor {
 private ListView 

[MediaWiki-commits] [Gerrit] jquery.textSelection: Don't throw errors on empty collections - change (mediawiki/core)

2014-05-17 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

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

Change subject: jquery.textSelection: Don't throw errors on empty collections
..

jquery.textSelection: Don't throw errors on empty collections

All jQuery functions just do nothing or return empty values when
called on an empty collection (e.g. `$()`), the ones defined in this
module should behave in the same way.

This came to light when a change in WikiEditor combined with lousy
coding caused this code path to be called, breaking various gadgets
and extensions like SemanticForms.

Bug: 64289
Change-Id: Ib97f47ef1d66420682bd429c9c12e66c3392e77d
(cherry picked from commit 2828669dd40f63f60c2391b6d5ee30a3e255f3db)
---
M resources/src/jquery/jquery.textSelection.js
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/resources/src/jquery/jquery.textSelection.js 
b/resources/src/jquery/jquery.textSelection.js
index 7262fe6..4540fb0 100644
--- a/resources/src/jquery/jquery.textSelection.js
+++ b/resources/src/jquery/jquery.textSelection.js
@@ -70,7 +70,7 @@
var retval, range,
el = this.get( 0 );
 
-   if ( $(el).is( ':hidden' ) ) {
+   if ( !el || $( el ).is( ':hidden' ) ) {
retval = '';
} else if ( document.selection  
document.selection.createRange ) {
activateElementOnIE( el );
@@ -279,7 +279,7 @@
// Range containing text after 
the selection
postRange;
 
-   if ( document.selection  
document.selection.createRange ) {
+   if ( e  document.selection  
document.selection.createRange ) {
// IE doesn't properly report 
non-selected caret position through
// the selection ranges when 
textarea isn't focused. This can
// lead to saving a bogus empty 
selection, which then screws up
@@ -349,7 +349,7 @@
} while ( ( !preFinished || 
!periFinished || !postFinished ) );
caretPos = rawPreText.replace( 
/\r\n/g, '\n' ).length;
endPos = caretPos + 
rawPeriText.replace( /\r\n/g, '\n' ).length;
-   } else if ( e.selectionStart || 
e.selectionStart === 0 ) {
+   } else if ( e  ( e.selectionStart || 
e.selectionStart === 0 ) ) {
// Firefox support
caretPos = e.selectionStart;
endPos = e.selectionEnd;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib97f47ef1d66420682bd429c9c12e66c3392e77d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_23
Gerrit-Owner: TheDJ hartman.w...@gmail.com
Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com

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


[MediaWiki-commits] [Gerrit] Clarify fileexists-extension message - change (mediawiki/core)

2014-05-17 Thread Brian Wolff (Code Review)
Brian Wolff has uploaded a new change for review.

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

Change subject: Clarify fileexists-extension message
..

Clarify fileexists-extension message

The message is a warning, the user can chose to ignore it, and
there are valid cases for ignoring it. However the message read
like a hard error.

Change-Id: I47693d1c08784a44b9a1360a8c2d28433b104437
---
M languages/i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/43/133943/1

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 27a08c4..b67cce3 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1304,7 +1304,7 @@
windows-nonascii-filename: This wiki does not support filenames with 
special characters.,
fileexists: A file with this name exists already, please check 
strong[[:$1]]/strong if you are not sure if you want to change 
it.\n[[$1|thumb]],
filepageexists: The description page for this file has already been 
created at strong[[:$1]]/strong, but no file with this name currently 
exists.\nThe summary you enter will not appear on the description page.\nTo 
make your summary appear there, you will need to manually edit 
it.\n[[$1|thumb]],
-   fileexists-extension: A file with a similar name exists: 
[[$2|thumb]]\n* Name of the uploading file: strong[[:$1]]/strong\n* Name of 
the existing file: strong[[:$2]]/strong\nPlease choose a different name.,
+   fileexists-extension: A file with a similar name exists: 
[[$2|thumb]]\n* Name of the uploading file: strong[[:$1]]/strong\n* Name of 
the existing file: strong[[:$2]]/strong\nAre you sure you want to use this 
name?,
fileexists-thumbnail-yes: The file seems to be an image of reduced 
size em(thumbnail)/em.\n[[$1|thumb]]\nPlease check the file 
strong[[:$1]]/strong.\nIf the checked file is the same image of original 
size it is not necessary to upload an extra thumbnail.,
file-thumbnail-no: The filename begins with strong$1/strong.\nIt 
seems to be an image of reduced size em(thumbnail)/em.\nIf you have this 
image in full resolution upload this one, otherwise change the filename 
please.,
fileexists-forbidden: A file with this name already exists, and 
cannot be overwritten.\nIf you still want to upload your file, please go back 
and use a new name.\n[[File:$1|thumb|center|$1]],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47693d1c08784a44b9a1360a8c2d28433b104437
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff bawolff...@gmail.com

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


[MediaWiki-commits] [Gerrit] Block object descriptions from edit - change (mediawiki...TemplateData)

2014-05-17 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review.

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

Change subject: Block object descriptions from edit
..

Block object descriptions from edit

Some descriptions allow for language objects. For the moment, these
should be blocked for editing so the original json string won't be
corrupted.

Change-Id: I9b13e2f3cfd805d382564e270484557567932a0f
---
M TemplateData.php
M i18n/en.json
M i18n/qqq.json
M modules/ext.templateDataGenerator.core.js
4 files changed, 31 insertions(+), 4 deletions(-)


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

diff --git a/TemplateData.php b/TemplateData.php
index acc34e5..3d076c9 100644
--- a/TemplateData.php
+++ b/TemplateData.php
@@ -105,6 +105,7 @@
'templatedata-modal-table-param-type-string',
'templatedata-modal-table-param-type-undefined',
'templatedata-modal-table-param-type-user',
+   'templatedata-modal-table-param-uneditablefield',
'templatedata-modal-title',
'templatedata-modal-title-templatedesc',
'templatedata-modal-title-templateparams',
diff --git a/i18n/en.json b/i18n/en.json
index c928f5f..bede97c 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -52,6 +52,7 @@
templatedata-modal-table-param-type-string: String,
templatedata-modal-table-param-type-undefined: Undefined,
templatedata-modal-table-param-type-user: User,
+   templatedata-modal-table-param-uneditablefield: Uneditable,
templatedata-modal-title: Template documentation editor,
templatedata-modal-title-templatedesc: Template description,
templatedata-modal-title-templateparams: Template parameters
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 3d73e31..3cb1211 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -53,6 +53,7 @@
templatedata-modal-table-param-type-string: A possible parameter 
type: String,
templatedata-modal-table-param-type-undefined: A possible parameter 
type: Undefined,
templatedata-modal-table-param-type-user: A possible parameter type: 
User,
+   templatedata-modal-table-param-uneditablefield: Placeholder text 
notifying the user the field is uneditable,
templatedata-modal-title: Title of the modal popup.,
templatedata-modal-title-templatedesc: The title for the template 
description textbox,
templatedata-modal-title-templateparams: The title for the template 
parameters table
diff --git a/modules/ext.templateDataGenerator.core.js 
b/modules/ext.templateDataGenerator.core.js
index 0bc84f8..8be668e 100644
--- a/modules/ext.templateDataGenerator.core.js
+++ b/modules/ext.templateDataGenerator.core.js
@@ -278,11 +278,22 @@
paramsJson.params[paramid] 
paramsJson.params[paramid][paramAttr]
) {
-   // make sure we set the value correctly 
based on the DOM element
-   if ( paramAttrObj[paramAttr].prop( 
'type' ) === 'checkbox' ) {
-   paramAttrObj[paramAttr].prop( 
'checked', paramsJson.params[paramid][paramAttr] );
+   // Deal with 'description' being an 
object
+   if ( paramAttr === 'description' ) {
+   if ( $.isPlainObject( 
paramsJson.params[paramid][paramAttr] ) ) {
+   
paramAttrObj[paramAttr].prop( 'disabled', true );
+   
paramAttrObj[paramAttr].data( 'isObject', true );
+   
paramAttrObj[paramAttr].val( '[ ' + mw.msg( 
'templatedata-modal-table-param-uneditablefield' ) + ' ]' );
+   } else {
+   
paramAttrObj[paramAttr].val( paramsJson.params[paramid][paramAttr] );
+   }
} else {
-   paramAttrObj[paramAttr].val( 
paramsJson.params[paramid][paramAttr] );
+   // make sure we set the value 
correctly based on the DOM element
+   if ( 
paramAttrObj[paramAttr].prop( 'type' ) === 'checkbox' ) {
+   
paramAttrObj[paramAttr].prop( 'checked', paramsJson.params[paramid][paramAttr] 
);
+   } else {
+   
paramAttrObj[paramAttr].val( paramsJson.params[paramid][paramAttr] );
+ 

[MediaWiki-commits] [Gerrit] Consolidate mediawiki::users::* into a single class - change (operations/puppet)

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

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

Change subject: Consolidate mediawiki::users::* into a single class
..

Consolidate mediawiki::users::* into a single class

* Collapse mediawiki::users::{mwdeploy,l10nupdate,sudo} into a single class.
* Move l10nupdate's authorized_keys to a file
* Use native user / group rather than systemuser.

Change-Id: I44df6e7f9706ff565eae3334e4d1574001df06dc
---
M manifests/misc/statistics.pp
M manifests/openstack.pp
A modules/mediawiki/files/authorized_keys.l10nupdate
M modules/mediawiki/manifests/init.pp
M modules/mediawiki/manifests/sync.pp
A modules/mediawiki/manifests/users.pp
D modules/mediawiki/manifests/users/l10nupdate.pp
D modules/mediawiki/manifests/users/mwdeploy.pp
D modules/mediawiki/manifests/users/sudo.pp
9 files changed, 132 insertions(+), 144 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/45/133945/1

diff --git a/manifests/misc/statistics.pp b/manifests/misc/statistics.pp
index 7f9de05..c83a833 100644
--- a/manifests/misc/statistics.pp
+++ b/manifests/misc/statistics.pp
@@ -139,7 +139,6 @@
 # RT 2162
 class misc::statistics::mediawiki {
 include misc::statistics::base
-require mediawiki::users::mwdeploy
 
 $statistics_mediawiki_directory = 
${misc::statistics::base::working_path}/mediawiki/core
 
diff --git a/manifests/openstack.pp b/manifests/openstack.pp
index 70ceefd..743a197 100644
--- a/manifests/openstack.pp
+++ b/manifests/openstack.pp
@@ -373,7 +373,7 @@
 }
 
 class openstack::openstack-manager($openstack_version=folsom, $novaconfig, 
$certificate) {
-require mediawiki::users::mwdeploy
+# require mediawiki::users::mwdeploy  -- temp. removed for ::mediawiki 
refactor -- OL
 
 if !defined(Class[webserver::php5]) {
 class {'webserver::php5': ssl = true; }
diff --git a/modules/mediawiki/files/authorized_keys.l10nupdate 
b/modules/mediawiki/files/authorized_keys.l10nupdate
new file mode 100644
index 000..ff21ea4
--- /dev/null
+++ b/modules/mediawiki/files/authorized_keys.l10nupdate
@@ -0,0 +1 @@
+ssh-rsa 
B3NzaC1yc2EBIwAAAQEAzcA/wB0uoU+XgiYN/scGczrAGuN99O8L7m8TviqxgX9s+RexhPtn8FHss1GKi8oxVO1V+ssABVb2q0fGza4wqrHOlZadcFEGjQhZ4IIfUwKUo78mKhQsUyTd5RYMR0KlcjB4UyWSDX5tFHK6FE7/tySNTX7Tihau7KZ9R0Ax//KySCG0skKyI1BK4Ufb82S8wohrktBO6W7lag0O2urh9dKI0gM8EuP666DGnaNBFzycKLPqLaURCeCdB6IiogLHiR21dyeHIIAN0zD6SUyTGH2ZNlZkX05hcFUEWcsWE49+Ve/rdfu1wWTDnourH/Xm3IBkhVGqskB+yp3Jkz2D3Q==
 l10nupdate@fenari
\ No newline at end of file
diff --git a/modules/mediawiki/manifests/init.pp 
b/modules/mediawiki/manifests/init.pp
index 1c4fd93..c4aa836 100644
--- a/modules/mediawiki/manifests/init.pp
+++ b/modules/mediawiki/manifests/init.pp
@@ -1,29 +1,8 @@
 class mediawiki {
-include ::mediawiki::users::mwdeploy
-include ::mediawiki::users::l10nupdate
-include ::mediawiki::users::sudo
+include ::mediawiki::users
 include ::mediawiki::sync
 include ::mediawiki::cgroup
 include ::mediawiki::packages
-
-# The name, gid, home, and shell of the apache user are set to conform
-# with the postinst script of the wikimedia-task-appserver package, which
-# provisioned it historically. These values can and should be modernized.
-
-group { 'apache':
-ensure = present,
-gid= 48,
-system = true,
-}
-
-user { 'apache':
-ensure = present,
-gid= 48,
-shell  = '/sbin/nologin',
-home   = '/var/www',
-system = true,
-managehome = false,
-}
 
 class { '::twemproxy':
 default_file = 'puppet:///modules/mediawiki/twemproxy.default',
diff --git a/modules/mediawiki/manifests/sync.pp 
b/modules/mediawiki/manifests/sync.pp
index 6dcd29a..7a65258 100644
--- a/modules/mediawiki/manifests/sync.pp
+++ b/modules/mediawiki/manifests/sync.pp
@@ -1,56 +1,53 @@
 # mediawiki syncing class
 class mediawiki::sync {
-   include misc::deployment::vars
+include misc::deployment::vars
+include mediawiki::users
 
-   include mediawiki::users::l10nupdate
-   include mediawiki::users::mwdeploy
-   include mediawiki::users::sudo
+deployment::target { 'scap': }
 
-   deployment::target { 'scap': }
+file { '/usr/local/bin/mwversionsinuse':
+ensure  = link,
+target  = '/srv/deployment/scap/scap/bin/mwversionsinuse',
+}
+file { '/usr/local/bin/scap-rebuild-cdbs':
+ensure  = link,
+target  = '/srv/deployment/scap/scap/bin/scap-rebuild-cdbs',
+}
+file { '/usr/local/bin/scap-recompile':
+ensure  = link,
+target  = '/srv/deployment/scap/scap/bin/scap-recompile',
+}
+file { '/usr/local/bin/sync-common':
+ensure  = link,
+target  = '/srv/deployment/scap/scap/bin/sync-common',
+}
+file { '/usr/local/bin/refreshCdbJsonFiles':
+ensure  = 

[MediaWiki-commits] [Gerrit] Add wikitext formatting to CASCADINGSOURCES - change (mediawiki/core)

2014-05-17 Thread Withoutaname (Code Review)
Withoutaname has uploaded a new change for review.

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

Change subject: Add wikitext formatting to CASCADINGSOURCES
..

Add wikitext formatting to CASCADINGSOURCES

Change-Id: Ide69a1324b0e84a064a4e5a31e9671838ec5ce4c
---
M includes/parser/CoreParserFunctions.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/46/133946/1

diff --git a/includes/parser/CoreParserFunctions.php 
b/includes/parser/CoreParserFunctions.php
index 4e7e663..278a220 100644
--- a/includes/parser/CoreParserFunctions.php
+++ b/includes/parser/CoreParserFunctions.php
@@ -1139,11 +1139,11 @@
if ( $parser-incrementExpensiveFunctionCount() ) {
$sources = $titleObject-getCascadeProtectionSources();
foreach ( $sources[0] as $sourceTitle ) {
-   $names[] = $sourceTitle-getText();
+   $names[] = *  . $sourceTitle-getText();
}
}
 
-   return implode( $names, '|' );
+   return implode( $names, '\n' );
}
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide69a1324b0e84a064a4e5a31e9671838ec5ce4c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Withoutaname drevit...@gmail.com

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


[MediaWiki-commits] [Gerrit] Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/me... - change (mediawiki/core)

2014-05-17 Thread Withoutaname (Code Review)
Withoutaname has uploaded a new change for review.

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

Change subject: Merge branch 'master' of 
ssh://gerrit.wikimedia.org:29418/mediawiki/core into review/withoutaname/133946
..

Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/core into 
review/withoutaname/133946

Conflicts:
includes/parser/CoreParserFunctions.php

Change-Id: Ib22c22817c6db25a6e014c55426512ec2ad4ec93
---
M includes/parser/CoreParserFunctions.php
1 file changed, 2 insertions(+), 11 deletions(-)


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

diff --git a/includes/parser/CoreParserFunctions.php 
b/includes/parser/CoreParserFunctions.php
index 54ebeb5..9dfaf5d 100644
--- a/includes/parser/CoreParserFunctions.php
+++ b/includes/parser/CoreParserFunctions.php
@@ -1219,20 +1219,11 @@
$names = array();
$sources = $titleObject-getCascadeProtectionSources();
foreach ( $sources[0] as $sourceTitle ) {
- HEAD   (f99440 Add wikitext formatting to CASCADINGSOURCES)
-   $names[] = *  . $sourceTitle-getText();
-===
-   $names[] = $sourceTitle-getPrefixedText();
- BRANCH (444bcb Localisation updates from https://translatewiki.net.)
+   $names[] = *  . 
$sourceTitle-getPrefixedText();
}
-   return implode( $names, '|' );
+   return implode( $names, '\n' );
}
- HEAD   (f99440 Add wikitext formatting to CASCADINGSOURCES)
-
-   return implode( $names, '\n' );
-===
return '';
- BRANCH (444bcb Localisation updates from https://translatewiki.net.)
}
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib22c22817c6db25a6e014c55426512ec2ad4ec93
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Withoutaname drevit...@gmail.com

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


[MediaWiki-commits] [Gerrit] DocGen Doxygen updater - change (mediawiki...WikiLexicalData)

2014-05-17 Thread Hiong3-eng5 (Code Review)
Hiong3-eng5 has uploaded a new change for review.

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

Change subject: DocGen Doxygen updater
..

DocGen Doxygen updater

Hopefully fixed the output problem.

Change-Id: Id216c00cae6ab13e27fdea8946b0cc60dcca5a38
---
M Console/doxygen/createDocumentation.php
1 file changed, 4 insertions(+), 1 deletion(-)


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

diff --git a/Console/doxygen/createDocumentation.php 
b/Console/doxygen/createDocumentation.php
index e010a65..0364acc 100644
--- a/Console/doxygen/createDocumentation.php
+++ b/Console/doxygen/createDocumentation.php
@@ -44,6 +44,8 @@
$this-readTemplateConfigFile( $config, $configFinal );
 
// create a command to execute.
+   $this-output( updating...\ndoxygen -u $configFinal\n\n );
+   exec( doxygen -u $configFinal );
$this-output( executing...\ndoxygen $configFinal\n\n );
exec( doxygen $configFinal );
 
@@ -60,12 +62,13 @@
 
if ( file_exists( 'Console/doxygen/' . $filename ) ) {
$this-output( Preparing file..\n\n );
+   $this-output( copy Console/doxygen/ . $filename .  
$configFinal\n\n );
copy( 'Console/doxygen/' . $filename, $configFinal );
} else {
die( template file not found..\n\n );
}
 
-   $this-output( Parsing config file $configFinal...\n\n );
+   $this-output( \nParsing config file $configFinal...\n\n );
 
$str = file_get_contents( $configFinal );
$wldBase = dirname( __FILE__ ) . '/../';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id216c00cae6ab13e27fdea8946b0cc60dcca5a38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiLexicalData
Gerrit-Branch: master
Gerrit-Owner: Hiong3-eng5 hiong3.e...@gmail.com

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


[MediaWiki-commits] [Gerrit] Clean-up - change (mediawiki...SemanticGlossary)

2014-05-17 Thread Mwjames (Code Review)
Mwjames has uploaded a new change for review.

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

Change subject: Clean-up
..

Clean-up

Functionality is unaltered while the PR focuses on:

- Minimize static use
- Use composition where possible
- Rename some classes to be more expressive
- Limit BagOStuff/MediaWiki dependency to GlossaryCache only
- Added MwDBSQLStoreIntegrationTest to test a real DB/Store integration

Change-Id: Id0e0e1c19afc3aceb06fe75f2d5892cd2a065f34
---
M README.md
M SemanticGlossary.php
M maintenance/rebuildGlossaryCache.php
A src/Cache/CacheInvalidator.php
M src/Cache/ElementsCacheBuilder.php
A src/Cache/GlossaryCache.php
D src/CacheHelper.php
D src/CacheInvalidator.php
M src/LingoBackendAdapter.php
M src/Maintenance/GlossaryCacheRebuilder.php
M src/PropertyRegistry.php
R src/SemanticDataComparator.php
M tests/bootstrap.php
R tests/phpunit/Cache/CacheInvalidatorTest.php
M tests/phpunit/Cache/ElementsCacheBuilderTest.php
A tests/phpunit/Cache/GlossaryCacheTest.php
D tests/phpunit/CacheHelperTest.php
M tests/phpunit/ConfigurationIntegrityTest.php
M tests/phpunit/Maintenance/GlossaryCacheRebuilderTest.php
A tests/phpunit/MwDBSQLStoreIntegrationTest.php
R tests/phpunit/SemanticDataComparatorTest.php
21 files changed, 565 insertions(+), 389 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGlossary 
refs/changes/49/133949/1

diff --git a/README.md b/README.md
index 4982fc6..9702c58 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 # Semantic Glossary
-[![Latest Stable 
Version](https://poser.pugx.org/mediawiki/semantic-glossary/version.png)](https://packagist.org/packages/mediawiki/chameleon-skin)
-[![Packagist download 
count](https://poser.pugx.org/mediawiki/semantic-glossary/d/total.png)](https://packagist.org/packages/mediawiki/chameleon-skin)
-[![Dependency 
Status](https://www.versioneye.com/php/mediawiki:semantic-glossary/badge.png)](https://www.versioneye.com/php/mediawiki:chameleon-skin)
+[![Latest Stable 
Version](https://poser.pugx.org/mediawiki/semantic-glossary/version.png)](https://packagist.org/packages/mediawiki/semantic-glossary)
+[![Packagist download 
count](https://poser.pugx.org/mediawiki/semantic-glossary/d/total.png)](https://packagist.org/packages/mediawiki/semantic-glossary)
+[![Dependency 
Status](https://www.versioneye.com/php/mediawiki:semantic-glossary/badge.png)](https://www.versioneye.com/php/mediawiki:semantic-glossary)
 
 The [Semantic Glossary][mw-semantic-glossary] (a.k.a SG) is a [Semantic 
MediaWiki][smw] extension where terms and abbreviations can be defined using 
semantic properties.
 
@@ -10,6 +10,7 @@
 - PHP 5.3.2 or later
 - MediaWiki 1.20 or later
 - [Lingo extension][mw-lingo] 1.0 or later
+- [Semantic MediaWiki][smw] 1.9 or later
 
 ## Installation
 
diff --git a/SemanticGlossary.php b/SemanticGlossary.php
index 511b7e6..68ff876 100644
--- a/SemanticGlossary.php
+++ b/SemanticGlossary.php
@@ -57,12 +57,12 @@
// register class files with the Autoloader
$autoloadClasses = array(
'SG\PropertyRegistry'  = $dir . 
'/src/PropertyRegistry.php',
-   'SG\CacheInvalidator'  = $dir . 
'/src/CacheInvalidator.php',
-   'SG\CacheHelper'   = $dir . '/src/CacheHelper.php',
-   'SG\DataComparator'= $dir . '/src/DataComparator.php',
'SG\Maintenance\GlossaryCacheRebuilder' = $dir . 
'/src/Maintenance/GlossaryCacheRebuilder.php',
-   'SG\LingoBackendAdapter'   = $dir . 
'/src/LingoBackendAdapter.php',
-   'SG\Cache\ElementsCacheBuilder'= $dir . 
'/src/Cache/ElementsCacheBuilder.php'
+   'SG\LingoBackendAdapter' = $dir . 
'/src/LingoBackendAdapter.php',
+   'SG\SemanticDataComparator'  = $dir . 
'/src/SemanticDataComparator.php',
+   'SG\Cache\ElementsCacheBuilder'  = $dir . 
'/src/Cache/ElementsCacheBuilder.php',
+   'SG\Cache\CacheInvalidator'  = $dir . 
'/src/Cache/CacheInvalidator.php',
+   'SG\Cache\GlossaryCache' = $dir . 
'/src/Cache/GlossaryCache.php',
);
 
$GLOBALS[ 'wgAutoloadClasses' ] = array_merge( $GLOBALS[ 
'wgAutoloadClasses' ], $autoloadClasses );
@@ -87,7 +87,7 @@
 * @since 1.0
 */
$GLOBALS['wgHooks']['SMWStore::updateDataBefore'][] = function ( 
SMWStore $store, SMWSemanticData $semanticData ) {
-   return 
\SG\CacheInvalidator::getInstance()-invalidateCacheOnStoreUpdate( $store, 
$semanticData );
+   return 
\SG\Cache\CacheInvalidator::getInstance()-invalidateCacheOnStoreUpdate( 
$store, $semanticData );
};
 
/**
@@ -96,7 +96,7 @@
 * @since 1.0
 */
$GLOBALS['wgHooks']['smwDeleteSemanticData'][] = function ( 
SMWDIWikiPage $subject ) {
-   return 
\SG\CacheInvalidator::getInstance()-invalidateCacheOnPageDelete( 

[MediaWiki-commits] [Gerrit] Consolidate mediawiki::users::* into a single class - change (operations/puppet)

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

Change subject: Consolidate mediawiki::users::* into a single class
..


Consolidate mediawiki::users::* into a single class

* Collapse mediawiki::users::{mwdeploy,l10nupdate,sudo} into a single class.
* Move l10nupdate's authorized_keys to a file
* Use native user / group rather than systemuser.

Change-Id: I44df6e7f9706ff565eae3334e4d1574001df06dc
---
M manifests/misc/statistics.pp
M manifests/openstack.pp
A modules/mediawiki/files/authorized_keys.l10nupdate
M modules/mediawiki/manifests/init.pp
M modules/mediawiki/manifests/sync.pp
A modules/mediawiki/manifests/users.pp
D modules/mediawiki/manifests/users/l10nupdate.pp
D modules/mediawiki/manifests/users/mwdeploy.pp
D modules/mediawiki/manifests/users/sudo.pp
9 files changed, 139 insertions(+), 144 deletions(-)

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



diff --git a/manifests/misc/statistics.pp b/manifests/misc/statistics.pp
index 7f9de05..c83a833 100644
--- a/manifests/misc/statistics.pp
+++ b/manifests/misc/statistics.pp
@@ -139,7 +139,6 @@
 # RT 2162
 class misc::statistics::mediawiki {
 include misc::statistics::base
-require mediawiki::users::mwdeploy
 
 $statistics_mediawiki_directory = 
${misc::statistics::base::working_path}/mediawiki/core
 
diff --git a/manifests/openstack.pp b/manifests/openstack.pp
index 70ceefd..743a197 100644
--- a/manifests/openstack.pp
+++ b/manifests/openstack.pp
@@ -373,7 +373,7 @@
 }
 
 class openstack::openstack-manager($openstack_version=folsom, $novaconfig, 
$certificate) {
-require mediawiki::users::mwdeploy
+# require mediawiki::users::mwdeploy  -- temp. removed for ::mediawiki 
refactor -- OL
 
 if !defined(Class[webserver::php5]) {
 class {'webserver::php5': ssl = true; }
diff --git a/modules/mediawiki/files/authorized_keys.l10nupdate 
b/modules/mediawiki/files/authorized_keys.l10nupdate
new file mode 100644
index 000..ff21ea4
--- /dev/null
+++ b/modules/mediawiki/files/authorized_keys.l10nupdate
@@ -0,0 +1 @@
+ssh-rsa 
B3NzaC1yc2EBIwAAAQEAzcA/wB0uoU+XgiYN/scGczrAGuN99O8L7m8TviqxgX9s+RexhPtn8FHss1GKi8oxVO1V+ssABVb2q0fGza4wqrHOlZadcFEGjQhZ4IIfUwKUo78mKhQsUyTd5RYMR0KlcjB4UyWSDX5tFHK6FE7/tySNTX7Tihau7KZ9R0Ax//KySCG0skKyI1BK4Ufb82S8wohrktBO6W7lag0O2urh9dKI0gM8EuP666DGnaNBFzycKLPqLaURCeCdB6IiogLHiR21dyeHIIAN0zD6SUyTGH2ZNlZkX05hcFUEWcsWE49+Ve/rdfu1wWTDnourH/Xm3IBkhVGqskB+yp3Jkz2D3Q==
 l10nupdate@fenari
\ No newline at end of file
diff --git a/modules/mediawiki/manifests/init.pp 
b/modules/mediawiki/manifests/init.pp
index 1c4fd93..c4aa836 100644
--- a/modules/mediawiki/manifests/init.pp
+++ b/modules/mediawiki/manifests/init.pp
@@ -1,29 +1,8 @@
 class mediawiki {
-include ::mediawiki::users::mwdeploy
-include ::mediawiki::users::l10nupdate
-include ::mediawiki::users::sudo
+include ::mediawiki::users
 include ::mediawiki::sync
 include ::mediawiki::cgroup
 include ::mediawiki::packages
-
-# The name, gid, home, and shell of the apache user are set to conform
-# with the postinst script of the wikimedia-task-appserver package, which
-# provisioned it historically. These values can and should be modernized.
-
-group { 'apache':
-ensure = present,
-gid= 48,
-system = true,
-}
-
-user { 'apache':
-ensure = present,
-gid= 48,
-shell  = '/sbin/nologin',
-home   = '/var/www',
-system = true,
-managehome = false,
-}
 
 class { '::twemproxy':
 default_file = 'puppet:///modules/mediawiki/twemproxy.default',
diff --git a/modules/mediawiki/manifests/sync.pp 
b/modules/mediawiki/manifests/sync.pp
index 6dcd29a..7a65258 100644
--- a/modules/mediawiki/manifests/sync.pp
+++ b/modules/mediawiki/manifests/sync.pp
@@ -1,56 +1,53 @@
 # mediawiki syncing class
 class mediawiki::sync {
-   include misc::deployment::vars
+include misc::deployment::vars
+include mediawiki::users
 
-   include mediawiki::users::l10nupdate
-   include mediawiki::users::mwdeploy
-   include mediawiki::users::sudo
+deployment::target { 'scap': }
 
-   deployment::target { 'scap': }
+file { '/usr/local/bin/mwversionsinuse':
+ensure  = link,
+target  = '/srv/deployment/scap/scap/bin/mwversionsinuse',
+}
+file { '/usr/local/bin/scap-rebuild-cdbs':
+ensure  = link,
+target  = '/srv/deployment/scap/scap/bin/scap-rebuild-cdbs',
+}
+file { '/usr/local/bin/scap-recompile':
+ensure  = link,
+target  = '/srv/deployment/scap/scap/bin/scap-recompile',
+}
+file { '/usr/local/bin/sync-common':
+ensure  = link,
+target  = '/srv/deployment/scap/scap/bin/sync-common',
+}
+file { '/usr/local/bin/refreshCdbJsonFiles':
+ensure  = link,
+target  = 

[MediaWiki-commits] [Gerrit] For job param arrays of scalars, show the key/values as JSON... - change (mediawiki/core)

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

Change subject: For job param arrays of scalars, show the key/values as JSON in 
the log
..


For job param arrays of scalars, show the key/values as JSON in the log

Change-Id: Ia9056dd1d4669102178046961ddaf6e8560e5903
---
M includes/jobqueue/Job.php
1 file changed, 23 insertions(+), 6 deletions(-)

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



diff --git a/includes/jobqueue/Job.php b/includes/jobqueue/Job.php
index 4ee370e..35b4f13 100644
--- a/includes/jobqueue/Job.php
+++ b/includes/jobqueue/Job.php
@@ -291,6 +291,14 @@
 * @return string
 */
public function toString() {
+   $truncFunc = function( $value ) {
+   $value = (string)$value;
+   if ( mb_strlen( $value )  1024 ) {
+   $value = string( . mb_strlen( $value ) . );
+   }
+   return $value;
+   };
+
$paramString = '';
if ( $this-params ) {
foreach ( $this-params as $key = $value ) {
@@ -298,16 +306,25 @@
$paramString .= ' ';
}
if ( is_array( $value ) ) {
-   $value = array( . count( $value ) . 
);
+   $filteredValue = array();
+   foreach ( $value as $k = $v ) {
+   if ( is_scalar( $v ) ) {
+   $filteredValue[$k] = 
$truncFunc( $v );
+   } else {
+   $filteredValue = null;
+   break;
+   }
+   }
+   if ( $filteredValue ) {
+   $value = FormatJson::encode( 
$filteredValue );
+   } else {
+   $value = array( . count( 
$value ) . );
+   }
} elseif ( is_object( $value )  
!method_exists( $value, '__toString' ) ) {
$value = object( . get_class( $value 
) . );
}
-   $value = (string)$value;
-   if ( mb_strlen( $value )  1024 ) {
-   $value = string( . mb_strlen( $value 
) . );
-   }
 
-   $paramString .= $key=$value;
+   $paramString .= $key={$truncFunc( $value )};
}
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia9056dd1d4669102178046961ddaf6e8560e5903
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz asch...@wikimedia.org
Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Make DatabaseSqlite support creating temp tables - change (mediawiki/core)

2014-05-17 Thread AndyRussG (Code Review)
AndyRussG has uploaded a new change for review.

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

Change subject: Make DatabaseSqlite support creating temp tables
..

Make DatabaseSqlite support creating temp tables

DatabaseSqlite::replaceVars() modifies CREATE TABLE queries so they
conform to SQLite syntax. However, it doesn't detect queries that
create temporary tables, and so it doesn't modify them as required.
This patch fixes the issue.

Change-Id: Ie30983c5d0f39e1d5f4bd08d1229d3f93bfed418
---
M includes/db/DatabaseSqlite.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php
index 468ed6d..98c56dd 100644
--- a/includes/db/DatabaseSqlite.php
+++ b/includes/db/DatabaseSqlite.php
@@ -825,7 +825,7 @@
 */
protected function replaceVars( $s ) {
$s = parent::replaceVars( $s );
-   if ( preg_match( '/^\s*(CREATE|ALTER) TABLE/i', $s ) ) {
+   if ( preg_match( '/^\s*(CREATE|ALTER) (TEMPORARY )?TABLE/i', $s 
) ) {
// CREATE TABLE hacks to allow schema file sharing with 
MySQL
 
// binary/varbinary column type - blob

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie30983c5d0f39e1d5f4bd08d1229d3f93bfed418
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: AndyRussG andrew.green...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add role::fss - change (mediawiki/vagrant)

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

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

Change subject: Add role::fss
..

Add role::fss

Adds a role for FastStringSearch, and corrects a small error in the php::ini
template which caused string values to be surrounded by two pairs of double
quotes.

Change-Id: Ifce4e4263db7ac80e8d045bbfda6948e9e766840
---
M puppet/manifests/packages.pp
A puppet/manifests/roles/fss.pp
M puppet/modules/php/templates/conffile.ini.erb
3 files changed, 20 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/51/133951/1

diff --git a/puppet/manifests/packages.pp b/puppet/manifests/packages.pp
index f2e5fef..aef1719 100644
--- a/puppet/manifests/packages.pp
+++ b/puppet/manifests/packages.pp
@@ -99,3 +99,7 @@
 class packages::jq {
 package { 'jq': }
 }
+
+class packages::fss {
+package { 'php5-fss': }
+}
diff --git a/puppet/manifests/roles/fss.pp b/puppet/manifests/roles/fss.pp
new file mode 100644
index 000..bb38569
--- /dev/null
+++ b/puppet/manifests/roles/fss.pp
@@ -0,0 +1,15 @@
+# == Class: roles::fss
+#
+# FastStringSearch is a PHP extension for fast string search and replace. It is
+# used by StringUtils.php. It supports multiple search terms. It is used as a
+# replacement for PHP's strtr, which is extremely slow in certain cases.
+# Chinese script conversion is one of those cases. This extension uses a
+# Commentz-Walter style algorithm for multiple search terms, or a Boyer-Moore
+# algorithm for single search terms.
+class role::fss {
+include packages::fss
+
+php::ini { 'fss':
+settings = { extension = 'fss.so', },
+}
+}
diff --git a/puppet/modules/php/templates/conffile.ini.erb 
b/puppet/modules/php/templates/conffile.ini.erb
index dfc7ffe..7d7d7a6 100644
--- a/puppet/modules/php/templates/conffile.ini.erb
+++ b/puppet/modules/php/templates/conffile.ini.erb
@@ -5,7 +5,7 @@
 when Hash
 @settings.sort.map { |k,v|
 v = v ? 1 : 0 if [TrueClass, FalseClass].include? v.class
-%Q(#{k} = #{v.inspect})
+%Q(#{k} = #{v})
 }.join(\n)
 when Array
 @settings.join(\n)

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

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

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


[MediaWiki-commits] [Gerrit] Add role::fss - change (mediawiki/vagrant)

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

Change subject: Add role::fss
..


Add role::fss

Adds a role for FastStringSearch, and corrects a small error in the php::ini
template which caused string values to be surrounded by two pairs of double
quotes.

Change-Id: Ifce4e4263db7ac80e8d045bbfda6948e9e766840
---
M puppet/manifests/packages.pp
A puppet/manifests/roles/fss.pp
M puppet/modules/php/templates/conffile.ini.erb
3 files changed, 20 insertions(+), 1 deletion(-)

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



diff --git a/puppet/manifests/packages.pp b/puppet/manifests/packages.pp
index f2e5fef..aef1719 100644
--- a/puppet/manifests/packages.pp
+++ b/puppet/manifests/packages.pp
@@ -99,3 +99,7 @@
 class packages::jq {
 package { 'jq': }
 }
+
+class packages::fss {
+package { 'php5-fss': }
+}
diff --git a/puppet/manifests/roles/fss.pp b/puppet/manifests/roles/fss.pp
new file mode 100644
index 000..bb38569
--- /dev/null
+++ b/puppet/manifests/roles/fss.pp
@@ -0,0 +1,15 @@
+# == Class: roles::fss
+#
+# FastStringSearch is a PHP extension for fast string search and replace. It is
+# used by StringUtils.php. It supports multiple search terms. It is used as a
+# replacement for PHP's strtr, which is extremely slow in certain cases.
+# Chinese script conversion is one of those cases. This extension uses a
+# Commentz-Walter style algorithm for multiple search terms, or a Boyer-Moore
+# algorithm for single search terms.
+class role::fss {
+include packages::fss
+
+php::ini { 'fss':
+settings = { extension = 'fss.so', },
+}
+}
diff --git a/puppet/modules/php/templates/conffile.ini.erb 
b/puppet/modules/php/templates/conffile.ini.erb
index dfc7ffe..7d7d7a6 100644
--- a/puppet/modules/php/templates/conffile.ini.erb
+++ b/puppet/modules/php/templates/conffile.ini.erb
@@ -5,7 +5,7 @@
 when Hash
 @settings.sort.map { |k,v|
 v = v ? 1 : 0 if [TrueClass, FalseClass].include? v.class
-%Q(#{k} = #{v.inspect})
+%Q(#{k} = #{v})
 }.join(\n)
 when Array
 @settings.join(\n)

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

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

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


[MediaWiki-commits] [Gerrit] Lot of standard performance tweaks for those who want them - change (mediawiki/vagrant)

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

Change subject: Lot of standard performance tweaks for those who want them
..


Lot of standard performance tweaks for those who want them

After some cleanup in https://www.mediawiki.org/wiki/Manual:Performance_tuning
I decided to make a live version of the documentation, in puppet. Here it is.

Not tested; needs review by sysadmin/puppet/MediaWiki-Vagrant folks.
Maybe the 30 days caching should be moved to the aggressive option.

Change-Id: Ie73c7549557c63f19287c53c8a4fc7b07dbc8e93
---
M LocalSettings.php
A puppet/files/robots.txt
A puppet/files/skins-htaccess
M puppet/manifests/packages.pp
M puppet/manifests/roles/mediawiki.pp
M puppet/manifests/roles/multimedia.pp
A puppet/manifests/roles/simple_miser.pp
A puppet/manifests/roles/simple_performant.pp
A puppet/manifests/roles/thumb_on_404.pp
M puppet/modules/mediawiki/manifests/init.pp
10 files changed, 166 insertions(+), 18 deletions(-)

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



diff --git a/LocalSettings.php b/LocalSettings.php
index 61aa286..5ce65c9 100644
--- a/LocalSettings.php
+++ b/LocalSettings.php
@@ -17,6 +17,7 @@
$wgServer = '//' . $_SERVER['HTTP_HOST'];
 }
 
+$wgCacheDirectory = '/var/cache/mediawiki';
 $wgUploadDirectory = '/srv/images';
 $wgUploadPath = '/images';
 $wgArticlePath = /wiki/$1;
diff --git a/puppet/files/robots.txt b/puppet/files/robots.txt
new file mode 100644
index 000..d097f3e
--- /dev/null
+++ b/puppet/files/robots.txt
@@ -0,0 +1,9 @@
+# Apparently we're using the ugly defaults in MediaWiki
+# for $wgScriptPath and $wgArticlePath; $wgUsePathInfo
+# default should result into a true for this Ubuntu
+# Don't crawl history, API calls and whatever
+User-agent: *
+Disallow: /wiki/index.php?
+Disallow: /wiki/api.php
+Disallow: /skins/
+Crawl-delay: 1
\ No newline at end of file
diff --git a/puppet/files/skins-htaccess b/puppet/files/skins-htaccess
new file mode 100644
index 000..e379ca5
--- /dev/null
+++ b/puppet/files/skins-htaccess
@@ -0,0 +1,2 @@
+ExpiresActive On
+ExpiresDefault access plus 1 month
\ No newline at end of file
diff --git a/puppet/manifests/packages.pp b/puppet/manifests/packages.pp
index aef1719..e33e869 100644
--- a/puppet/manifests/packages.pp
+++ b/puppet/manifests/packages.pp
@@ -103,3 +103,7 @@
 class packages::fss {
 package { 'php5-fss': }
 }
+
+class packages::unzip {
+package { 'unzip': }
+}
diff --git a/puppet/manifests/roles/mediawiki.pp 
b/puppet/manifests/roles/mediawiki.pp
index fddd332..ff4eeb2 100644
--- a/puppet/manifests/roles/mediawiki.pp
+++ b/puppet/manifests/roles/mediawiki.pp
@@ -17,6 +17,7 @@
 }
 
 $dir = '/vagrant/mediawiki'
+$cache_dir = '/var/cache/mediawiki'
 $settings_dir = '/vagrant/settings.d'
 $upload_dir = '/srv/images'
 
@@ -42,6 +43,7 @@
 db_pass  = $db_pass,
 db_user  = $db_user,
 dir  = $dir,
+cache_dir= $cache_dir,
 settings_dir = $settings_dir,
 upload_dir   = $upload_dir,
 server_url   = $server_url,
diff --git a/puppet/manifests/roles/multimedia.pp 
b/puppet/manifests/roles/multimedia.pp
index 8d98954..302f2d5 100644
--- a/puppet/manifests/roles/multimedia.pp
+++ b/puppet/manifests/roles/multimedia.pp
@@ -10,8 +10,7 @@
 # [1] https://www.mediawiki.org/wiki/Manual:Thumb.php#404_Handler
 class role::multimedia {
 include role::mediawiki
-
-include packages::imagemagick
+include role::thumb_on_404
 
 # Increase PHP upload size from default puny 2MB
 php::ini { 'uploadsize':
@@ -19,20 +18,5 @@
 upload_max_filesize = '100M',
 post_max_size   = '100M',
 }
-}
-
-# Enable dynamic thumbnail generation via the thumb.php
-# script for 404 thumb images.
-mediawiki::settings { 'thumb.php on 404':
-values = {
-wgThumbnailScriptPath  = false,
-wgGenerateThumbnailOnParse = false,
-wgUseImageMagick   = true,
-},
-}
-
-apache::conf { 'thumb.php on 404':
-site= $mediawiki::wiki_name,
-content = template('thumb_on_404.conf.erb'),
 }
 }
diff --git a/puppet/manifests/roles/simple_miser.pp 
b/puppet/manifests/roles/simple_miser.pp
new file mode 100644
index 000..71cb008
--- /dev/null
+++ b/puppet/manifests/roles/simple_miser.pp
@@ -0,0 +1,32 @@
+# == Class: role::simple_miser
+# This class configures MediaWiki to be slightly more performant,
+# with simple enough things but sacrificing some functionality.
+# It's probably too aggressive for your needs, but you can use it
+# if you're too lazy to properly pick configs which make a difference
+# for the performance of your wiki.
+# See https://www.mediawiki.org/wiki/Manual:Performance_tuning
+
+class role::simple_miser {
+include role::simple_performant
+
+mediawiki::settings {