Aude has uploaded a new change for review.

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


Change subject: use same switch variable names as already used in production
......................................................................

use same switch variable names as already used in production

and this simplifies loading the dependencies.

Change-Id: Ica8fefb213f04c4077ba1b0539c7f04ac9664346
---
M Wikidata.php
1 file changed, 14 insertions(+), 12 deletions(-)


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

diff --git a/Wikidata.php b/Wikidata.php
index 2317ba4..aaa5278 100644
--- a/Wikidata.php
+++ b/Wikidata.php
@@ -10,30 +10,32 @@
        if ( !defined( 'WB_EXPERIMENTAL_FEATURES' ) || 
!WB_EXPERIMENTAL_FEATURES ) {
                define( 'WB_EXPERIMENTAL_FEATURES', true );
        }
-       $wgEnableWikibaseRepo = true;
-       $wgEnableWikibaseClient = true;
+       $wmgUseWikibaseRepo = true;
+       $wmgUseWikibaseClient = true;
 }
 
-$wikidataToLoad = array(
+$wikidataDependencies = array(
        'Diff_VERSION' => '/Diff/Diff.php',
        'DataValues_VERSION' => '/DataValues/DataValues.php',
        'DataTypes_VERSION' => '/DataTypes/DataTypes.php',
        'WIKIBASE_DATAMODEL_VERSION' => 
'/WikibaseDataModel/WikibaseDataModel.php',
-       'WBL_VERSION' => '/Wikibase/lib/WikibaseLib.php',
-       'WB_VERSION' => '/Wikibase/repo/Wikibase.php',
-       'WBC_VERSION' => '/Wikibase/client/WikibaseClient.php',
+       'WBL_VERSION' => '/Wikibase/lib/WikibaseLib.php'
 );
 
 //Load our entry files ( if we want them )
-foreach( $wikidataToLoad as $constant => $location ) {
-       if ( !defined( $constant ) ) {
-               if( ( $constant === 'WB_VERSION' && ( !isset( 
$wgEnableWikibaseRepo ) || !$wgEnableWikibaseRepo ) ) ||
-                       ( $constant === 'WBC_VERSION' && ( !isset( 
$wgEnableWikibaseClient ) || !$wgEnableWikibaseClient ) )
-               ) { continue; }
+if ( $wmgUseWikibaseRepo || $wmgUseWikibaseClient ) {
+       foreach( $wikidataDependencies as $constant => $location ) {
                include_once( __DIR__ . $location );
        }
 }
-unset( $wikidataToLoad );
+
+if ( $wmgUseWikibaseRepo ) {
+       include_once( __DIR__ . '/Wikibase/repo/Wikibase.php' );
+}
+
+if ( $wmgUseWikibaseClient ) {
+       include_once( __DIR__ . '/Wikibase/client/WikibaseClient.php' );
+}
 
 //Jenkins stuff part2
 if( PHP_SAPI === 'cli' && getenv( 'JOB_NAME' ) === 
'mwext-Wikidata-testextensions-master') {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica8fefb213f04c4077ba1b0539c7f04ac9664346
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikidata
Gerrit-Branch: master
Gerrit-Owner: Aude <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to