Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14041292
D16911.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D16911.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -345,8 +345,6 @@
'DarkConsoleStartupPlugin' => 'applications/console/plugin/DarkConsoleStartupPlugin.php',
'DarkConsoleXHProfPlugin' => 'applications/console/plugin/DarkConsoleXHProfPlugin.php',
'DarkConsoleXHProfPluginAPI' => 'applications/console/plugin/xhprof/DarkConsoleXHProfPluginAPI.php',
- 'DatabaseConfigurationProvider' => 'infrastructure/storage/configuration/DatabaseConfigurationProvider.php',
- 'DefaultDatabaseConfigurationProvider' => 'infrastructure/storage/configuration/DefaultDatabaseConfigurationProvider.php',
'DifferentialAction' => 'applications/differential/constants/DifferentialAction.php',
'DifferentialActionEmailCommand' => 'applications/differential/command/DifferentialActionEmailCommand.php',
'DifferentialAddCommentView' => 'applications/differential/view/DifferentialAddCommentView.php',
@@ -4949,10 +4947,6 @@
'DarkConsoleStartupPlugin' => 'DarkConsolePlugin',
'DarkConsoleXHProfPlugin' => 'DarkConsolePlugin',
'DarkConsoleXHProfPluginAPI' => 'Phobject',
- 'DefaultDatabaseConfigurationProvider' => array(
- 'Phobject',
- 'DatabaseConfigurationProvider',
- ),
'DifferentialAction' => 'Phobject',
'DifferentialActionEmailCommand' => 'MetaMTAEmailTransactionCommand',
'DifferentialAddCommentView' => 'AphrontView',
diff --git a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
--- a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
+++ b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
@@ -344,6 +344,10 @@
'mysql.implementation' => pht(
'Phabricator now automatically selects the best available '.
'MySQL implementation.'),
+
+ 'mysql.configuration-provider' => pht(
+ 'Phabricator now has application-level management of partitioning '.
+ 'and replicas.'),
);
return $ancient_config;
diff --git a/src/applications/config/option/PhabricatorMySQLConfigOptions.php b/src/applications/config/option/PhabricatorMySQLConfigOptions.php
--- a/src/applications/config/option/PhabricatorMySQLConfigOptions.php
+++ b/src/applications/config/option/PhabricatorMySQLConfigOptions.php
@@ -35,19 +35,6 @@
->setHidden(true)
->setDescription(
pht('MySQL password to use when connecting to the database.')),
- $this->newOption(
- 'mysql.configuration-provider',
- 'class',
- 'DefaultDatabaseConfigurationProvider')
- ->setLocked(true)
- ->setBaseClass('DatabaseConfigurationProvider')
- ->setSummary(
- pht('Configure database configuration class.'))
- ->setDescription(
- pht(
- 'Phabricator chooses which database to connect to through a '.
- 'swappable configuration provider. You almost certainly do not '.
- 'need to change this.')),
$this->newOption('storage.default-namespace', 'string', 'phabricator')
->setLocked(true)
->setSummary(
diff --git a/src/infrastructure/cluster/PhabricatorDatabaseRef.php b/src/infrastructure/cluster/PhabricatorDatabaseRef.php
--- a/src/infrastructure/cluster/PhabricatorDatabaseRef.php
+++ b/src/infrastructure/cluster/PhabricatorDatabaseRef.php
@@ -569,17 +569,20 @@
}
public static function newIndividualRef() {
- $conf = PhabricatorEnv::newObjectFromConfig(
- 'mysql.configuration-provider',
- array(null, 'w', null));
+ $default_user = PhabricatorEnv::getEnvConfig('mysql.user');
+ $default_pass = new PhutilOpaqueEnvelope(
+ PhabricatorEnv::getEnvConfig('mysql.pass'));
+ $default_host = PhabricatorEnv::getEnvConfig('mysql.host');
+ $default_port = PhabricatorEnv::getEnvConfig('mysql.port');
return id(new self())
- ->setHost($conf->getHost())
- ->setPort($conf->getPort())
- ->setUser($conf->getUser())
- ->setPass($conf->getPassword())
+ ->setUser($default_user)
+ ->setPass($default_pass)
+ ->setHost($default_host)
+ ->setPort($default_port)
->setIsIndividual(true)
- ->setIsMaster(true);
+ ->setIsMaster(true)
+ ->setIsDefaultPartition(true);
}
public static function getAllReplicaDatabaseRefs() {
diff --git a/src/infrastructure/storage/configuration/DatabaseConfigurationProvider.php b/src/infrastructure/storage/configuration/DatabaseConfigurationProvider.php
deleted file mode 100644
--- a/src/infrastructure/storage/configuration/DatabaseConfigurationProvider.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-interface DatabaseConfigurationProvider {
-
- public function __construct(
- LiskDAO $dao = null,
- $mode = 'r',
- $namespace = 'phabricator');
-
- public function getUser();
- public function getPassword();
- public function getHost();
- public function getPort();
- public function getDatabase();
-
-}
diff --git a/src/infrastructure/storage/configuration/DefaultDatabaseConfigurationProvider.php b/src/infrastructure/storage/configuration/DefaultDatabaseConfigurationProvider.php
deleted file mode 100644
--- a/src/infrastructure/storage/configuration/DefaultDatabaseConfigurationProvider.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-
-final class DefaultDatabaseConfigurationProvider
- extends Phobject
- implements DatabaseConfigurationProvider {
-
- private $dao;
- private $mode;
- private $namespace;
-
- public function __construct(
- LiskDAO $dao = null,
- $mode = 'r',
- $namespace = 'phabricator') {
-
- $this->dao = $dao;
- $this->mode = $mode;
- $this->namespace = $namespace;
- }
-
- public function getUser() {
- return PhabricatorEnv::getEnvConfig('mysql.user');
- }
-
- public function getPassword() {
- return new PhutilOpaqueEnvelope(PhabricatorEnv::getEnvConfig('mysql.pass'));
- }
-
- public function getHost() {
- return PhabricatorEnv::getEnvConfig('mysql.host');
- }
-
- public function getPort() {
- return PhabricatorEnv::getEnvConfig('mysql.port');
- }
-
- public function getDatabase() {
- if (!$this->getDao()) {
- return null;
- }
- return $this->namespace.'_'.$this->getDao()->getApplicationName();
- }
-
- protected function getDao() {
- return $this->dao;
- }
-
-}
diff --git a/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php b/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php
--- a/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php
+++ b/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php
@@ -60,15 +60,10 @@
$this->raiseImproperWrite($database);
}
- $is_cluster = (bool)PhabricatorEnv::getEnvConfig('cluster.databases');
- if ($is_cluster) {
- $connection = $this->newClusterConnection(
- $this->getApplicationName(),
- $database,
- $mode);
- } else {
- $connection = $this->newBasicConnection($database, $mode, $namespace);
- }
+ $connection = $this->newClusterConnection(
+ $this->getApplicationName(),
+ $database,
+ $mode);
// TODO: This should be testing if the mode is "r", but that would probably
// break a lot of things. Perform a more narrow test for readonly mode
@@ -96,23 +91,6 @@
return $connection;
}
- private function newBasicConnection($database, $mode, $namespace) {
- $conf = PhabricatorEnv::newObjectFromConfig(
- 'mysql.configuration-provider',
- array($this, $mode, $namespace));
-
- return PhabricatorDatabaseRef::newRawConnection(
- array(
- 'user' => $conf->getUser(),
- 'pass' => $conf->getPassword(),
- 'host' => $conf->getHost(),
- 'port' => $conf->getPort(),
- 'database' => $database,
- 'retries' => 3,
- 'timeout' => 10,
- ));
- }
-
private function newClusterConnection($application, $database, $mode) {
$master = PhabricatorDatabaseRef::getMasterDatabaseRefForApplication(
$application);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 12, 5:12 PM (6 d, 9 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6723991
Default Alt Text
D16911.diff (7 KB)
Attached To
Mode
D16911: Remove "mysql.configuration-provider" configuration option
Attached
Detach File
Event Timeline
Log In to Comment