WikidataBuilder has uploaded a new change for review. https://gerrit.wikimedia.org/r/161651
Change subject: New Wikidata Build - 20/09/2014 10:00 ...................................................................... New Wikidata Build - 20/09/2014 10:00 Change-Id: I3569b7858c008bd2b06db8b644f478614b9aeabd --- D .gitignore D .gitreview D .travis.yml M README.md D WikibaseClient.settings.php D WikibaseRepo.settings.php M Wikidata.php M composer.json M composer.lock M extensions/PropertySuggester/PropertySuggester.php M extensions/PropertySuggester/src/PropertySuggester/GetSuggestions.php M extensions/PropertySuggester/src/PropertySuggester/Suggesters/SimpleSuggester.php M extensions/Wikibase/build/jenkins/mw-apply-wb-settings.sh M extensions/Wikibase/client/i18n/mk.json M extensions/Wikibase/client/i18n/pl.json M extensions/Wikibase/client/includes/RepoItemLinkGenerator.php M extensions/Wikibase/client/includes/RepoLinker.php M extensions/Wikibase/client/includes/WikibaseClient.php M extensions/Wikibase/client/includes/hooks/InfoActionHookHandler.php M extensions/Wikibase/client/includes/hooks/MovePageNotice.php M extensions/Wikibase/client/includes/recentchanges/ChangeLineFormatter.php M extensions/Wikibase/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js M extensions/Wikibase/client/resources/wikibase.client.linkitem.init.js M extensions/Wikibase/client/tests/phpunit/includes/RepoItemLinkGeneratorTest.php M extensions/Wikibase/client/tests/phpunit/includes/RepoLinkerTest.php M extensions/Wikibase/client/tests/phpunit/includes/WikibaseClientTest.php M extensions/Wikibase/client/tests/phpunit/includes/hooks/InfoActionHookHandlerTest.php M extensions/Wikibase/client/tests/phpunit/includes/hooks/MovePageNoticeTest.php M extensions/Wikibase/client/tests/phpunit/includes/recentchanges/ChangeLineFormatterTest.php A extensions/Wikibase/lib/resources/api/getLocationAgnosticMwApi.js M extensions/Wikibase/lib/resources/api/resources.php M extensions/Wikibase/lib/resources/wikibase.RepoApi/resources.php M extensions/Wikibase/lib/resources/wikibase.RepoApi/wikibase.RepoApi.js M extensions/Wikibase/repo/Wikibase.hooks.php M extensions/Wikibase/repo/includes/WikibaseRepo.php M extensions/Wikibase/repo/includes/actions/ViewEntityAction.php M extensions/Wikibase/repo/includes/content/EntityContent.php M extensions/Wikibase/repo/includes/content/EntityHandler.php M extensions/Wikibase/repo/includes/content/ItemHandler.php M extensions/Wikibase/repo/includes/content/PropertyHandler.php M extensions/Wikibase/repo/includes/specials/SpecialItemByTitle.php M extensions/Wikibase/repo/includes/specials/SpecialSetSiteLink.php M extensions/Wikibase/repo/tests/phpunit/includes/WikibaseRepoTest.php M extensions/Wikibase/repo/tests/phpunit/includes/content/EntityHandlerTest.php M extensions/Wikibase/repo/tests/phpunit/includes/content/ItemHandlerTest.php M extensions/Wikibase/repo/tests/phpunit/includes/content/PropertyHandlerTest.php M extensions/Wikibase/repo/tests/phpunit/includes/specials/SpecialSetSitelinkTest.php D src/SettingsFileGenerator.php D src/WikidataHooks.php D src/WikidataSettingsBuilder.php D tests/SettingsFileGeneratorTest.php D tests/WikidataSettingsBuilderTest.php M vendor/autoload.php M vendor/composer/ClassLoader.php M vendor/composer/autoload_classmap.php M vendor/composer/autoload_psr4.php M vendor/composer/autoload_real.php M vendor/composer/installed.json M vendor/wikibase/easyrdf_lite/CHANGELOG.md M vendor/wikibase/easyrdf_lite/EasyRdf.php M vendor/wikibase/easyrdf_lite/EasyRdf/Exception.php M vendor/wikibase/easyrdf_lite/EasyRdf/Format.php M vendor/wikibase/easyrdf_lite/EasyRdf/Graph.php M vendor/wikibase/easyrdf_lite/EasyRdf/Literal.php M vendor/wikibase/easyrdf_lite/EasyRdf/Literal/Boolean.php M vendor/wikibase/easyrdf_lite/EasyRdf/Literal/Date.php M vendor/wikibase/easyrdf_lite/EasyRdf/Literal/DateTime.php M vendor/wikibase/easyrdf_lite/EasyRdf/Literal/Decimal.php M vendor/wikibase/easyrdf_lite/EasyRdf/Literal/HexBinary.php M vendor/wikibase/easyrdf_lite/EasyRdf/Literal/Integer.php M vendor/wikibase/easyrdf_lite/EasyRdf/Namespace.php M vendor/wikibase/easyrdf_lite/EasyRdf/Resource.php M vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser.php M vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Arc.php M vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/GraphViz.php M vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Json.php M vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Ntriples.php M vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Rapper.php M vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/RdfPhp.php M vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/RdfXml.php M vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Turtle.php M vendor/wikibase/easyrdf_lite/EasyRdf/TypeMapper.php M vendor/wikibase/easyrdf_lite/EasyRdf/Utils.php M vendor/wikibase/easyrdf_lite/LICENSE.md M vendor/wikibase/easyrdf_lite/README.md 85 files changed, 362 insertions(+), 652 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata refs/changes/51/161651/1 diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a262133..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -composer.lock -extensions/ -vendor/ diff --git a/.gitreview b/.gitreview deleted file mode 100644 index a165c57..0000000 --- a/.gitreview +++ /dev/null @@ -1,6 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/Wikidata.git -defaultbranch=master -defaultrebase=0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4bf2db0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -language: php - -php: - - "5.3" - - "5.4" - - "5.5" - -env: - matrix: -# As new versions of mediawiki are released they should be added to the matrix - - MW=master DBTYPE=sqlite - - MW=master DBTYPE=mysql - -before_script: - - set -x - - originalDirectory=$(pwd) - - cd .. - - wget https://github.com/wikimedia/mediawiki-core/archive/$MW.tar.gz - - tar -zxf ${MW}.tar.gz - - mv mediawiki-core-${MW} mediawiki-core - - cd mediawiki-core - - export MW_INSTALL_PATH=$(pwd) - - mysql -e 'create database its_a_mw;' - - php maintenance/install.php --dbtype ${DBTYPE} --dbuser root --dbname its_a_mw --dbpath $(pwd) --pass nyan TravisWiki admin - - cd extensions - - git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Scribunto.git --depth 1 - - cp -r ${originalDirectory} Wikidata - - cd .. - - - echo 'error_reporting(E_ALL| E_STRICT);' >> LocalSettings.php - - echo 'ini_set("display_errors", 1);' >> LocalSettings.php - - echo '$wgShowExceptionDetails = true;' >> LocalSettings.php - - echo '$wgDevelopmentWarnings = true;' >> LocalSettings.php - - echo '$wgLanguageCode = "'en'";' >> LocalSettings.php - - echo "define( 'WB_EXPERIMENTAL_FEATURES', true );" >> LocalSettings.php - - - echo '$wgEnableWikibaseRepo = true;' >> LocalSettings.php - - echo '$wgEnableWikibaseClient = true;' >> LocalSettings.php - - echo '$wmgUseWikibaseRepo = true;' >> LocalSettings.php - - echo '$wmgUseWikibaseClient = true;' >> LocalSettings.php - - - echo 'require_once __DIR__ . "/extensions/Wikidata/Wikidata.php";' >> LocalSettings.php - - echo 'require_once __DIR__ . "/extensions/Wikidata/extensions/Wikibase/repo/ExampleSettings.php";' >> LocalSettings.php - - echo 'require_once __DIR__ . "/extensions/Scribunto/Scribunto.php";' >> LocalSettings.php - - - echo '$wgWBClientSettings["siteGlobalID"] = "enwiki";' >> LocalSettings.php - - - php maintenance/update.php --quick - -script: - - set -x - - cd ../mediawiki-core/tests/phpunit - - php phpunit.php --group Wikibase diff --git a/README.md b/README.md index 97432a7..831835b 100644 --- a/README.md +++ b/README.md @@ -64,4 +64,4 @@ ## Updating this README -This readme is located [here](https://github.com/wmde/WikidataBuildResources/blob/master/README.md). Any changes made to the README in the Wikidata build repo will be overwritten by this file daily. +This readme is located [here](https://github.com/wmde/WikidataBuilder/blob/master/build_config/Wikidata_master/build_resources/README.md). Any changes made to the README in the Wikidata build repo will be overwritten by this file daily. diff --git a/WikibaseClient.settings.php b/WikibaseClient.settings.php deleted file mode 100644 index 7fbc0fe..0000000 --- a/WikibaseClient.settings.php +++ /dev/null @@ -1,2 +0,0 @@ -<?php -$wgWBClientSettings["sharedCacheKeyPrefix"] = "wikibase:WBL/1411125958"; \ No newline at end of file diff --git a/WikibaseRepo.settings.php b/WikibaseRepo.settings.php deleted file mode 100644 index 93d5050..0000000 --- a/WikibaseRepo.settings.php +++ /dev/null @@ -1,2 +0,0 @@ -<?php -$wgWBRepoSettings["sharedCacheKeyPrefix"] = "wikibase:WBL/1411125958"; \ No newline at end of file diff --git a/Wikidata.php b/Wikidata.php index a9b64d5..78f8f5b 100644 --- a/Wikidata.php +++ b/Wikidata.php @@ -11,6 +11,7 @@ } $wmgUseWikibaseRepo = true; + $wmgUseWikibasePropertySuggester = true; $wmgUseWikibaseClient = true; } @@ -24,15 +25,11 @@ include_once __DIR__ . '/extensions/Wikibase/repo/Wikibase.php'; include_once __DIR__ . '/extensions/Wikidata.org/WikidataOrg.php'; include_once __DIR__ . '/extensions/PropertySuggester/PropertySuggester.php'; - include_once __DIR__ . '/WikibaseRepo.settings.php'; } if ( !empty( $wmgUseWikibaseClient ) ) { include_once __DIR__ . '/extensions/Wikibase/client/WikibaseClient.php'; - include_once __DIR__ . '/WikibaseClient.settings.php'; } - -$wgHooks['UnitTestsList'][] = '\Wikidata\WikidataHooks::onUnitTestsList'; $wgExtensionCredits['wikibase'][] = array( 'path' => __FILE__, @@ -45,7 +42,7 @@ ); // Jenkins stuff part2 -if ( PHP_SAPI === 'cli' && getenv( 'JOB_NAME' ) === 'mwext-Wikidata-testextension' ) { +if( PHP_SAPI === 'cli' && getenv( 'JOB_NAME' ) === 'mwext-Wikidata-testextension' ) { //Jenkins always loads both so no need to check if they are loaded before getting settings require_once __DIR__ . '/extensions/Wikibase/repo/ExampleSettings.php'; require_once __DIR__ . '/extensions/Wikibase/client/ExampleSettings.php'; diff --git a/composer.json b/composer.json index ff413cb..80cf4ea 100644 --- a/composer.json +++ b/composer.json @@ -11,19 +11,10 @@ ], "require": { "php": ">=5.3.0", - "propertysuggester/property-suggester": "~1.1.2", + "propertysuggester/property-suggester": "~1.1", "wikibase/wikibase": "dev-master", - "wikibase/wikimedia-badges": "dev-master", - "wikibase/Wikidata.org": "dev-master" - }, - "autoload": { - "psr-4": { - "Wikidata\\": "src/" - } - }, - "scripts": { - "post-install-cmd": "Wikidata\\SettingsFileGenerator::generateDefaultSettings", - "post-update-cmd": "Wikidata\\SettingsFileGenerator::generateDefaultSettings" + "wikibase/Wikidata.org": "dev-master", + "wikibase/wikimedia-badges": "dev-master" }, "config": { "github-oauth":{ diff --git a/composer.lock b/composer.lock index 23e67a9..4181171 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "649fd5e62e0696b0f5700c4a6b848393", + "hash": "bae1ec8030dc0fca521950e699fc5d97", "packages": [ { "name": "composer/installers", @@ -728,16 +728,16 @@ }, { "name": "propertysuggester/property-suggester", - "version": "1.1.2", + "version": "1.2", "source": { "type": "git", "url": "https://github.com/Wikidata-lib/PropertySuggester.git", - "reference": "3a2d2d54f5597c998230759eece5c70ab1835b28" + "reference": "722bc634e78eedad71f4bc2a2d5fbad217fb2258" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Wikidata-lib/PropertySuggester/zipball/3a2d2d54f5597c998230759eece5c70ab1835b28", - "reference": "3a2d2d54f5597c998230759eece5c70ab1835b28", + "url": "https://api.github.com/repos/Wikidata-lib/PropertySuggester/zipball/722bc634e78eedad71f4bc2a2d5fbad217fb2258", + "reference": "722bc634e78eedad71f4bc2a2d5fbad217fb2258", "shasum": "" }, "require": { @@ -771,7 +771,7 @@ "wikibase", "wikidata" ], - "time": "2014-09-05 10:14:36" + "time": "2014-09-12 12:05:41" }, { "name": "serialization/serialization", @@ -1191,12 +1191,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git", - "reference": "9a5a2e72fea975502082da6ef0c0c073856e3480" + "reference": "691871c26e656ccede48b916630d83dbde9baa1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/9a5a2e72fea975502082da6ef0c0c073856e3480", - "reference": "9a5a2e72fea975502082da6ef0c0c073856e3480", + "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/691871c26e656ccede48b916630d83dbde9baa1f", + "reference": "691871c26e656ccede48b916630d83dbde9baa1f", "shasum": "" }, "require": { @@ -1265,7 +1265,7 @@ "wikibaserepo", "wikidata" ], - "time": "2014-09-17 20:47:38" + "time": "2014-09-19 20:07:50" }, { "name": "wikibase/wikimedia-badges", @@ -1327,10 +1327,9 @@ "minimum-stability": "stable", "stability-flags": { "wikibase/wikibase": 20, - "wikibase/wikimedia-badges": 20, - "wikibase/wikidata.org": 20 + "wikibase/wikidata.org": 20, + "wikibase/wikimedia-badges": 20 }, - "prefer-stable": false, "platform": { "php": ">=5.3.0" }, diff --git a/extensions/PropertySuggester/PropertySuggester.php b/extensions/PropertySuggester/PropertySuggester.php index a0690dc..5265f62 100644 --- a/extensions/PropertySuggester/PropertySuggester.php +++ b/extensions/PropertySuggester/PropertySuggester.php @@ -9,7 +9,7 @@ return; } -define( 'PropertySuggester_VERSION', '1.1.2' ); +define( 'PropertySuggester_VERSION', '1.1.3 alpha' ); if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { require_once __DIR__ . '/vendor/autoload.php'; @@ -50,10 +50,15 @@ 'remoteExtPath' => $remoteExtPathParts[1], ); - global $wgPropertySuggesterDeprecatedIds; $wgPropertySuggesterDeprecatedIds = array( 107 // ( DEPRECATED main type ) ); + +global $wgPropertySuggesterClassifyingPropertyIds; +$wgPropertySuggesterClassifyingPropertyIds = array( + 31 // instance of +); + global $wgPropertySuggesterMinProbability; $wgPropertySuggesterMinProbability = 0.05; diff --git a/extensions/PropertySuggester/src/PropertySuggester/GetSuggestions.php b/extensions/PropertySuggester/src/PropertySuggester/GetSuggestions.php index e287f03..006ae8e 100644 --- a/extensions/PropertySuggester/src/PropertySuggester/GetSuggestions.php +++ b/extensions/PropertySuggester/src/PropertySuggester/GetSuggestions.php @@ -51,6 +51,7 @@ parent::__construct( $main, $name, $prefix ); global $wgPropertySuggesterDeprecatedIds; global $wgPropertySuggesterMinProbability; + global $wgPropertySuggesterClassifyingPropertyIds; $store = WikibaseRepo::getDefaultInstance()->getStore(); $this->termIndex = $store->getTermIndex(); @@ -59,6 +60,7 @@ $this->suggester = new SimpleSuggester( wfGetLB() ); $this->suggester->setDeprecatedPropertyIds( $wgPropertySuggesterDeprecatedIds ); + $this->suggester->setClassifyingPropertyIds( $wgPropertySuggesterClassifyingPropertyIds ); $this->paramsParser = new SuggesterParamsParser( 500, $wgPropertySuggesterMinProbability ); } diff --git a/extensions/PropertySuggester/src/PropertySuggester/Suggesters/SimpleSuggester.php b/extensions/PropertySuggester/src/PropertySuggester/Suggesters/SimpleSuggester.php index afbe9c1..a0521f8 100644 --- a/extensions/PropertySuggester/src/PropertySuggester/Suggesters/SimpleSuggester.php +++ b/extensions/PropertySuggester/src/PropertySuggester/Suggesters/SimpleSuggester.php @@ -9,7 +9,6 @@ use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\PropertyId; use ResultWrapper; -use Wikibase\DataModel\Snak\Snak; /** * a Suggester implementation that creates suggestion via MySQL @@ -23,6 +22,11 @@ * @var int[] */ private $deprecatedPropertyIds = array(); + + /** + * @var int[] + */ + private $classifyingProperties = array(); /** * @var LoadBalancer @@ -44,14 +48,22 @@ } /** + * @param int[] $classifyingPropertyIds + */ + public function setClassifyingPropertyIds( array $classifyingPropertyIds ) { + $this->classifyingProperties = $classifyingPropertyIds; + } + + /** * @param int[] $propertyIds + * @param string[] $idTuples * @param int $limit * @param float $minProbability * @param string $context * @throws InvalidArgumentException * @return Suggestion[] */ - protected function getSuggestions( array $propertyIds, $limit, $minProbability, $context ) { + protected function getSuggestions( array $propertyIds, array $idTuples, $limit, $minProbability, $context ) { $profiler = new ProfileSection( __METHOD__ ); if ( !is_int( $limit ) ) { throw new InvalidArgumentException( '$limit must be int!' ); @@ -67,11 +79,16 @@ $count = count( $propertyIds ); $dbr = $this->lb->getConnection( DB_SLAVE ); + if ($context === 'item'){ + $condition = '(pid1, qid1) IN (' . str_replace( "'", '', $dbr->makeList( $idTuples ) ) . ')'; + } + else{ + $condition = 'pid1 IN (' . $dbr->makeList( $propertyIds ) . ')'; + } $res = $dbr->select( 'wbs_propertypairs', array( 'pid' => 'pid2', 'prob' => "sum(probability)/$count" ), - array( 'pid1 IN (' . $dbr->makeList( $propertyIds ) . ')', - 'qid1' => null, + array( $condition, 'pid2 NOT IN (' . $dbr->makeList( $excludedIds ) . ')', 'context' => $context ), __METHOD__, @@ -80,8 +97,8 @@ 'ORDER BY' => 'prob DESC', 'LIMIT' => $limit, 'HAVING' => 'prob > ' . floatval( $minProbability ) - ) - ); + ) + ); $this->lb->reuseConnection( $dbr ); return $this->buildResult( $res ); @@ -98,8 +115,7 @@ */ public function suggestByPropertyIds( array $propertyIds, $limit, $minProbability, $context ) { $numericIds = array_map( array( $this, 'getNumericIdFromPropertyId' ), $propertyIds ); - - return $this->getSuggestions( $numericIds, $limit, $minProbability, $context ); + return $this->getSuggestions( $numericIds, array(), $limit, $minProbability, $context ); } /** @@ -107,14 +123,39 @@ * * @param Item $item * @param int $limit - * @param float $minProbability + * @param float $minProbability * @param string $context * @return Suggestion[] */ public function suggestByItem( Item $item, $limit, $minProbability, $context ) { $claims = $item->getClaims(); - $numericIds = array_unique( array_map( array( $this, 'getNumericIdFromClaim' ), $claims ) ); - return $this->getSuggestions( $numericIds, $limit, $minProbability, $context ); + $ids = array(); + $idTuples = array(); + foreach ( $claims as $claim ) { + $numericId = $this->getNumericIdFromClaim( $claim ); + $ids[] = $numericId; + if (! in_array( $numericId, $this->classifyingProperties ) ) { + $idTuples[] = $this->buildTuple( $numericId, 0 ); + } + else { + if ( $claim->getMainSnak()->getType() === "value" ) { + $dataValue = $claim->getMainSnak()->getDataValue(); + $id = ( int )substr( $dataValue->getEntityId()->getSerialization(), 1 ); + $idTuples[] = $this->buildTuple( $this->getNumericIdFromClaim( $claim ), $id ); + } + } + } + return $this->getSuggestions( $ids, $idTuples, $limit, $minProbability, $context ); + } + + /** + * @param string $a + * @param string $b + * @return string + */ + public function buildTuple( $a, $b ){ + $tuple = '('. $a .', '. $b .')'; + return $tuple; } /** @@ -133,12 +174,12 @@ return $resultArray; } - private function getNumericIdFromClaim( Claim $claim ) { - return $claim->getMainSnak()->getPropertyId()->getNumericId(); - } - private function getNumericIdFromPropertyId( PropertyId $propertyId ) { return $propertyId->getNumericId(); } + private function getNumericIdFromClaim( Claim $claim ) { + return $claim->getMainSnak()->getPropertyId()->getNumericId(); + } + } diff --git a/extensions/Wikibase/build/jenkins/mw-apply-wb-settings.sh b/extensions/Wikibase/build/jenkins/mw-apply-wb-settings.sh old mode 100755 new mode 100644 diff --git a/extensions/Wikibase/client/i18n/mk.json b/extensions/Wikibase/client/i18n/mk.json index a50ccf3..765ea37 100644 --- a/extensions/Wikibase/client/i18n/mk.json +++ b/extensions/Wikibase/client/i18n/mk.json @@ -19,7 +19,7 @@ "wikibase-comment-sitelink-change": "Изменета јазична врска од $1 на $2", "wikibase-comment-sitelink-remove": "Отстранета јазична врска: $1", "wikibase-comment-multi": "$1 {{PLURAL:$1|промена|промени}}", - "wikibase-dataitem": "Единица на {{WBREPONAME}}", + "wikibase-dataitem": "Предмет на {{WBREPONAME}}", "wikibase-editlinks": "Уреди врски", "wikibase-editlinkstitle": "Уредување на меѓујазични врски", "wikibase-linkitem-addlinks": "Додај врски", diff --git a/extensions/Wikibase/client/i18n/pl.json b/extensions/Wikibase/client/i18n/pl.json index 0050db0..a6e5fa8 100644 --- a/extensions/Wikibase/client/i18n/pl.json +++ b/extensions/Wikibase/client/i18n/pl.json @@ -9,7 +9,8 @@ "Odie2", "WTM", "Alan ffm", - "Peter Bowman" + "Peter Bowman", + "Tar Lócesilion" ] }, "wikibase-client-desc": "Klient rozszerzenia Wikibase", @@ -67,5 +68,5 @@ "wikibase-property-render-error": "Nie można zrenderować właściwości $1: $2", "wikibase-otherprojects": "Inne projekty", "wikibase-otherprojects-beta-message": "Pasek siostrzanych projektów", - "wikibase-otherprojects-beta-description": "Dodaje sekcję „{{int:wikibase-otherprojects}}” do paska bocznego, zawierającą odnośniki do innych projektów Wikimedia w oparciu o dane w serwisie {{WBREPONAME}}." + "wikibase-otherprojects-beta-description": "Dodaje sekcję „{{int:wikibase-otherprojects}}” do paska bocznego, zawierającą odnośniki do innych projektów Wikimedia w oparciu o dane z {{GRAMMAR:D.lp|{{WBREPONAME}}}}." } diff --git a/extensions/Wikibase/client/includes/RepoItemLinkGenerator.php b/extensions/Wikibase/client/includes/RepoItemLinkGenerator.php index 962e080..6337dae 100644 --- a/extensions/Wikibase/client/includes/RepoItemLinkGenerator.php +++ b/extensions/Wikibase/client/includes/RepoItemLinkGenerator.php @@ -3,6 +3,7 @@ namespace Wikibase; use Title; +use Wikibase\Client\RepoLinker; use Wikibase\DataModel\Entity\EntityIdParser; /** diff --git a/extensions/Wikibase/client/includes/RepoLinker.php b/extensions/Wikibase/client/includes/RepoLinker.php index 4441985..586b0a2 100644 --- a/extensions/Wikibase/client/includes/RepoLinker.php +++ b/extensions/Wikibase/client/includes/RepoLinker.php @@ -1,9 +1,10 @@ <?php -namespace Wikibase; +namespace Wikibase\Client; use Html; use InvalidArgumentException; +use Wikibase\DataModel\Entity\EntityId; /** * @since 0.2 @@ -22,12 +23,10 @@ private $namespaces; /** - * @since 0.4 - * * @param string $baseUrl * @param string $articlePath * @param string $scriptPath - * @param array $namespaces // repoNamespaces setting + * @param string[] $namespaces // repoNamespaces setting */ public function __construct( $baseUrl, $articlePath, $scriptPath, array $namespaces ) { $this->baseUrl = $baseUrl; @@ -85,8 +84,6 @@ } /** - * Encode a page title - * * @param string $page * * @return string @@ -145,7 +142,7 @@ * @todo: use a more robust mechanism for building entity titles * if efficient enough, maybe EntityTitleLookup. * - * @param EntityId + * @param EntityId $entityId * * @return string */ @@ -163,7 +160,7 @@ /** * Constructs a link to an entity * - * @param EntityId + * @param EntityId $entityId * * @return string */ diff --git a/extensions/Wikibase/client/includes/WikibaseClient.php b/extensions/Wikibase/client/includes/WikibaseClient.php index 0e8d089..045f148 100644 --- a/extensions/Wikibase/client/includes/WikibaseClient.php +++ b/extensions/Wikibase/client/includes/WikibaseClient.php @@ -46,7 +46,6 @@ use Wikibase\Lib\WikibaseSnakFormatterBuilders; use Wikibase\Lib\WikibaseValueFormatterBuilders; use Wikibase\NamespaceChecker; -use Wikibase\RepoLinker; use Wikibase\Settings; use Wikibase\SettingsArray; use Wikibase\StringNormalizer; @@ -141,7 +140,7 @@ * @since 0.4 * * @param SettingsArray $settings - * @param Language $contentLanguage + * @param Language $contentLanguage * @param SiteStore $siteStore */ public function __construct( @@ -236,7 +235,7 @@ * * @return SnakFormatter */ - public function newSnakFormatter( $format = SnakFormatter::FORMAT_PLAIN, FormatterOptions $options ) { + public function newSnakFormatter( $format = SnakFormatter::FORMAT_PLAIN, FormatterOptions $options ) { return $this->getSnakFormatterFactory()->getSnakFormatter( $format, $options ); } @@ -404,8 +403,8 @@ if ( !in_array( $localId, $this->site->getLocalIds() ) ) { wfDebugLog( __CLASS__, __FUNCTION__ - . ": The configured local id $localId does not match any local ID of site $globalId: " - . var_export( $this->site->getLocalIds(), true ) ); + . ": The configured local id $localId does not match any local ID of site $globalId: " + . var_export( $this->site->getLocalIds(), true ) ); } } @@ -445,6 +444,7 @@ if ( !$site ) { wfWarn( 'Cannot find site ' . $siteId . ' in sites table' ); + return true; } @@ -497,6 +497,7 @@ ); $factory = new OutputFormatSnakFormatterFactory( $builders->getSnakFormatterBuildersForFormats() ); + return $factory; } @@ -524,6 +525,7 @@ ); $factory = new OutputFormatValueFormatterFactory( $builders->getValueFormatterBuildersForFormats() ); + return $factory; } @@ -738,4 +740,4 @@ ); } -} +} \ No newline at end of file diff --git a/extensions/Wikibase/client/includes/hooks/InfoActionHookHandler.php b/extensions/Wikibase/client/includes/hooks/InfoActionHookHandler.php index 2f0f7a1..201e76a 100644 --- a/extensions/Wikibase/client/includes/hooks/InfoActionHookHandler.php +++ b/extensions/Wikibase/client/includes/hooks/InfoActionHookHandler.php @@ -4,11 +4,11 @@ use IContextSource; use Title; +use Wikibase\Client\RepoLinker; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\SiteLink; use Wikibase\Lib\Store\SiteLinkLookup; use Wikibase\NamespaceChecker; -use Wikibase\RepoLinker; /** * @since 0.5 diff --git a/extensions/Wikibase/client/includes/hooks/MovePageNotice.php b/extensions/Wikibase/client/includes/hooks/MovePageNotice.php index 7c63a0e..cb94d9c 100644 --- a/extensions/Wikibase/client/includes/hooks/MovePageNotice.php +++ b/extensions/Wikibase/client/includes/hooks/MovePageNotice.php @@ -6,7 +6,6 @@ use Title; use Wikibase\DataModel\SiteLink; use Wikibase\Lib\Store\SiteLinkLookup; -use Wikibase\RepoLinker; /** * Adds a notice about the Wikibase Item belonging to the current page diff --git a/extensions/Wikibase/client/includes/recentchanges/ChangeLineFormatter.php b/extensions/Wikibase/client/includes/recentchanges/ChangeLineFormatter.php index 20b80b1..e80e7e0 100644 --- a/extensions/Wikibase/client/includes/recentchanges/ChangeLineFormatter.php +++ b/extensions/Wikibase/client/includes/recentchanges/ChangeLineFormatter.php @@ -6,6 +6,7 @@ use Linker; use Title; use User; +use Wikibase\Client\RepoLinker; /** * Formats a changes line for including changes from the Wikibase repo in diff --git a/extensions/Wikibase/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js b/extensions/Wikibase/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js index 1a1ba47..746edef 100644 --- a/extensions/Wikibase/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js +++ b/extensions/Wikibase/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js @@ -12,6 +12,8 @@ * current one. All these options default to global state / the current page's attributes. * @since 0.4 * + * @option mwApiForRep {mediaWiki.Api} A mw.Api instance configured to use the repo's API. + * * @option pageTitle {string} Title of the page to link. * * @option globalSiteId {string} Id of the site the given page is on. @@ -30,11 +32,6 @@ * (1) {jQuery.Event} */ $.widget( 'wikibase.linkitem', { - /** - * @type wikibase.RepoApi - */ - _repoApi: null, - /** * @type wikibase.PageConnector */ @@ -74,7 +71,7 @@ * @see jQuery.Widget.options */ options: { - repoApi: null, + mwApiForRepo: null, pageTitle: null, globalSiteId: null, namespaceNumber: null, @@ -92,13 +89,11 @@ var self = this, $dialogSpinner = $.createSpinner(); - this._repoApi = this.options.repoApi; - this.element .hide() .after( $dialogSpinner ); - this._repoApi.get( { + this.options.mwApiForRepo.get( { action: 'query', meta: 'userinfo' } ) @@ -352,7 +347,7 @@ this.targetArticle = $( '#wbclient-linkItem-page' ).val(); this._pageConnector = new wb.PageConnector( - this._repoApi, + new wb.RepoApi(), this.options.globalSiteId, this.options.pageTitle, this.targetSite, diff --git a/extensions/Wikibase/client/resources/wikibase.client.linkitem.init.js b/extensions/Wikibase/client/resources/wikibase.client.linkitem.init.js index d2d0226..6b5e66b 100644 --- a/extensions/Wikibase/client/resources/wikibase.client.linkitem.init.js +++ b/extensions/Wikibase/client/resources/wikibase.client.linkitem.init.js @@ -21,18 +21,19 @@ 'jquery.wikibase.linkitem', 'mediawiki.Title', 'mw.config.values.wbRepo', - 'wikibase.RepoApi' + 'wikibase.api.getLocationAgnosticMwApi' ], function() { - var wb = wikibase; - $spinner.remove(); - var repoConfig = mw.config.get( 'wbRepo' ); + var repoConfig = mw.config.get( 'wbRepo' ), + repoApiEndpoint = repoConfig.url + repoConfig.scriptPath + '/api.php', + mwApiForRepo = wikibase.api.getLocationAgnosticMwApi( repoApiEndpoint ); + $linkItemLink .show() .linkitem( { - repoApi: new wb.RepoApi(), + mwApiForRepo: mwApiForRepo, pageTitle: ( new mw.Title( mw.config.get( 'wgTitle' ), mw.config.get( 'wgNamespaceNumber' ) diff --git a/extensions/Wikibase/client/tests/phpunit/includes/RepoItemLinkGeneratorTest.php b/extensions/Wikibase/client/tests/phpunit/includes/RepoItemLinkGeneratorTest.php index b29037a..f73e7c7 100644 --- a/extensions/Wikibase/client/tests/phpunit/includes/RepoItemLinkGeneratorTest.php +++ b/extensions/Wikibase/client/tests/phpunit/includes/RepoItemLinkGeneratorTest.php @@ -4,10 +4,10 @@ use Language; use Title; +use Wikibase\Client\RepoLinker; use Wikibase\DataModel\Entity\BasicEntityIdParser; use Wikibase\NamespaceChecker; use Wikibase\RepoItemLinkGenerator; -use Wikibase\RepoLinker; /** * @covers Wikibase\RepoItemLinkGenerator diff --git a/extensions/Wikibase/client/tests/phpunit/includes/RepoLinkerTest.php b/extensions/Wikibase/client/tests/phpunit/includes/RepoLinkerTest.php index 999d8d4..d23f5dd 100644 --- a/extensions/Wikibase/client/tests/phpunit/includes/RepoLinkerTest.php +++ b/extensions/Wikibase/client/tests/phpunit/includes/RepoLinkerTest.php @@ -2,13 +2,13 @@ namespace Wikibase\Test; +use Wikibase\Client\RepoLinker; use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\RepoLinker; /** - * @covers Wikibase\RepoLinker + * @covers Wikibase\Client\RepoLinker * * @group WikibaseClient * @group RepoLinkerTest diff --git a/extensions/Wikibase/client/tests/phpunit/includes/WikibaseClientTest.php b/extensions/Wikibase/client/tests/phpunit/includes/WikibaseClientTest.php index abc2875..a8fa543 100644 --- a/extensions/Wikibase/client/tests/phpunit/includes/WikibaseClientTest.php +++ b/extensions/Wikibase/client/tests/phpunit/includes/WikibaseClientTest.php @@ -60,7 +60,7 @@ public function testNewRepoLinkerReturnType() { $returnValue = $this->getDefaultInstance()->newRepoLinker(); - $this->assertInstanceOf( 'Wikibase\RepoLinker', $returnValue ); + $this->assertInstanceOf( 'Wikibase\Client\RepoLinker', $returnValue ); } public function testGetLanguageFallbackChainFactoryReturnType() { diff --git a/extensions/Wikibase/client/tests/phpunit/includes/hooks/InfoActionHookHandlerTest.php b/extensions/Wikibase/client/tests/phpunit/includes/hooks/InfoActionHookHandlerTest.php index 083f4d2..2f91f94 100644 --- a/extensions/Wikibase/client/tests/phpunit/includes/hooks/InfoActionHookHandlerTest.php +++ b/extensions/Wikibase/client/tests/phpunit/includes/hooks/InfoActionHookHandlerTest.php @@ -87,7 +87,7 @@ ->method( 'isWikibaseEnabled' ) ->will( $this->returnValue( $enabled ) ); - $repoLinker = $this->getMockBuilder( '\Wikibase\RepoLinker' ) + $repoLinker = $this->getMockBuilder( '\Wikibase\Client\RepoLinker' ) ->disableOriginalConstructor() ->getMock(); diff --git a/extensions/Wikibase/client/tests/phpunit/includes/hooks/MovePageNoticeTest.php b/extensions/Wikibase/client/tests/phpunit/includes/hooks/MovePageNoticeTest.php index 24bb775..0eebad3 100644 --- a/extensions/Wikibase/client/tests/phpunit/includes/hooks/MovePageNoticeTest.php +++ b/extensions/Wikibase/client/tests/phpunit/includes/hooks/MovePageNoticeTest.php @@ -5,9 +5,9 @@ use Language; use Title; use Wikibase\Client\MovePageNotice; +use Wikibase\Client\RepoLinker; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\SiteLink; -use Wikibase\RepoLinker; /** * @covers Wikibase\Client\MovePageNotice diff --git a/extensions/Wikibase/client/tests/phpunit/includes/recentchanges/ChangeLineFormatterTest.php b/extensions/Wikibase/client/tests/phpunit/includes/recentchanges/ChangeLineFormatterTest.php index dfd255e..92e0a6b 100644 --- a/extensions/Wikibase/client/tests/phpunit/includes/recentchanges/ChangeLineFormatterTest.php +++ b/extensions/Wikibase/client/tests/phpunit/includes/recentchanges/ChangeLineFormatterTest.php @@ -9,8 +9,8 @@ use RequestContext; use User; use Wikibase\ChangeLineFormatter; +use Wikibase\Client\RepoLinker; use Wikibase\ExternalChangeFactory; -use Wikibase\RepoLinker; /** * @covers Wikibase\ChangeLineFormatter diff --git a/extensions/Wikibase/lib/resources/api/getLocationAgnosticMwApi.js b/extensions/Wikibase/lib/resources/api/getLocationAgnosticMwApi.js new file mode 100644 index 0000000..0c832f4 --- /dev/null +++ b/extensions/Wikibase/lib/resources/api/getLocationAgnosticMwApi.js @@ -0,0 +1,45 @@ +/** + * @licence GNU GPL v2+ + * @author Adrian Lang < adrian.l...@wikimedia.de > + */ +( function( mw, wb ) { +'use strict'; + +/** + * Returns a mediaWiki.Api instance which can transparently interact with remote APIs. + * @since 0.5 + * @todo Merge this into mw.Api + * + * @param {string} apiEndpoint + * @return {mediaWiki.Api} + */ +wb.api.getLocationAgnosticMwApi = function( apiEndpoint ) { + var localApiEndpoint = mw.config.get( 'wgServer' ) + + mw.config.get( 'wgScriptPath' ) + + '/api.php'; + var mwApiOptions = {}; + + if( localApiEndpoint !== apiEndpoint ) { + var corsOrigin = mw.config.get( 'wgServer' ); + if ( corsOrigin.indexOf( '//' ) === 0 ) { + // The origin parameter musn't be protocol relative + corsOrigin = document.location.protocol + corsOrigin; + } + mwApiOptions = { + ajax: { + url: apiEndpoint, + xhrFields: { + withCredentials: true + }, + crossDomain: true + }, + parameters: { + origin: corsOrigin + } + }; + } + + return new mw.Api( mwApiOptions ); +}; + +}( mediaWiki, wikibase ) ); diff --git a/extensions/Wikibase/lib/resources/api/resources.php b/extensions/Wikibase/lib/resources/api/resources.php index 80ccdae..93c9f94 100644 --- a/extensions/Wikibase/lib/resources/api/resources.php +++ b/extensions/Wikibase/lib/resources/api/resources.php @@ -33,6 +33,16 @@ ) ), + 'wikibase.api.getLocationAgnosticMwApi' => $moduleTemplate + array( + 'scripts' => array( + 'getLocationAgnosticMwApi.js', + ), + 'dependencies' => array( + 'mediawiki.api', + 'wikibase.api.__namespace', + ), + ), + 'wikibase.api.ParseValueCaller' => $moduleTemplate + array( 'scripts' => array( 'ParseValueCaller.js', diff --git a/extensions/Wikibase/lib/resources/wikibase.RepoApi/resources.php b/extensions/Wikibase/lib/resources/wikibase.RepoApi/resources.php index 3182b22..ea41c1d 100644 --- a/extensions/Wikibase/lib/resources/wikibase.RepoApi/resources.php +++ b/extensions/Wikibase/lib/resources/wikibase.RepoApi/resources.php @@ -33,10 +33,9 @@ ), 'dependencies' => array( 'json', - 'user.tokens', - 'mediawiki.api', 'mw.config.values.wbRepo', 'wikibase', + 'wikibase.api.getLocationAgnosticMwApi', ), ), diff --git a/extensions/Wikibase/lib/resources/wikibase.RepoApi/wikibase.RepoApi.js b/extensions/Wikibase/lib/resources/wikibase.RepoApi/wikibase.RepoApi.js index 4dd2e7c..317a028 100644 --- a/extensions/Wikibase/lib/resources/wikibase.RepoApi/wikibase.RepoApi.js +++ b/extensions/Wikibase/lib/resources/wikibase.RepoApi/wikibase.RepoApi.js @@ -8,47 +8,25 @@ ( function( mw, wb, $ ) { 'use strict'; +var repoConfig = mw.config.get( 'wbRepo' ); +var repoApiEndpoint = repoConfig.url + repoConfig.scriptPath + '/api.php'; +var mwApi = wb.api.getLocationAgnosticMwApi( repoApiEndpoint ); + /** * Constructor to create an API object for interaction with the repo Wikibase API. * @constructor * @since 0.4 (since 0.3 as wb.Api without support for client usage) */ wb.RepoApi = function wbRepoApi() { - var localApiEndpoint = mw.config.get( 'wgServer' ) - + mw.config.get( 'wgScriptPath' ) - + '/api.php'; - - this._repoConfig = mw.config.get( 'wbRepo' ); - this._repoApiEndpoint = this._repoConfig.url + this._repoConfig.scriptPath + '/api.php'; - - if( localApiEndpoint === this._repoApiEndpoint ) { - // The current wiki *is* the repo so we can just use user.tokens to get the edit token - this._repoEditToken = mw.user.tokens.get( 'editToken' ); - } }; $.extend( wb.RepoApi.prototype, { - /** - * @type {string} - */ - _repoApiEndpoint: null, - - /** - * @type {Object} - */ - _repoConfig: null, - - /** - * @type {string} - */ - _repoEditToken: null, - /** * mediaWiki.Api object for internal usage. By having this initialized in the prototype, we can * share one instance for all instances of the wikibase API. * @type mw.Api */ - _api: new mw.Api(), + _api: mwApi, /** * Creates a new entity with the given type and data. @@ -63,7 +41,7 @@ data: JSON.stringify( data ), 'new': type }; - return this.post( params ); + return this._post( params ); }, /** @@ -87,7 +65,7 @@ params.clear = true; } - return this.post( params ); + return this._post( params ); }, /** @@ -114,7 +92,7 @@ params.generate = outputFormat; } - return this.get( params ); + return this._api.get( params ); }, /** @@ -141,7 +119,7 @@ dir: dir || undefined }; - return this.get( params ); + return this._api.get( params ); }, /** @@ -172,7 +150,7 @@ normalize: normalize || undefined }; - return this.get( params ); + return this._api.get( params ); }, /** @@ -190,7 +168,7 @@ values: values.join( '|' ), options: JSON.stringify( options ) }; - return this.get( params ); + return this._api.get( params ); }, /** @@ -213,7 +191,7 @@ 'continue': offset || undefined }; - return this.get( params ); + return this._api.get( params ); }, /** @@ -233,7 +211,7 @@ language: language, baserevid: baseRevId }; - return this.post( params ); + return this._post( params ); }, /** @@ -253,7 +231,7 @@ language: language, baserevid: baseRevId }; - return this.post( params ); + return this._post( params ); }, /** @@ -277,7 +255,7 @@ language: language, baserevid: baseRevId }; - return this.post( params ); + return this._post( params ); }, /** @@ -300,7 +278,7 @@ params.index = index; } - return this.post( params ); + return this._post( params ); }, /** @@ -326,7 +304,7 @@ params.value = JSON.stringify( value ); } - return this.post( params ); + return this._post( params ); }, /** @@ -336,7 +314,7 @@ * @return {jQuery.Promise} */ removeClaim: function( claimGuid ) { - return this.post( { + return this._post( { action: 'wbremoveclaims', claim: claimGuid } ); @@ -364,7 +342,7 @@ props: props }; - return this.get( params ); + return this._api.get( params ); }, /** @@ -392,7 +370,7 @@ params.value = JSON.stringify( value ); } - return this.post( params ); + return this._post( params ); }, /** @@ -431,7 +409,7 @@ params.index = index; } - return this.post( params ); + return this._post( params ); }, /** @@ -452,7 +430,7 @@ baserevid: baseRevId }; - return this.post( params ); + return this._post( params ); }, /** @@ -478,7 +456,7 @@ params.badges = this._normalizeParam( badges ); } - return this.post( params ); + return this._post( params ); }, /** @@ -506,40 +484,7 @@ params.summary = summary; } - return this.post( params ); - }, - - /** - * Set the required options and parameters for a repo call from a client, if needed - * - * @since 0.4 - * - * @param {object} params parameters for the API call - * @param {object} options AJAX options - */ - _extendRepoCallParams: function( params, options ) { - var localServerRaw = mw.config.get( 'wgServer' ).replace( /.*\/\//, '' ), - repoServerRaw = mw.config.get( 'wbRepo' ).url.replace( /.*\/\//, '' ).replace( /\/.*/, '' ); - - options.url = this._repoApiEndpoint; - - if ( localServerRaw === repoServerRaw ) { - // We don't need/ want CORS when on the same domain - return; - } - - options.xhrFields = { - withCredentials: true - }; - options.crossDomain = true; - - var currentServer = mw.config.get( 'wgServer' ); - if ( currentServer.indexOf( '//' ) === 0 ) { - // The origin parameter musn't be protocol relative - currentServer = document.location.protocol + currentServer; - } - - params.origin = currentServer; + return this._post( params ); }, /** @@ -570,12 +515,7 @@ * * @throws {Error} If a parameter is not specified properly */ - post: function( params ) { - var self = this, - options = {}, - deferred = $.Deferred(); - - this._extendRepoCallParams( params, options ); + _post: function( params ) { // Unconditionally set the bot parameter to match the UI behaviour of core params.bot = 1; @@ -585,68 +525,7 @@ } } ); - this._getRepoEditToken() - .done( function( token ) { - params.token = token; - - self._api.post( params, options ) - .done( deferred.resolve ) - .fail( deferred.reject ); - } ) - .fail( deferred.reject ); - - return deferred.promise(); - }, - - /** - * Retrieves an edit token. - * - * @return {jQuery.Promise} - * Resolved parameters: - * - {string} - * Rejected parameters: - * - {string} - * - {*} - */ - _getRepoEditToken: function() { - var self = this, - deferred = $.Deferred(); - - if( this._repoEditToken ) { - return deferred.resolve( this._repoEditToken ).promise(); - } - - this.get( { - action: 'query', - meta: 'tokens' - } ) - .done( function( data ) { - self._repoEditToken = data.query.tokens.csrftoken; - deferred.resolve( self._repoEditToken ); - } ) - .fail( deferred.reject ); - - return deferred.promise(); - }, - - /** - * Performs an API get request. - * @see mw.Api.get - * @since 0.3 - * - * @param {Object} params - * @return {jQuery.Promise} - * Resolved parameters: - * - {*} - * Rejected parameters: - * - {string} - * - {*} - */ - 'get': function( params ) { - var options = {}; - this._extendRepoCallParams( params, options ); - - return this._api.get( params, options ); + return this._api.postWithToken( 'edit', params ); } } ); diff --git a/extensions/Wikibase/repo/Wikibase.hooks.php b/extensions/Wikibase/repo/Wikibase.hooks.php index 9e7795f..02ef64b 100644 --- a/extensions/Wikibase/repo/Wikibase.hooks.php +++ b/extensions/Wikibase/repo/Wikibase.hooks.php @@ -32,6 +32,7 @@ use User; use Wikibase\Hook\MakeGlobalVariablesScriptHandler; use Wikibase\Hook\OutputPageJsConfigHookHandler; +use Wikibase\Repo\Content\EntityHandler; use Wikibase\Repo\View\TextInjector; use Wikibase\Repo\WikibaseRepo; use WikiPage; diff --git a/extensions/Wikibase/repo/includes/WikibaseRepo.php b/extensions/Wikibase/repo/includes/WikibaseRepo.php index cc2884b..4df3146 100644 --- a/extensions/Wikibase/repo/includes/WikibaseRepo.php +++ b/extensions/Wikibase/repo/includes/WikibaseRepo.php @@ -25,7 +25,6 @@ use Wikibase\EntityFactory; use Wikibase\InternalSerialization\DeserializerFactory; use Wikibase\InternalSerialization\SerializerFactory; -use Wikibase\ItemHandler; use Wikibase\LabelDescriptionDuplicateDetector; use Wikibase\LanguageFallbackChainFactory; use Wikibase\Lib\Changes\EntityChangeFactory; @@ -51,9 +50,10 @@ use Wikibase\Lib\WikibaseSnakFormatterBuilders; use Wikibase\Lib\WikibaseValueFormatterBuilders; use Wikibase\ParserOutputJsConfigBuilder; -use Wikibase\PropertyHandler; use Wikibase\ReferencedEntitiesFinder; use Wikibase\Repo\Content\EntityContentFactory; +use Wikibase\Repo\Content\ItemHandler; +use Wikibase\Repo\Content\PropertyHandler; use Wikibase\Repo\Localizer\ChangeOpValidationExceptionLocalizer; use Wikibase\Repo\Localizer\MessageParameterFormatter; use Wikibase\Repo\Notifications\ChangeNotifier; @@ -495,6 +495,7 @@ ); $factory = new OutputFormatSnakFormatterFactory( $builders->getSnakFormatterBuildersForFormats() ); + return $factory; } @@ -519,6 +520,7 @@ $builders = $this->getValueFormatterBuilders(); $factory = new OutputFormatValueFormatterFactory( $builders->getValueFormatterBuildersForFormats() ); + return $factory; } @@ -712,7 +714,8 @@ private function getChangeTransmitter() { if ( $this->settings->getSetting( 'useChangesTable' ) ) { return new DatabaseChangeTransmitter(); - } else { + } + else { return new DummyChangeTransmitter(); } } @@ -904,7 +907,10 @@ $entitySerializerClass ); } - return array( 'Wikibase\Lib\Serializers\LegacyInternalEntitySerializer', 'isBlobUsingLegacyFormat' ); + return array( + 'Wikibase\Lib\Serializers\LegacyInternalEntitySerializer', + 'isBlobUsingLegacyFormat' + ); } /** @@ -918,4 +924,5 @@ $this->getEntityFactory() ); } -} + +} \ No newline at end of file diff --git a/extensions/Wikibase/repo/includes/actions/ViewEntityAction.php b/extensions/Wikibase/repo/includes/actions/ViewEntityAction.php index f2118b8..1e177c1 100644 --- a/extensions/Wikibase/repo/includes/actions/ViewEntityAction.php +++ b/extensions/Wikibase/repo/includes/actions/ViewEntityAction.php @@ -7,6 +7,7 @@ use LogEventsList; use SpecialPage; use ViewAction; +use Wikibase\Repo\Content\EntityHandler; use Wikibase\Repo\Store\EntityPermissionChecker; use Wikibase\Repo\WikibaseRepo; diff --git a/extensions/Wikibase/repo/includes/content/EntityContent.php b/extensions/Wikibase/repo/includes/content/EntityContent.php index 5ed8dfa..a2b35b0 100644 --- a/extensions/Wikibase/repo/includes/content/EntityContent.php +++ b/extensions/Wikibase/repo/includes/content/EntityContent.php @@ -32,6 +32,7 @@ use Wikibase\Lib\Store\EntityRedirect; use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Repo\Content\EntityContentDiff; +use Wikibase\Repo\Content\EntityHandler; use Wikibase\Repo\EntitySearchTextGenerator; use Wikibase\Repo\WikibaseRepo; use WikiPage; diff --git a/extensions/Wikibase/repo/includes/content/EntityHandler.php b/extensions/Wikibase/repo/includes/content/EntityHandler.php index bfe5b87..c74ce31 100644 --- a/extensions/Wikibase/repo/includes/content/EntityHandler.php +++ b/extensions/Wikibase/repo/includes/content/EntityHandler.php @@ -1,6 +1,6 @@ <?php -namespace Wikibase; +namespace Wikibase\Repo\Content; use Content; use ContentHandler; @@ -19,17 +19,20 @@ use User; use ValueValidators\Result; use Wikibase\DataModel\Entity\BasicEntityIdParser; +use Wikibase\DataModel\Entity\Entity; +use Wikibase\DataModel\Entity\EntityId; +use Wikibase\EntityContent; +use Wikibase\EntityPerPage; use Wikibase\Lib\Store\EntityContentDataCodec; use Wikibase\Lib\Store\EntityRedirect; -use Wikibase\Lib\Store\EntityTitleLookup; +use Wikibase\NamespaceUtils; +use Wikibase\TermIndex; use Wikibase\Updates\DataUpdateAdapter; use Wikibase\Validators\EntityValidator; use Wikibase\Validators\ValidatorErrorLocalizer; /** * Base handler class for Wikibase\DataModel\Entity\Entity content classes. - * - * @since 0.1 * * @licence GNU GPL v2+ * @author Daniel Kinzler diff --git a/extensions/Wikibase/repo/includes/content/ItemHandler.php b/extensions/Wikibase/repo/includes/content/ItemHandler.php index dbf2a0a..3f8c5d3 100644 --- a/extensions/Wikibase/repo/includes/content/ItemHandler.php +++ b/extensions/Wikibase/repo/includes/content/ItemHandler.php @@ -1,12 +1,17 @@ <?php -namespace Wikibase; +namespace Wikibase\Repo\Content; use DataUpdate; use Title; +use Wikibase\DataModel\Entity\EntityId; +use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; +use Wikibase\EntityContent; +use Wikibase\EntityPerPage; use Wikibase\Lib\Store\EntityContentDataCodec; use Wikibase\Lib\Store\SiteLinkCache; +use Wikibase\TermIndex; use Wikibase\Updates\DataUpdateAdapter; use Wikibase\Validators\EntityValidator; use Wikibase\Validators\ValidatorErrorLocalizer; diff --git a/extensions/Wikibase/repo/includes/content/PropertyHandler.php b/extensions/Wikibase/repo/includes/content/PropertyHandler.php index bbaf075..2e9d074 100644 --- a/extensions/Wikibase/repo/includes/content/PropertyHandler.php +++ b/extensions/Wikibase/repo/includes/content/PropertyHandler.php @@ -1,11 +1,20 @@ <?php -namespace Wikibase; +namespace Wikibase\Repo\Content; use DataUpdate; +use InvalidArgumentException; use Title; +use Wikibase\DataModel\Entity\Entity; +use Wikibase\DataModel\Entity\EntityId; +use Wikibase\DataModel\Entity\Property; use Wikibase\DataModel\Entity\PropertyId; +use Wikibase\EntityContent; +use Wikibase\EntityPerPage; use Wikibase\Lib\Store\EntityContentDataCodec; +use Wikibase\PropertyContent; +use Wikibase\PropertyInfoStore; +use Wikibase\TermIndex; use Wikibase\Updates\DataUpdateAdapter; use Wikibase\Validators\EntityValidator; use Wikibase\Validators\ValidatorErrorLocalizer; diff --git a/extensions/Wikibase/repo/includes/specials/SpecialItemByTitle.php b/extensions/Wikibase/repo/includes/specials/SpecialItemByTitle.php index b2a9815..dde8748 100644 --- a/extensions/Wikibase/repo/includes/specials/SpecialItemByTitle.php +++ b/extensions/Wikibase/repo/includes/specials/SpecialItemByTitle.php @@ -5,7 +5,7 @@ use Html; use Site; use SiteStore; -use Wikibase\ItemHandler; +use Wikibase\Repo\Content\ItemHandler; use Wikibase\Repo\WikibaseRepo; use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Lib\Store\SiteLinkLookup; diff --git a/extensions/Wikibase/repo/includes/specials/SpecialSetSiteLink.php b/extensions/Wikibase/repo/includes/specials/SpecialSetSiteLink.php index 3386c01..83deb8f 100644 --- a/extensions/Wikibase/repo/includes/specials/SpecialSetSiteLink.php +++ b/extensions/Wikibase/repo/includes/specials/SpecialSetSiteLink.php @@ -121,7 +121,12 @@ $this->page = $request->getVal( 'page' ); - $this->badges = $request->getArray( 'badges', array() ); + $this->badges = array(); + foreach ( $this->badgeItems as $badgeId => $value ) { + if ( $request->getVal( 'badge-' . $badgeId ) ) { + $this->badges[] = $badgeId; + } + } } /** @@ -240,22 +245,11 @@ . Html::element( 'label', array( - 'for' => 'wb-setsitelink-badges', 'class' => 'wb-label' ), $this->msg( 'wikibase-setsitelink-badges' )->text() ) - . Html::openElement( - 'select', - array( - 'name' => 'badges[]', - 'class' => 'wb-input', - 'id' => 'wb-setsitelink-badges', - 'multiple' => true - ) - ) - . $this->getBadgesOptionsHtml() - . Html::closeElement( 'select' ); + . $this->getHtmlForBadges(); } $site = $this->siteStore->getSite( $this->site ); @@ -311,23 +305,36 @@ } /** - * Returns the HTML containing an option tag for each badge. + * Returns the HTML containing a checkbox for each badge. * * @return string */ - private function getBadgesOptionsHtml() { + private function getHtmlForBadges() { $options = ''; foreach ( $this->badgeItems as $badgeId => $value ) { - $attrs = array( 'value' => $badgeId ); - if ( in_array( $badgeId, $this->badges ) ) { - $attrs['selected'] = true; - } + $name = 'badge-' . $badgeId; + $title = $this->getTitleForBadge( new ItemId( $badgeId ) ); - $options .= Html::element( - 'option', - $attrs, - $this->getTitleForBadge( new ItemId( $badgeId ) ) + $options .= Html::rawElement( + 'div', + array( + 'class' => 'wb-label' + ), + Html::check( + $name, + in_array( $badgeId, $this->badges ), + array( + 'id' => $name + ) + ) + . Html::element( + 'label', + array( + 'for' => $name + ), + $title + ) ); } diff --git a/extensions/Wikibase/repo/tests/phpunit/includes/WikibaseRepoTest.php b/extensions/Wikibase/repo/tests/phpunit/includes/WikibaseRepoTest.php index f61d38b..b59aaae 100644 --- a/extensions/Wikibase/repo/tests/phpunit/includes/WikibaseRepoTest.php +++ b/extensions/Wikibase/repo/tests/phpunit/includes/WikibaseRepoTest.php @@ -162,13 +162,13 @@ public function testNewItemHandler() { $repo = $this->getDefaultInstance(); $handler = $repo->newItemHandler(); - $this->assertInstanceOf( 'Wikibase\EntityHandler', $handler ); + $this->assertInstanceOf( 'Wikibase\Repo\Content\EntityHandler', $handler ); } public function testNewPropertyHandler() { $repo = $this->getDefaultInstance(); $handler = $repo->newPropertyHandler(); - $this->assertInstanceOf( 'Wikibase\EntityHandler', $handler ); + $this->assertInstanceOf( 'Wikibase\Repo\Content\EntityHandler', $handler ); } public function testNewItemHandler_noTransform() { diff --git a/extensions/Wikibase/repo/tests/phpunit/includes/content/EntityHandlerTest.php b/extensions/Wikibase/repo/tests/phpunit/includes/content/EntityHandlerTest.php index cd1cfd3..8de8e3d 100644 --- a/extensions/Wikibase/repo/tests/phpunit/includes/content/EntityHandlerTest.php +++ b/extensions/Wikibase/repo/tests/phpunit/includes/content/EntityHandlerTest.php @@ -11,15 +11,15 @@ use Wikibase\DataModel\Entity\Entity; use Wikibase\DataModel\Entity\EntityId; use Wikibase\EntityContent; -use Wikibase\EntityHandler; use Wikibase\InternalSerialization\SerializerFactory; use Wikibase\Lib\Serializers\LegacyInternalEntitySerializer; use Wikibase\Lib\Store\EntityRedirect; +use Wikibase\Repo\Content\EntityHandler; use Wikibase\Repo\WikibaseRepo; use Wikibase\SettingsArray; /** - * @covers Wikibase\EntityHandler + * @covers Wikibase\Repo\Content\EntityHandler * * @group Wikibase * @group WikibaseEntity diff --git a/extensions/Wikibase/repo/tests/phpunit/includes/content/ItemHandlerTest.php b/extensions/Wikibase/repo/tests/phpunit/includes/content/ItemHandlerTest.php index 590850e..1461d8e 100644 --- a/extensions/Wikibase/repo/tests/phpunit/includes/content/ItemHandlerTest.php +++ b/extensions/Wikibase/repo/tests/phpunit/includes/content/ItemHandlerTest.php @@ -9,12 +9,12 @@ use Wikibase\DataModel\SiteLink; use Wikibase\EntityContent; use Wikibase\ItemContent; -use Wikibase\ItemHandler; use Wikibase\Lib\Store\EntityRedirect; +use Wikibase\Repo\Content\ItemHandler; use Wikibase\SettingsArray; /** - * @covers Wikibase\ItemHandler + * @covers Wikibase\Repo\Content\ItemHandler * * @group Wikibase * @group WikibaseRepo @@ -41,7 +41,7 @@ * @return string */ public function getClassName() { - return '\Wikibase\ItemHandler'; + return '\Wikibase\Repo\Content\ItemHandler'; } /** diff --git a/extensions/Wikibase/repo/tests/phpunit/includes/content/PropertyHandlerTest.php b/extensions/Wikibase/repo/tests/phpunit/includes/content/PropertyHandlerTest.php index 2b83499..1baa133 100644 --- a/extensions/Wikibase/repo/tests/phpunit/includes/content/PropertyHandlerTest.php +++ b/extensions/Wikibase/repo/tests/phpunit/includes/content/PropertyHandlerTest.php @@ -6,14 +6,12 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\Property; use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\Lib\Store\EntityContentDataCodec; use Wikibase\PropertyContent; -use Wikibase\PropertyHandler; -use Wikibase\Repo\WikibaseRepo; +use Wikibase\Repo\Content\PropertyHandler; use Wikibase\SettingsArray; /** - * @covers Wikibase\PropertyHandler + * @covers Wikibase\Repo\Content\PropertyHandler * * @group Wikibase * @group WikibaseRepo @@ -39,7 +37,7 @@ * @return string */ public function getClassName() { - return '\Wikibase\PropertyHandler'; + return '\Wikibase\Repo\Content\PropertyHandler'; } /** diff --git a/extensions/Wikibase/repo/tests/phpunit/includes/specials/SpecialSetSitelinkTest.php b/extensions/Wikibase/repo/tests/phpunit/includes/specials/SpecialSetSitelinkTest.php index 6b69f1a..54ebc88 100644 --- a/extensions/Wikibase/repo/tests/phpunit/includes/specials/SpecialSetSitelinkTest.php +++ b/extensions/Wikibase/repo/tests/phpunit/includes/specials/SpecialSetSitelinkTest.php @@ -126,25 +126,22 @@ } private function addBadgeMatcher() { - $badgeMatcher = array( - 'tag' => 'option', - 'content' => 'Good article', + $name = 'badge-' . self::$badgeId; + self::$matchers['badgeinput'] = array( + 'tag' => 'input', 'attributes' => array( - 'value' => self::$badgeId + 'name' => $name, + 'id' => $name, + 'type' => 'checkbox' ) ); - self::$matchers['badges'] = array( - 'tag' => 'select', + self::$matchers['badgelabel'] = array( + 'tag' => 'label', 'attributes' => array( - 'id' => 'wb-setsitelink-badges', - 'class' => 'wb-input', - 'name' => 'badges[]', - 'multiple' => '' + 'for' => $name ), - 'children' => array( - 'count' => 1, - 'only' => $badgeMatcher - ) ); + 'content' => 'Good article' + ); } public function testExecuteEmptyForm() { diff --git a/src/SettingsFileGenerator.php b/src/SettingsFileGenerator.php deleted file mode 100644 index 50d3519..0000000 --- a/src/SettingsFileGenerator.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -namespace Wikidata; - -/** - * @license GNU GPL v2+ - * - * @author Katie Filbert < aude.w...@gmail.com > - */ -class SettingsFileGenerator { - - public static function generateDefaultSettings() { - $settingsBuilder = new WikidataSettingsBuilder(); - $settingsFileGenerator = new self(); - - $settingsFileGenerator->generate( - $settingsBuilder->getRepoSettings(), - 'wgWBRepoSettings', - __DIR__ . '/../WikibaseRepo.settings.php' - ); - - $settingsFileGenerator->generate( - $settingsBuilder->getClientSettings(), - 'wgWBClientSettings', - __DIR__ . '/../WikibaseClient.settings.php' - ); - } - - /** - * @param string $settingsVariable e.g. wgWBRepoSettings or wgWBClientSettings - * @param string $filename - * @param array $settings - * - * @throws \RuntimeException - */ - public function generate( array $settings, $settingsVariable, $filename ) { - $settingsArray = array(); - - foreach( $settings as $setting => $value ) { - $settingsArray[] = '$' . $settingsVariable . '["' . $setting . '"] = "' . $value . '";'; - } - - $fileContents = "<?php\n"; - $fileContents .= implode( "\n", $settingsArray ); - - if ( !file_put_contents( $filename, $fileContents ) ) { - throw new \RuntimeException( "Failed to generate file: $filename" ); - } - } - -} diff --git a/src/WikidataHooks.php b/src/WikidataHooks.php deleted file mode 100644 index ea487a6..0000000 --- a/src/WikidataHooks.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Wikidata; - -/** - * @license GNU GPL v2+ - * - * @author Katie Filbert < aude.w...@gmail.com > - */ -final class WikidataHooks { - - /** - * @param array &$files - * - * @return boolean - */ - public static function onUnitTestsList( array &$files ) { - // @codeCoverageIgnoreStart - $directoryIterator = new \RecursiveDirectoryIterator( __DIR__ . '/../tests/' ); - - /* @var SplFileInfo $fileInfo */ - foreach ( new \RecursiveIteratorIterator( $directoryIterator ) as $fileInfo ) { - if ( substr( $fileInfo->getFilename(), -8 ) === 'Test.php' ) { - $files[] = $fileInfo->getPathname(); - } - } - - return true; - // @codeCoverageIgnoreEnd - } - -} diff --git a/src/WikidataSettingsBuilder.php b/src/WikidataSettingsBuilder.php deleted file mode 100644 index 29fbe9f..0000000 --- a/src/WikidataSettingsBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -namespace Wikidata; - -/** - * Dynamically generates settings for Wikidata - * - * @license GNU GPL v2+ - * - * @author Katie Filbert < aude.w...@gmail.com > - */ -class WikidataSettingsBuilder { - - private $commonSettings; - - /** - * @return array - */ - public function getRepoSettings() { - return $this->getCommonSettings(); - } - - /** - * @return array - */ - public function getClientSettings() { - return $this->getCommonSettings(); - } - - private function getCommonSettings() { - if ( !isset( $this->commonSettings ) ) { - $this->buildCommonSettings(); - } - - return $this->commonSettings; - } - - private function buildCommonSettings() { - $this->addSharedCacheKeyPrefix(); - } - - private function addSharedCacheKeyPrefix() { - $this->commonSettings['sharedCacheKeyPrefix'] = 'wikibase:WBL/' . time(); - } - -} diff --git a/tests/SettingsFileGeneratorTest.php b/tests/SettingsFileGeneratorTest.php deleted file mode 100644 index 9ba5e8a..0000000 --- a/tests/SettingsFileGeneratorTest.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -namespace Wikidata\Tests; - -use Wikidata\SettingsFileGenerator; - -/** - * @covers Wikidata\SettingsFileGenerator - * @group Wikidata - * - * @license GNU GPL v2+ - * - * @author Katie Filbert < aude.w...@gmail.com > - */ -class SettingsFileGeneratorTest extends \PHPUnit_Framework_TestCase { - - public function testGenerate() { - $settings = array( - 'beverage' => 'beer', - 'food' => 'chocolate' - ); - - $filename = tempnam( sys_get_temp_dir(), 'WikidataSettings.php' ); - - $settingsFileGenerator = new SettingsFileGenerator(); - $settingsFileGenerator->generate( $settings, 'wgWikidataSettings', $filename ); - - include( $filename ); - - $this->assertEquals( $settings, $wgWikidataSettings ); - - unlink( $filename ); - } - - public function testGenerateDefaultSettings() { - global $wgWBClientSettings, $wgWBRepoSettings; - - include __DIR__ . '/../WikibaseClient.settings.php'; - include __DIR__ . '/../WikibaseRepo.settings.php'; - - $this->assertRegExp( '/wikibase:WBL\/\d+/', $wgWBClientSettings['sharedCacheKeyPrefix'] ); - $this->assertRegExp( '/wikibase:WBL\/\d+/', $wgWBRepoSettings['sharedCacheKeyPrefix'] ); - - $this->assertEquals( - $wgWBClientSettings['sharedCacheKeyPrefix'], - $wgWBRepoSettings['sharedCacheKeyPrefix'] - ); - } - -} diff --git a/tests/WikidataSettingsBuilderTest.php b/tests/WikidataSettingsBuilderTest.php deleted file mode 100644 index 449b33b..0000000 --- a/tests/WikidataSettingsBuilderTest.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -namespace Wikidata\Tests; - -use Wikidata\WikidataSettingsBuilder; - -/** - * @covers Wikidata\WikidataSettingsBuilder - * @group Wikidata - * - * @license GNU GPL v2+ - * - * @author Katie Filbert < aude.w...@gmail.com > - */ -class WikidataSettingsBuilderTest extends \PHPUnit_Framework_TestCase { - - public function testGetRepoSettings() { - $settingsBuilder = new WikidataSettingsBuilder(); - $settings = $settingsBuilder->getRepoSettings(); - - $this->assertRegExp( '/wikibase:WBL\/\d+/', $settings['sharedCacheKeyPrefix'] ); - } - - public function testGetClientSettings() { - $settingsBuilder = new WikidataSettingsBuilder(); - $settings = $settingsBuilder->getClientSettings(); - - $this->assertRegExp( '/wikibase:WBL\/\d+/', $settings['sharedCacheKeyPrefix'] ); - } - -} diff --git a/vendor/autoload.php b/vendor/autoload.php index fc3ffeb..7160976 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit37e7c9e1ce941e6cacd912ee075bd662::getLoader(); +return ComposerAutoloaderInit79dba924dc5abbbb8f3bb83521ca8265::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 4433649..88684c5 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -143,8 +143,6 @@ * @param string $prefix The prefix/namespace, with trailing '\\' * @param array|string $paths The PSR-0 base directories * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -206,8 +204,6 @@ * * @param string $prefix The prefix/namespace, with trailing '\\' * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException */ public function setPsr4($prefix, $paths) { diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 3d97e5f..8c8fc8b 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -313,6 +313,7 @@ 'Wikibase\\Client\\Hooks\\SpecialWatchlistQueryHandler' => $baseDir . '/extensions/Wikibase/client/includes/hooks/SpecialWatchlistQueryHandler.php', 'Wikibase\\Client\\MovePageNotice' => $baseDir . '/extensions/Wikibase/client/includes/hooks/MovePageNotice.php', 'Wikibase\\Client\\OtherProjectsSitesProvider' => $baseDir . '/extensions/Wikibase/client/includes/OtherProjectsSitesProvider.php', + 'Wikibase\\Client\\RepoLinker' => $baseDir . '/extensions/Wikibase/client/includes/RepoLinker.php', 'Wikibase\\Client\\Scribunto\\Test\\Scribunto_LuaWikibaseLibraryTestCase' => $baseDir . '/extensions/Wikibase/client/tests/phpunit/includes/scribunto/Scribunto_LuaWikibaseLibraryTestCase.php', 'Wikibase\\Client\\Scribunto\\Test\\WikibaseLuaIntegrationTestItemSetUpHelper' => $baseDir . '/extensions/Wikibase/client/tests/phpunit/includes/scribunto/WikibaseLuaIntegrationTestItemSetUpHelper.php', 'Wikibase\\Client\\Scribunto\\WikibaseLuaBindings' => $baseDir . '/extensions/Wikibase/client/includes/scribunto/WikibaseLuaBindings.php', @@ -428,7 +429,6 @@ 'Wikibase\\EntityContentDiffView' => $baseDir . '/extensions/Wikibase/repo/includes/EntityContentDiffView.php', 'Wikibase\\EntityDiffVisualizer' => $baseDir . '/extensions/Wikibase/repo/includes/EntityDiffVisualizer.php', 'Wikibase\\EntityFactory' => $baseDir . '/extensions/Wikibase/lib/includes/EntityFactory.php', - 'Wikibase\\EntityHandler' => $baseDir . '/extensions/Wikibase/repo/includes/content/EntityHandler.php', 'Wikibase\\EntityIdPager' => $baseDir . '/extensions/Wikibase/repo/includes/store/EntityIdPager.php', 'Wikibase\\EntityPerPage' => $baseDir . '/extensions/Wikibase/repo/includes/store/EntityPerPage.php', 'Wikibase\\EntityPerPageBuilder' => $baseDir . '/extensions/Wikibase/repo/includes/store/sql/EntityPerPageBuilder.php', @@ -472,7 +472,6 @@ 'Wikibase\\ItemChange' => $baseDir . '/extensions/Wikibase/lib/includes/changes/ItemChange.php', 'Wikibase\\ItemContent' => $baseDir . '/extensions/Wikibase/repo/includes/content/ItemContent.php', 'Wikibase\\ItemDisambiguation' => $baseDir . '/extensions/Wikibase/repo/includes/ItemDisambiguation.php', - 'Wikibase\\ItemHandler' => $baseDir . '/extensions/Wikibase/repo/includes/content/ItemHandler.php', 'Wikibase\\ItemUsageIndex' => $baseDir . '/extensions/Wikibase/lib/includes/store/ItemUsageIndex.php', 'Wikibase\\ItemView' => $baseDir . '/extensions/Wikibase/repo/includes/ItemView.php', 'Wikibase\\ItemsPerSiteBuilder' => $baseDir . '/extensions/Wikibase/repo/includes/store/sql/ItemsPerSiteBuilder.php', @@ -640,7 +639,6 @@ 'Wikibase\\Parsers\\MonolingualTextParser' => $baseDir . '/extensions/Wikibase/lib/includes/parsers/MonolingualTextParser.php', 'Wikibase\\Parsers\\Test\\MonolingualTextParserTest' => $baseDir . '/extensions/Wikibase/lib/tests/phpunit/parsers/MonolingualTextParserTest.php', 'Wikibase\\PropertyContent' => $baseDir . '/extensions/Wikibase/repo/includes/content/PropertyContent.php', - 'Wikibase\\PropertyHandler' => $baseDir . '/extensions/Wikibase/repo/includes/content/PropertyHandler.php', 'Wikibase\\PropertyInfoStore' => $baseDir . '/extensions/Wikibase/lib/includes/store/PropertyInfoStore.php', 'Wikibase\\PropertyInfoTable' => $baseDir . '/extensions/Wikibase/lib/includes/store/sql/PropertyInfoTable.php', 'Wikibase\\PropertyInfoTableBuilder' => $baseDir . '/extensions/Wikibase/repo/includes/store/sql/PropertyInfoTableBuilder.php', @@ -659,9 +657,11 @@ 'Wikibase\\RepoAccessModule' => $baseDir . '/extensions/Wikibase/lib/includes/modules/RepoAccessModule.php', 'Wikibase\\RepoHooks' => $baseDir . '/extensions/Wikibase/repo/Wikibase.hooks.php', 'Wikibase\\RepoItemLinkGenerator' => $baseDir . '/extensions/Wikibase/client/includes/RepoItemLinkGenerator.php', - 'Wikibase\\RepoLinker' => $baseDir . '/extensions/Wikibase/client/includes/RepoLinker.php', 'Wikibase\\Repo\\Content\\EntityContentDiff' => $baseDir . '/extensions/Wikibase/repo/includes/content/EntityContentDiff.php', 'Wikibase\\Repo\\Content\\EntityContentFactory' => $baseDir . '/extensions/Wikibase/repo/includes/content/EntityContentFactory.php', + 'Wikibase\\Repo\\Content\\EntityHandler' => $baseDir . '/extensions/Wikibase/repo/includes/content/EntityHandler.php', + 'Wikibase\\Repo\\Content\\ItemHandler' => $baseDir . '/extensions/Wikibase/repo/includes/content/ItemHandler.php', + 'Wikibase\\Repo\\Content\\PropertyHandler' => $baseDir . '/extensions/Wikibase/repo/includes/content/PropertyHandler.php', 'Wikibase\\Repo\\EntitySearchTextGenerator' => $baseDir . '/extensions/Wikibase/repo/includes/EntitySearchTextGenerator.php', 'Wikibase\\Repo\\GenericEventDispatcher' => $baseDir . '/extensions/Wikibase/repo/includes/GenericEventDispatcher.php', 'Wikibase\\Repo\\Interactors\\ItemMergeException' => $baseDir . '/extensions/Wikibase/repo/includes/Interactors/ItemMergeException.php', @@ -1053,9 +1053,6 @@ 'Wikibase\\WikibaseDiffOpFactory' => $baseDir . '/extensions/Wikibase/lib/includes/WikibaseDiffOpFactory.php', 'Wikibase\\util\\Test\\GenericEventDispatcherTest' => $baseDir . '/extensions/Wikibase/repo/tests/phpunit/includes/GenericEventDispatcherTest.php', 'WikidataOrg\\Hooks' => $baseDir . '/extensions/Wikidata.org/WikidataOrg.hooks.php', - 'Wikidata\\SettingsFileGenerator' => $baseDir . '/src/SettingsFileGenerator.php', - 'Wikidata\\WikidataHooks' => $baseDir . '/src/WikidataHooks.php', - 'Wikidata\\WikidataSettingsBuilder' => $baseDir . '/src/WikidataSettingsBuilder.php', 'WikimediaBadges\\Hooks' => $baseDir . '/extensions/WikimediaBadges/WikimediaBadges.hooks.php', 'importInterlang' => $baseDir . '/extensions/Wikibase/repo/maintenance/importInterlang.php', 'importProperties' => $baseDir . '/extensions/Wikibase/repo/maintenance/importProperties.php', diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 2f4f533..2034ba0 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,7 +6,6 @@ $baseDir = dirname($vendorDir); return array( - 'Wikidata\\' => array($baseDir . '/src'), 'Wikibase\\Repo\\View\\' => array($baseDir . '/extensions/Wikibase/repo/includes/View'), 'Wikibase\\InternalSerialization\\' => array($vendorDir . '/wikibase/internal-serialization/src'), 'Wikibase\\DataModel\\' => array($vendorDir . '/wikibase/data-model/src', $vendorDir . '/wikibase/data-model-serialization/src'), diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index f211f14..5aacb77 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit37e7c9e1ce941e6cacd912ee075bd662 +class ComposerAutoloaderInit79dba924dc5abbbb8f3bb83521ca8265 { private static $loader; @@ -19,9 +19,9 @@ return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit37e7c9e1ce941e6cacd912ee075bd662', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit79dba924dc5abbbb8f3bb83521ca8265', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit37e7c9e1ce941e6cacd912ee075bd662', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit79dba924dc5abbbb8f3bb83521ca8265', 'loadClassLoader')); $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -42,14 +42,14 @@ $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $file) { - composerRequire37e7c9e1ce941e6cacd912ee075bd662($file); + composerRequire79dba924dc5abbbb8f3bb83521ca8265($file); } return $loader; } } -function composerRequire37e7c9e1ce941e6cacd912ee075bd662($file) +function composerRequire79dba924dc5abbbb8f3bb83521ca8265($file) { require $file; } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 54c595e..88e4677 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1131,12 +1131,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git", - "reference": "9a5a2e72fea975502082da6ef0c0c073856e3480" + "reference": "691871c26e656ccede48b916630d83dbde9baa1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/9a5a2e72fea975502082da6ef0c0c073856e3480", - "reference": "9a5a2e72fea975502082da6ef0c0c073856e3480", + "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/691871c26e656ccede48b916630d83dbde9baa1f", + "reference": "691871c26e656ccede48b916630d83dbde9baa1f", "shasum": "" }, "require": { @@ -1163,7 +1163,7 @@ "conflict": { "mediawiki/mediawiki": "<1.23" }, - "time": "2014-09-17 20:47:38", + "time": "2014-09-19 20:07:50", "type": "mediawiki-extension", "installation-source": "dist", "autoload": { @@ -1207,6 +1207,55 @@ "wikibaserepo", "wikidata" ] + }, + { + "name": "wikibase/Wikidata.org", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/wmde/Wikidata.org.git", + "reference": "ee3983e06188766df13f847c165b98d449c14e39" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wmde/Wikidata.org/zipball/ee3983e06188766df13f847c165b98d449c14e39", + "reference": "ee3983e06188766df13f847c165b98d449c14e39", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2014-09-18 15:49:27", + "type": "mediawiki-extension", + "installation-source": "dist", + "autoload": { + "classmap": [ + "WikidataOrg.hooks.php" + ] + }, + "license": [ + "GNU GPL v2+" + ], + "authors": [ + { + "name": "Bene*", + "email": "benestar.wikime...@gmail.com", + "homepage": "https://www.wikidata.org/wiki/User:Bene*", + "role": "Developer" + } + ], + "description": "Configuration for and customizations to Wikibase that are specific to wikidata.org", + "homepage": "https://github.com/wmde/Wikidata.org", + "keywords": [ + "Wikibase", + "Wikidata" + ], + "support": { + "irc": "irc://irc.freenode.net/wikidata", + "source": "https://github.com/wmde/Wikidata.org/tree/master", + "issues": "https://github.com/wmde/Wikidata.org/issues" + } }, { "name": "wikibase/wikimedia-badges", @@ -1261,67 +1310,18 @@ } }, { - "name": "wikibase/Wikidata.org", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/wmde/Wikidata.org.git", - "reference": "ee3983e06188766df13f847c165b98d449c14e39" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wmde/Wikidata.org/zipball/ee3983e06188766df13f847c165b98d449c14e39", - "reference": "ee3983e06188766df13f847c165b98d449c14e39", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2014-09-18 15:49:27", - "type": "mediawiki-extension", - "installation-source": "dist", - "autoload": { - "classmap": [ - "WikidataOrg.hooks.php" - ] - }, - "license": [ - "GNU GPL v2+" - ], - "authors": [ - { - "name": "Bene*", - "email": "benestar.wikime...@gmail.com", - "homepage": "https://www.wikidata.org/wiki/User:Bene*", - "role": "Developer" - } - ], - "description": "Configuration for and customizations to Wikibase that are specific to wikidata.org", - "homepage": "https://github.com/wmde/Wikidata.org", - "keywords": [ - "Wikibase", - "Wikidata" - ], - "support": { - "irc": "irc://irc.freenode.net/wikidata", - "source": "https://github.com/wmde/Wikidata.org/tree/master", - "issues": "https://github.com/wmde/Wikidata.org/issues" - } - }, - { "name": "propertysuggester/property-suggester", - "version": "1.1.2", - "version_normalized": "1.1.2.0", + "version": "1.2", + "version_normalized": "1.2.0.0", "source": { "type": "git", "url": "https://github.com/Wikidata-lib/PropertySuggester.git", - "reference": "3a2d2d54f5597c998230759eece5c70ab1835b28" + "reference": "722bc634e78eedad71f4bc2a2d5fbad217fb2258" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Wikidata-lib/PropertySuggester/zipball/3a2d2d54f5597c998230759eece5c70ab1835b28", - "reference": "3a2d2d54f5597c998230759eece5c70ab1835b28", + "url": "https://api.github.com/repos/Wikidata-lib/PropertySuggester/zipball/722bc634e78eedad71f4bc2a2d5fbad217fb2258", + "reference": "722bc634e78eedad71f4bc2a2d5fbad217fb2258", "shasum": "" }, "require": { @@ -1331,7 +1331,7 @@ "phpunit/phpunit": "3.7.*", "satooshi/php-coveralls": "dev-master" }, - "time": "2014-09-05 10:14:36", + "time": "2014-09-12 12:05:41", "type": "mediawiki-extension", "installation-source": "dist", "autoload": { diff --git a/vendor/wikibase/easyrdf_lite/CHANGELOG.md b/vendor/wikibase/easyrdf_lite/CHANGELOG.md old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf.php b/vendor/wikibase/easyrdf_lite/EasyRdf.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Exception.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Exception.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Format.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Format.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Graph.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Graph.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Literal.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Literal.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Literal/Boolean.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Literal/Boolean.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Literal/Date.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Literal/Date.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Literal/DateTime.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Literal/DateTime.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Literal/Decimal.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Literal/Decimal.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Literal/HexBinary.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Literal/HexBinary.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Literal/Integer.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Literal/Integer.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Namespace.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Namespace.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Resource.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Resource.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Arc.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Arc.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/GraphViz.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/GraphViz.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Json.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Json.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Ntriples.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Ntriples.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Rapper.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Rapper.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/RdfPhp.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/RdfPhp.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/RdfXml.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/RdfXml.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Turtle.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Serialiser/Turtle.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/TypeMapper.php b/vendor/wikibase/easyrdf_lite/EasyRdf/TypeMapper.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/EasyRdf/Utils.php b/vendor/wikibase/easyrdf_lite/EasyRdf/Utils.php old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/LICENSE.md b/vendor/wikibase/easyrdf_lite/LICENSE.md old mode 100755 new mode 100644 diff --git a/vendor/wikibase/easyrdf_lite/README.md b/vendor/wikibase/easyrdf_lite/README.md old mode 100755 new mode 100644 -- To view, visit https://gerrit.wikimedia.org/r/161651 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3569b7858c008bd2b06db8b644f478614b9aeabd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikidata Gerrit-Branch: master Gerrit-Owner: WikidataBuilder <wikidata-servi...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits