Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Cleanup client example settings
......................................................................

Cleanup client example settings

* Config now in config directory as done in repo
* Example settings no longer include client and lib entrypoint

Change-Id: I9f3670f16fb32019463a5c5b8cdc4d2ee147d848
---
M client/ExampleSettings.php
A client/config/WikibaseClient.example.php
2 files changed, 121 insertions(+), 91 deletions(-)


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

diff --git a/client/ExampleSettings.php b/client/ExampleSettings.php
index fe2b338..dd9aa91 100644
--- a/client/ExampleSettings.php
+++ b/client/ExampleSettings.php
@@ -1,94 +1,5 @@
 <?php
 
-/**
- * Example configuration for the WikibaseClient extension.
- *
- * @author Daniel Kinzler
- */
+define( 'WB_CLIENT_EXAMPLE_ENTRY', 1 );
 
-require_once( "$IP/extensions/Wikibase/lib/WikibaseLib.php");
-require_once( "$IP/extensions/Wikibase/client/WikibaseClient.php");
-
-// Base URL for building links to the repository.
-// Assumes your wiki is setup as "http://repo.example.org/wiki/";
-// This can be protocol relative, such as "//wikidata.org"
-$wgWBSettings['repoUrl'] = "http://repo.example.org";;
-
-// This setting is optional if you have the same type of setup for your
-// repo and client.  It will default to using the client's $wgArticlePath 
setting,
-// and if you do not have $wgArticlePath set anywhere, MediaWiki has a default 
for it.
-$wgWBSettings['repoArticlePath'] = "/wiki/$1";
-
-// Assuming your wiki is setup with such script path as 
"http://repo.example.org/w/api.php";
-// This should be the same as the $wgScriptPath setting if you have it set in 
your repo
-// If $wgScriptPath is not set, then MediaWiki assumes a default.
-//
-// If your client and repo are setup in the same way, then the below setting 
is optional
-// and will default to what you have $wgScriptPath set in the client.
-$wgWBSettings['repoScriptPath'] = "/w";
-
-// The global site ID by which this wiki is known on the repo.
-$wgWBSettings['siteGlobalID'] = "mywiki";
-
-// Database name of the repository, for use by the pollForChanges script.
-// This requires the given database name to be known to LBFactory, see
-// $wgLBFactoryConf below.
-$wgWBSettings['changesDatabase'] = "repo";
-
-$wgWBSettings['injectRecentChanges'] = true;
-$wgWBSettings['showExternalRecentChanges'] = true;
-
-$wgLBFactoryConf = array(
-       // In order to seamlessly access a remote wiki, as the pollForChanges 
script needs to do,
-       // LBFactory_Multi must be used.
-       'class' => 'LBFactory_Multi',
-
-       // Connect to all databases using the same credentials.
-       'serverTemplate' => array(
-               'dbname'      => $wgDBname,
-               'user'        => $wgDBuser,
-               'password'    => $wgDBpassword,
-               'type'        => 'mysql',
-               'flags'       => DBO_DEFAULT | DBO_DEBUG,
-       ),
-
-       // Configure two sections, one for the repo and one for the client.
-       // Each section contains only one server.
-       'sectionLoads' => array(
-               'DEFAULT' => array(
-                       'localhost' => 1,
-               ),
-               'repo' => array(
-                       'local1' => 1,
-               ),
-       ),
-
-       // Map the wiki database names to sections. Database names must be 
unique,
-       // i.e. may not exist in more than one section.
-       'sectionsByDB' => array(
-               $wgDBname => 'DEFAULT',
-               'repowiki' => 'repo',
-       ),
-
-       // Map host names to IP addresses to bypass DNS.
-       //
-       // NOTE: Even if all sections run on the same MySQL server (typical for 
a test setup),
-       // they must use different IP addresses, and MySQL must listen on all 
of them.
-       // The easiest way to do this is to set bind-address = 0.0.0.0 in the 
MySQL
-       // configuration. Beware that this makes MySQL listen on you ethernet 
port too.
-       // Safer alternatives include setting up mysql-proxy or mysqld_multi.
-       //
-       // For this setup to work a valid user must be set up for each of the 
addresses you use,
-       // that is grant access to the wikiuser for each of them. Failure to do 
so will make the
-       // MySQL server refuse access.
-       'hostsByName' => array(
-               'localhost' => '127.0.0.1:3306',
-               'local1' => '127.0.2.1',
-               'local2' => '127.0.2.2',
-               'local3' => '127.0.2.3',
-       ),
-
-       // Set up as fake master, because there are no slaves.
-       'masterTemplateOverrides' => array( 'fakeMaster' => true ),
-);
-
+include_once( __DIR__ . '/config/WikibaseClient.example.php' );
diff --git a/client/config/WikibaseClient.example.php 
b/client/config/WikibaseClient.example.php
new file mode 100644
index 0000000..161fada
--- /dev/null
+++ b/client/config/WikibaseClient.example.php
@@ -0,0 +1,119 @@
+<?php
+
+/**
+ * Example configuration for the Wikibase Client extension.
+ *
+ * This file is NOT an entry point the Wikibase Client extension. Use 
WikibaseClient.php.
+ * It should furthermore not be included from outside the extension.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @since 0.4
+ *
+ * @file
+ * @ingroup WikibaseClient
+ *
+ * @licence GNU GPL v2+
+ * @author Daniel Kinzler
+ */
+
+if ( !defined( 'WB_CLIENT_EXAMPLE_ENTRY' ) ) {
+       die( 'Not an entry point.' );
+}
+
+// Base URL for building links to the repository.
+// Assumes your wiki is setup as "http://repo.example.org/wiki/";
+// This can be protocol relative, such as "//wikidata.org"
+$wgWBSettings['repoUrl'] = "http://repo.example.org";;
+
+// This setting is optional if you have the same type of setup for your
+// repo and client.  It will default to using the client's $wgArticlePath 
setting,
+// and if you do not have $wgArticlePath set anywhere, MediaWiki has a default 
for it.
+$wgWBSettings['repoArticlePath'] = "/wiki/$1";
+
+// Assuming your wiki is setup with such script path as 
"http://repo.example.org/w/api.php";
+// This should be the same as the $wgScriptPath setting if you have it set in 
your repo
+// If $wgScriptPath is not set, then MediaWiki assumes a default.
+//
+// If your client and repo are setup in the same way, then the below setting 
is optional
+// and will default to what you have $wgScriptPath set in the client.
+$wgWBSettings['repoScriptPath'] = "/w";
+
+// The global site ID by which this wiki is known on the repo.
+$wgWBSettings['siteGlobalID'] = "mywiki";
+
+// Database name of the repository, for use by the pollForChanges script.
+// This requires the given database name to be known to LBFactory, see
+// $wgLBFactoryConf below.
+$wgWBSettings['changesDatabase'] = "repo";
+
+$wgWBSettings['injectRecentChanges'] = true;
+$wgWBSettings['showExternalRecentChanges'] = true;
+
+$wgLBFactoryConf = array(
+       // In order to seamlessly access a remote wiki, as the pollForChanges 
script needs to do,
+       // LBFactory_Multi must be used.
+       'class' => 'LBFactory_Multi',
+
+       // Connect to all databases using the same credentials.
+       'serverTemplate' => array(
+               'dbname'      => $wgDBname,
+               'user'        => $wgDBuser,
+               'password'    => $wgDBpassword,
+               'type'        => 'mysql',
+               'flags'       => DBO_DEFAULT | DBO_DEBUG,
+       ),
+
+       // Configure two sections, one for the repo and one for the client.
+       // Each section contains only one server.
+       'sectionLoads' => array(
+               'DEFAULT' => array(
+                       'localhost' => 1,
+               ),
+               'repo' => array(
+                       'local1' => 1,
+               ),
+       ),
+
+       // Map the wiki database names to sections. Database names must be 
unique,
+       // i.e. may not exist in more than one section.
+       'sectionsByDB' => array(
+               $wgDBname => 'DEFAULT',
+               'repowiki' => 'repo',
+       ),
+
+       // Map host names to IP addresses to bypass DNS.
+       //
+       // NOTE: Even if all sections run on the same MySQL server (typical for 
a test setup),
+       // they must use different IP addresses, and MySQL must listen on all 
of them.
+       // The easiest way to do this is to set bind-address = 0.0.0.0 in the 
MySQL
+       // configuration. Beware that this makes MySQL listen on you ethernet 
port too.
+       // Safer alternatives include setting up mysql-proxy or mysqld_multi.
+       //
+       // For this setup to work a valid user must be set up for each of the 
addresses you use,
+       // that is grant access to the wikiuser for each of them. Failure to do 
so will make the
+       // MySQL server refuse access.
+       'hostsByName' => array(
+               'localhost' => '127.0.0.1:3306',
+               'local1' => '127.0.2.1',
+               'local2' => '127.0.2.2',
+               'local3' => '127.0.2.3',
+       ),
+
+       // Set up as fake master, because there are no slaves.
+       'masterTemplateOverrides' => array( 'fakeMaster' => true ),
+);
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f3670f16fb32019463a5c5b8cdc4d2ee147d848
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com>

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

Reply via email to