ArielGlenn has uploaded a new change for review.

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

Change subject: provide the equivalent of getSlaveServer.php for centralauth
......................................................................

provide the equivalent of getSlaveServer.php for centralauth

This script will display the name of a slave server as well as
an admin user and password, for use by scripts outside of MediaWiki
not necessarily in php, that may do queries or dump tables from the db

Bug: T141563
Change-Id: I24e2ee1d92b993d6e5bd0b0a2df7a7f4e7588a00
---
A maintenance/getCentralAuthDBInfo.php
1 file changed, 25 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/70/301670/1

diff --git a/maintenance/getCentralAuthDBInfo.php 
b/maintenance/getCentralAuthDBInfo.php
new file mode 100644
index 0000000..e4e51ad
--- /dev/null
+++ b/maintenance/getCentralAuthDBInfo.php
@@ -0,0 +1,25 @@
+<?php
+
+$IP = getenv( 'MW_INSTALL_PATH' );
+if ( $IP === false ) {
+       $IP = __DIR__ . '/../../..';
+}
+require_once( "$IP/maintenance/Maintenance.php" );
+
+class GetCentralAuthDBInfo extends Maintenance {
+       public function __construct() {
+               parent::__construct();
+               $this->mDescription = 'Display info for slave server hosting 
the CentralAuth DB';
+       }
+
+       public function execute() {
+               global $wgDBadminuser;
+               global $wgDBadminpassword;
+               $db = CentralAuthUtils::getCentralSlaveDB();
+               $host = $db->getServer();
+               $this->output( "$host $wgDBadminuser $wgDBadminpassword\n" );
+       }
+}
+
+$maintClass ="GetCentralAuthDBInfo";
+require_once RUN_MAINTENANCE_IF_MAIN;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I24e2ee1d92b993d6e5bd0b0a2df7a7f4e7588a00
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: ArielGlenn <ar...@wikimedia.org>

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

Reply via email to