[MediaWiki-commits] [Gerrit] Update Wikibase: Use SELECT FOR UPDATE in SqlIdGenerator - change (mediawiki...Wikidata)

2015-06-25 Thread Hoo man (Code Review)
Hoo man has submitted this change and it was merged.

Change subject: Update Wikibase: Use SELECT FOR UPDATE in SqlIdGenerator
..


Update Wikibase: Use SELECT FOR UPDATE in SqlIdGenerator

Contains: bacf6c07b3dfe028550db6566cd8dbcd18920f41

Change-Id: I527bcdaf38facbc0537cae9f718f85ce9f081f3c
---
M composer.lock
D extensions/Wikibase/Wikibase.composer.php
M extensions/Wikibase/Wikibase.php
M extensions/Wikibase/client/tests/phpunit/includes/WikibaseClientTest.php
M extensions/Wikibase/composer.json
M extensions/Wikibase/repo/includes/store/sql/SqlIdGenerator.php
M vendor/composer/autoload_files.php
M vendor/composer/installed.json
8 files changed, 40 insertions(+), 43 deletions(-)

Approvals:
  Hoo man: Verified; Looks good to me, approved



diff --git a/composer.lock b/composer.lock
index 6e8f08d..0d77038 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1213,12 +1213,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-"reference": "335f05ba25d402852ef85f2fd17394418c234895"
+"reference": "fcd552c95fd61df06710ce121640610225f13c94"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/335f05ba25d402852ef85f2fd17394418c234895";,
-"reference": "335f05ba25d402852ef85f2fd17394418c234895",
+"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/fcd552c95fd61df06710ce121640610225f13c94";,
+"reference": "fcd552c95fd61df06710ce121640610225f13c94",
 "shasum": ""
 },
 "require": {
@@ -1245,11 +1245,11 @@
 "conflict": {
 "mediawiki/mediawiki": "<1.23"
 },
+"require-dev": {
+"squizlabs/php_codesniffer": "~2.1"
+},
 "type": "mediawiki-extension",
 "autoload": {
-"files": [
-"Wikibase.composer.php"
-],
 "classmap": [
 "client/includes/",
 "client/WikibaseClient.hooks.php",
@@ -1286,7 +1286,7 @@
 "wikibaserepo",
 "wikidata"
 ],
-"time": "2015-06-15 09:45:54"
+"time": "2015-06-25 19:47:28"
 },
 {
 "name": "wikibase/wikimedia-badges",
diff --git a/extensions/Wikibase/Wikibase.composer.php 
b/extensions/Wikibase/Wikibase.composer.php
deleted file mode 100644
index ec45160..000
--- a/extensions/Wikibase/Wikibase.composer.php
+++ /dev/null
@@ -1,17 +0,0 @@
-getWikibaseClient()->getLangLinkHandler();
+   $settings = clone 
WikibaseClient::getDefaultInstance()->getSettings();
+
+   $settings->setSetting( 'siteGroup', 'wikipedia' );
+   $settings->setSetting( 'siteGlobalID', 'enwiki' );
+   $settings->setSetting( 'languageLinkSiteGroup', 'wikipedia' );
+
+   $wikibaseClient = new WikibaseClient( $settings, 
Language::factory( 'en' ), $this->getSiteStore() );
+
+   $returnValue = $wikibaseClient->getLangLinkHandler();
$this->assertInstanceOf( 'Wikibase\LangLinkHandler', 
$returnValue );
}
 
diff --git a/extensions/Wikibase/composer.json 
b/extensions/Wikibase/composer.json
index 2ed5674..ee01bbe 100644
--- a/extensions/Wikibase/composer.json
+++ b/extensions/Wikibase/composer.json
@@ -44,13 +44,13 @@
 
"diff/diff": "~2.0|~1.0"
},
+   "require-dev": {
+   "squizlabs/php_codesniffer": "~2.1"
+   },
"conflict": {
"mediawiki/mediawiki": "<1.23"
},
"autoload": {
-   "files" : [
-   "Wikibase.composer.php"
-   ],
"classmap": [
"client/includes/",
"client/WikibaseClient.hooks.php",
@@ -72,6 +72,9 @@
}
},
"scripts": {
-   "phpcs": "phpcs $PHPCS_ARGS -s --standard=phpcs.xml 
--ignore=extensions/ValueView,vendor --encoding=utf-8 --extensions=php"
+   "test": [
+   "composer phpcs"
+   ],
+   "phpcs": "vendor/bin/phpcs -sp --standard=phpcs.xml 
--extensions=php --ignore=extensions/ValueView,vendor ."
}
 }
diff --git a/extensions/Wikibase/repo/includes/store/sql/SqlIdGenerator.php 
b/extensions/Wikibase/repo/includes/store/sql/SqlIdGenerator.php
index 6b33d4c..5e7cbfc 100644
--- a/extensions/Wikibase/repo/includes/store/sql/SqlIdGenerator.php
+++ b/extensions/Wikibase/repo/includes/store/sql/SqlIdGenerator.php
@@ -73,7 +73,9 @@
$currentId = $database->selectRow(
'wb_id_co

[MediaWiki-commits] [Gerrit] Update Wikibase: Use SELECT FOR UPDATE in SqlIdGenerator - change (mediawiki...Wikidata)

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

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

Change subject: Update Wikibase: Use SELECT FOR UPDATE in SqlIdGenerator
..

Update Wikibase: Use SELECT FOR UPDATE in SqlIdGenerator

Contains: bacf6c07b3dfe028550db6566cd8dbcd18920f41
Change-Id: I527bcdaf38facbc0537cae9f718f85ce9f081f3c
---
M composer.lock
D extensions/Wikibase/Wikibase.composer.php
M extensions/Wikibase/Wikibase.php
M extensions/Wikibase/client/tests/phpunit/includes/WikibaseClientTest.php
M extensions/Wikibase/composer.json
M extensions/Wikibase/repo/includes/store/sql/SqlIdGenerator.php
M vendor/composer/autoload_files.php
M vendor/composer/installed.json
8 files changed, 40 insertions(+), 43 deletions(-)


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

diff --git a/composer.lock b/composer.lock
index 6e8f08d..0d77038 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1213,12 +1213,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-"reference": "335f05ba25d402852ef85f2fd17394418c234895"
+"reference": "fcd552c95fd61df06710ce121640610225f13c94"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/335f05ba25d402852ef85f2fd17394418c234895";,
-"reference": "335f05ba25d402852ef85f2fd17394418c234895",
+"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/fcd552c95fd61df06710ce121640610225f13c94";,
+"reference": "fcd552c95fd61df06710ce121640610225f13c94",
 "shasum": ""
 },
 "require": {
@@ -1245,11 +1245,11 @@
 "conflict": {
 "mediawiki/mediawiki": "<1.23"
 },
+"require-dev": {
+"squizlabs/php_codesniffer": "~2.1"
+},
 "type": "mediawiki-extension",
 "autoload": {
-"files": [
-"Wikibase.composer.php"
-],
 "classmap": [
 "client/includes/",
 "client/WikibaseClient.hooks.php",
@@ -1286,7 +1286,7 @@
 "wikibaserepo",
 "wikidata"
 ],
-"time": "2015-06-15 09:45:54"
+"time": "2015-06-25 19:47:28"
 },
 {
 "name": "wikibase/wikimedia-badges",
diff --git a/extensions/Wikibase/Wikibase.composer.php 
b/extensions/Wikibase/Wikibase.composer.php
deleted file mode 100644
index ec45160..000
--- a/extensions/Wikibase/Wikibase.composer.php
+++ /dev/null
@@ -1,17 +0,0 @@
-getWikibaseClient()->getLangLinkHandler();
+   $settings = clone 
WikibaseClient::getDefaultInstance()->getSettings();
+
+   $settings->setSetting( 'siteGroup', 'wikipedia' );
+   $settings->setSetting( 'siteGlobalID', 'enwiki' );
+   $settings->setSetting( 'languageLinkSiteGroup', 'wikipedia' );
+
+   $wikibaseClient = new WikibaseClient( $settings, 
Language::factory( 'en' ), $this->getSiteStore() );
+
+   $returnValue = $wikibaseClient->getLangLinkHandler();
$this->assertInstanceOf( 'Wikibase\LangLinkHandler', 
$returnValue );
}
 
diff --git a/extensions/Wikibase/composer.json 
b/extensions/Wikibase/composer.json
index 2ed5674..ee01bbe 100644
--- a/extensions/Wikibase/composer.json
+++ b/extensions/Wikibase/composer.json
@@ -44,13 +44,13 @@
 
"diff/diff": "~2.0|~1.0"
},
+   "require-dev": {
+   "squizlabs/php_codesniffer": "~2.1"
+   },
"conflict": {
"mediawiki/mediawiki": "<1.23"
},
"autoload": {
-   "files" : [
-   "Wikibase.composer.php"
-   ],
"classmap": [
"client/includes/",
"client/WikibaseClient.hooks.php",
@@ -72,6 +72,9 @@
}
},
"scripts": {
-   "phpcs": "phpcs $PHPCS_ARGS -s --standard=phpcs.xml 
--ignore=extensions/ValueView,vendor --encoding=utf-8 --extensions=php"
+   "test": [
+   "composer phpcs"
+   ],
+   "phpcs": "vendor/bin/phpcs -sp --standard=phpcs.xml 
--extensions=php --ignore=extensions/ValueView,vendor ."
}
 }
diff --git a/extensions/Wikibase/repo/includes/store/sql/SqlIdGenerator.php 
b/extensions/Wikibase/repo/includes/store/sql/SqlIdGenerator.php
index 6b33d4c..5e7cbfc 100644
--- a/extensions/Wikibase/repo/includes/store/sql/SqlIdGenerator.php
+++ b/extensions/Wikibase/repo/includes/store/sql/SqlIdGenerator.php
@@ -73,7 +73,9 @@

[MediaWiki-commits] [Gerrit] Update Wikibase: Use SELECT FOR UPDATE in SqlIdGenerator - change (mediawiki...Wikidata)

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

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

Change subject: Update Wikibase: Use SELECT FOR UPDATE in SqlIdGenerator
..

Update Wikibase: Use SELECT FOR UPDATE in SqlIdGenerator

Change-Id: I527bcdaf38facbc0537cae9f718f85ce9f081f3c
---
M composer.lock
D extensions/Wikibase/Wikibase.composer.php
M extensions/Wikibase/Wikibase.php
M extensions/Wikibase/composer.json
M extensions/Wikibase/repo/includes/store/sql/SqlIdGenerator.php
M vendor/composer/autoload_files.php
M vendor/composer/installed.json
7 files changed, 31 insertions(+), 42 deletions(-)


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

diff --git a/composer.lock b/composer.lock
index 6e8f08d..68a2cbf 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1213,12 +1213,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-"reference": "335f05ba25d402852ef85f2fd17394418c234895"
+"reference": "bacf6c07b3dfe028550db6566cd8dbcd18920f41"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/335f05ba25d402852ef85f2fd17394418c234895";,
-"reference": "335f05ba25d402852ef85f2fd17394418c234895",
+"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/bacf6c07b3dfe028550db6566cd8dbcd18920f41";,
+"reference": "bacf6c07b3dfe028550db6566cd8dbcd18920f41",
 "shasum": ""
 },
 "require": {
@@ -1245,11 +1245,11 @@
 "conflict": {
 "mediawiki/mediawiki": "<1.23"
 },
+"require-dev": {
+"squizlabs/php_codesniffer": "~2.1"
+},
 "type": "mediawiki-extension",
 "autoload": {
-"files": [
-"Wikibase.composer.php"
-],
 "classmap": [
 "client/includes/",
 "client/WikibaseClient.hooks.php",
@@ -1286,7 +1286,7 @@
 "wikibaserepo",
 "wikidata"
 ],
-"time": "2015-06-15 09:45:54"
+"time": "2015-06-25 19:28:25"
 },
 {
 "name": "wikibase/wikimedia-badges",
diff --git a/extensions/Wikibase/Wikibase.composer.php 
b/extensions/Wikibase/Wikibase.composer.php
deleted file mode 100644
index ec45160..000
--- a/extensions/Wikibase/Wikibase.composer.php
+++ /dev/null
@@ -1,17 +0,0 @@
-selectRow(
'wb_id_counters',
'id_value',
-   array( 'id_type' => $type )
+   array( 'id_type' => $type ),
+   __METHOD__,
+   array( 'FOR UPDATE' )
);
 
if ( is_object( $currentId ) ) {
diff --git a/vendor/composer/autoload_files.php 
b/vendor/composer/autoload_files.php
index 980cbe4..c1388ee 100644
--- a/vendor/composer/autoload_files.php
+++ b/vendor/composer/autoload_files.php
@@ -23,5 +23,4 @@
 $vendorDir . '/data-values/data-types/DataTypes.php',
 $vendorDir . '/data-values/validators/Validators.php',
 $baseDir . '/extensions/WikimediaBadges/WikimediaBadges.php',
-$baseDir . '/extensions/Wikibase/Wikibase.composer.php',
 );
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 1158ef8..6d81057 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1303,12 +1303,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-"reference": "335f05ba25d402852ef85f2fd17394418c234895"
+"reference": "bacf6c07b3dfe028550db6566cd8dbcd18920f41"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/335f05ba25d402852ef85f2fd17394418c234895";,
-"reference": "335f05ba25d402852ef85f2fd17394418c234895",
+"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/bacf6c07b3dfe028550db6566cd8dbcd18920f41";,
+"reference": "bacf6c07b3dfe028550db6566cd8dbcd18920f41",
 "shasum": ""
 },
 "require": {
@@ -1335,13 +1335,13 @@
 "conflict": {
 "mediawiki/mediawiki": "<1.23"
 },
-"time": "2015-06-15 09:45:54",
+"require-dev": {
+"squizlabs/php_codesniffer": "~2.1"
+},
+"time": "2015-06-25 19:28:25",
 "type": "mediawiki-extension",
 "installation-source": "dist",
 "autoload": {
-