1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-13 02:12:41 +01:00

Read "Database Status" page connection information from cluster config if present

Summary:
Fixes T11043. This page was still reading the old information directly instead of going through the cluster-aware stuff.

Have it ask the cluster-aware stuff for information instead.

Test Plan:
  - Nuked MySQL on localhost.
  - Configured cluster hosts.
  - Loaded "Database Status" page -- worked after patch.
  - Grepped for any remaining `mysql.configuration-provider` stragglers, came up empty.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11043

Differential Revision: https://secure.phabricator.com/D15982
This commit is contained in:
epriestley 2016-05-26 12:10:30 -07:00
parent 727a7de759
commit 74a36f9d7b

View file

@ -4,16 +4,14 @@ abstract class PhabricatorConfigDatabaseController
extends PhabricatorConfigController { extends PhabricatorConfigController {
protected function buildSchemaQuery() { protected function buildSchemaQuery() {
$conf = PhabricatorEnv::newObjectFromConfig( $ref = PhabricatorDatabaseRef::getMasterDatabaseRef();
'mysql.configuration-provider',
array($dao = null, 'w'));
$api = id(new PhabricatorStorageManagementAPI()) $api = id(new PhabricatorStorageManagementAPI())
->setUser($conf->getUser()) ->setUser($ref->getUser())
->setHost($conf->getHost()) ->setHost($ref->getHost())
->setPort($conf->getPort()) ->setPort($ref->getPort())
->setNamespace(PhabricatorLiskDAO::getDefaultStorageNamespace()) ->setNamespace(PhabricatorLiskDAO::getDefaultStorageNamespace())
->setPassword($conf->getPassword()); ->setPassword($ref->getPass());
$query = id(new PhabricatorConfigSchemaQuery()) $query = id(new PhabricatorConfigSchemaQuery())
->setAPI($api); ->setAPI($api);