Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Moved DBConnectionProvider to Database component
......................................................................

Moved DBConnectionProvider to Database component

This is blocking independence of other components and is thus high prio.
Namespace should be fixed in a follow up refactor.

Change-Id: I43d3fabce4b25fb89b683c30edc4a873fcebdce4
---
M Database/Database.classes.php
R Database/Database/DBConnectionProvider.php
R Database/Database/LazyDBConnectionProvider.php
M repo/Wikibase.classes.php
M repo/Wikibase.php
M repo/config/Wikibase.experimental.php
6 files changed, 10 insertions(+), 11 deletions(-)


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

diff --git a/Database/Database.classes.php b/Database/Database.classes.php
index 7fa6382..376c726 100644
--- a/Database/Database.classes.php
+++ b/Database/Database.classes.php
@@ -47,6 +47,9 @@
                $paths[$class] = $path;
        }
 
+       $paths['Wikibase\Repo\DBConnectionProvider'] = 
'Database/DBConnectionProvider.php';
+       $paths['Wikibase\Repo\LazyDBConnectionProvider'] = 
'Database/LazyDBConnectionProvider.php';
+
        return $paths;
 
 } );
diff --git a/repo/includes/DBConnectionProvider.php 
b/Database/Database/DBConnectionProvider.php
similarity index 97%
rename from repo/includes/DBConnectionProvider.php
rename to Database/Database/DBConnectionProvider.php
index a9efdc7..6564dee 100644
--- a/repo/includes/DBConnectionProvider.php
+++ b/Database/Database/DBConnectionProvider.php
@@ -1,13 +1,12 @@
 <?php
 
+// TODO: fix NS
 namespace Wikibase\Repo;
 
 use DatabaseBase;
 
 /**
  * Interface for database connection providers.
- *
- * TODO: move to lib
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/repo/includes/LazyDBConnectionProvider.php 
b/Database/Database/LazyDBConnectionProvider.php
similarity index 98%
rename from repo/includes/LazyDBConnectionProvider.php
rename to Database/Database/LazyDBConnectionProvider.php
index a437774..02cf77d 100644
--- a/repo/includes/LazyDBConnectionProvider.php
+++ b/Database/Database/LazyDBConnectionProvider.php
@@ -1,5 +1,6 @@
 <?php
 
+// TODO: fix NS
 namespace Wikibase\Repo;
 
 use DatabaseBase;
@@ -7,8 +8,6 @@
 /**
  * Lazy database connection provider.
  * The connection is fetched when needed using the id provided in the 
constructor.
- *
- * TODO: move to lib
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/repo/Wikibase.classes.php b/repo/Wikibase.classes.php
index 33fa371..5b6fb22 100644
--- a/repo/Wikibase.classes.php
+++ b/repo/Wikibase.classes.php
@@ -36,7 +36,6 @@
                'Wikibase\ClaimSaver' => 'includes/ClaimSaver.php',
                'Wikibase\ClaimSummaryBuilder' => 
'includes/ClaimSummaryBuilder.php',
                'Wikibase\DataTypeSelector' => 'includes/DataTypeSelector.php',
-               'Wikibase\Repo\DBConnectionProvider' => 
'includes/DBConnectionProvider.php',
                'Wikibase\EditEntity' => 'includes/EditEntity.php',
                'Wikibase\EntityContentDiffView' => 
'includes/EntityContentDiffView.php',
                'Wikibase\ItemContentDiffView' => 
'includes/ItemContentDiffView.php',
@@ -45,7 +44,6 @@
                'Wikibase\ExceptionWithCode' => 
'includes/ExceptionWithCode.php',
                'Wikibase\ItemView' => 'includes/ItemView.php',
                'Wikibase\LabelDescriptionDuplicateDetector' => 
'includes/LabelDescriptionDuplicateDetector.php',
-               'Wikibase\Repo\LazyDBConnectionProvider' => 
'includes/LazyDBConnectionProvider.php',
                'Wikibase\MultiLangConstraintDetector' => 
'includes/MultiLangConstraintDetector.php',
                'Wikibase\NamespaceUtils' => 'includes/NamespaceUtils.php',
                'Wikibase\PropertyView' => 'includes/PropertyView.php',
diff --git a/repo/Wikibase.php b/repo/Wikibase.php
index 1a6e586..a2555d8 100755
--- a/repo/Wikibase.php
+++ b/repo/Wikibase.php
@@ -38,6 +38,11 @@
        die( '<b>Error:</b> Wikibase requires MediaWiki 1.20 or above.' );
 }
 
+// Include the Database component if that hasn't been done yet.
+if ( !defined( 'WIKIBASE_DATABASE_VERSION' ) ) {
+       @include_once( __DIR__ . '/../Database/Database.php' );
+}
+
 // Include the WikibaseLib extension if that hasn't been done yet, since it's 
required for Wikibase to work.
 if ( !defined( 'WBL_VERSION' ) ) {
        @include_once( __DIR__ . '/../lib/WikibaseLib.php' );
diff --git a/repo/config/Wikibase.experimental.php 
b/repo/config/Wikibase.experimental.php
index 462f823..ef1f13d 100644
--- a/repo/config/Wikibase.experimental.php
+++ b/repo/config/Wikibase.experimental.php
@@ -33,11 +33,6 @@
        die( 'Not an entry point.' );
 }
 
-// Include the Database component if that hasn't been done yet.
-if ( !defined( 'WIKIBASE_DATABASE_VERSION' ) && defined( 
'WB_EXPERIMENTAL_FEATURES' ) ) {
-       @include_once( __DIR__ . '/../../Database/Database.php' );
-}
-
 // Include the Query component if that hasn't been done yet.
 if ( !defined( 'WIKIBASE_QUERY_VERSION' ) && defined( 
'WB_EXPERIMENTAL_FEATURES' ) ) {
        @include_once( __DIR__ . '/../../QueryEngine/QueryEngine.php' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43d3fabce4b25fb89b683c30edc4a873fcebdce4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>

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

Reply via email to