mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-02 11:42:42 +01:00
Remove "mysql.implementation" configuration
Summary: Ref T11044. Fixes T10931. This option has essentially never been useful for anything, and we've picked the best implementation for a long time (MySQLi if available, MySQL if not). I am not aware of any reason to ever set this manually. If someone comes up with some bizarre but legitimate use case that I haven't thought of, we can modularize it. Test Plan: Browsed around. Grepped for `mysql.implementation`. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10931, T11044 Differential Revision: https://secure.phabricator.com/D16909
This commit is contained in:
parent
88a966993b
commit
bac27fb403
6 changed files with 23 additions and 41 deletions
|
@ -341,6 +341,9 @@ final class PhabricatorExtraConfigSetupCheck extends PhabricatorSetupCheck {
|
||||||
'maniphest.priorities.unbreak-now' => $dashboard_reason,
|
'maniphest.priorities.unbreak-now' => $dashboard_reason,
|
||||||
'maniphest.priorities.needs-triage' => $dashboard_reason,
|
'maniphest.priorities.needs-triage' => $dashboard_reason,
|
||||||
|
|
||||||
|
'mysql.implementation' => pht(
|
||||||
|
'Phabricator now automatically selects the best available '.
|
||||||
|
'MySQL implementation.'),
|
||||||
);
|
);
|
||||||
|
|
||||||
return $ancient_config;
|
return $ancient_config;
|
||||||
|
|
|
@ -48,23 +48,6 @@ final class PhabricatorMySQLConfigOptions
|
||||||
'Phabricator chooses which database to connect to through a '.
|
'Phabricator chooses which database to connect to through a '.
|
||||||
'swappable configuration provider. You almost certainly do not '.
|
'swappable configuration provider. You almost certainly do not '.
|
||||||
'need to change this.')),
|
'need to change this.')),
|
||||||
$this->newOption(
|
|
||||||
'mysql.implementation',
|
|
||||||
'class',
|
|
||||||
(extension_loaded('mysqli')
|
|
||||||
? 'AphrontMySQLiDatabaseConnection'
|
|
||||||
: 'AphrontMySQLDatabaseConnection'))
|
|
||||||
->setLocked(true)
|
|
||||||
->setBaseClass('AphrontMySQLDatabaseConnectionBase')
|
|
||||||
->setSummary(
|
|
||||||
pht('Configure database connection class.'))
|
|
||||||
->setDescription(
|
|
||||||
pht(
|
|
||||||
'Phabricator connects to MySQL through a swappable abstraction '.
|
|
||||||
'layer. You can choose an alternate implementation by setting '.
|
|
||||||
'this option. To provide your own implementation, extend '.
|
|
||||||
'`%s`. It is very unlikely that you need to change this.',
|
|
||||||
'AphrontMySQLDatabaseConnectionBase')),
|
|
||||||
$this->newOption('storage.default-namespace', 'string', 'phabricator')
|
$this->newOption('storage.default-namespace', 'string', 'phabricator')
|
||||||
->setLocked(true)
|
->setLocked(true)
|
||||||
->setSummary(
|
->setSummary(
|
||||||
|
|
|
@ -57,9 +57,7 @@ final class DarkConsoleServicesPlugin extends DarkConsolePlugin {
|
||||||
// For each SELECT query, go issue an EXPLAIN on it so we can flag stuff
|
// For each SELECT query, go issue an EXPLAIN on it so we can flag stuff
|
||||||
// causing table scans, etc.
|
// causing table scans, etc.
|
||||||
if (preg_match('/^\s*SELECT\b/i', $entry['query'])) {
|
if (preg_match('/^\s*SELECT\b/i', $entry['query'])) {
|
||||||
$conn = PhabricatorEnv::newObjectFromConfig(
|
$conn = PhabricatorDatabaseRef::newRawConnection($entry['config']);
|
||||||
'mysql.implementation',
|
|
||||||
array($entry['config']));
|
|
||||||
try {
|
try {
|
||||||
$explain = queryfx_all(
|
$explain = queryfx_all(
|
||||||
$conn,
|
$conn,
|
||||||
|
|
|
@ -663,11 +663,15 @@ final class PhabricatorDatabaseRef
|
||||||
'timeout' => $default_timeout,
|
'timeout' => $default_timeout,
|
||||||
);
|
);
|
||||||
|
|
||||||
return PhabricatorEnv::newObjectFromConfig(
|
return self::newRawConnection($spec);
|
||||||
'mysql.implementation',
|
}
|
||||||
array(
|
|
||||||
$spec,
|
public static function newRawConnection(array $options) {
|
||||||
));
|
if (extension_loaded('mysqli')) {
|
||||||
|
return new AphrontMySQLiDatabaseConnection($options);
|
||||||
|
} else {
|
||||||
|
return new AphrontMySQLDatabaseConnection($options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,9 +101,7 @@ abstract class PhabricatorLiskDAO extends LiskDAO {
|
||||||
'mysql.configuration-provider',
|
'mysql.configuration-provider',
|
||||||
array($this, $mode, $namespace));
|
array($this, $mode, $namespace));
|
||||||
|
|
||||||
return PhabricatorEnv::newObjectFromConfig(
|
return PhabricatorDatabaseRef::newRawConnection(
|
||||||
'mysql.implementation',
|
|
||||||
array(
|
|
||||||
array(
|
array(
|
||||||
'user' => $conf->getUser(),
|
'user' => $conf->getUser(),
|
||||||
'pass' => $conf->getPassword(),
|
'pass' => $conf->getPassword(),
|
||||||
|
@ -112,7 +110,6 @@ abstract class PhabricatorLiskDAO extends LiskDAO {
|
||||||
'database' => $database,
|
'database' => $database,
|
||||||
'retries' => 3,
|
'retries' => 3,
|
||||||
'timeout' => 10,
|
'timeout' => 10,
|
||||||
),
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,9 +109,7 @@ final class PhabricatorStorageManagementAPI extends Phobject {
|
||||||
$database = $this->getDatabaseName($fragment);
|
$database = $this->getDatabaseName($fragment);
|
||||||
$return = &$this->conns[$this->host][$this->user][$database];
|
$return = &$this->conns[$this->host][$this->user][$database];
|
||||||
if (!$return) {
|
if (!$return) {
|
||||||
$return = PhabricatorEnv::newObjectFromConfig(
|
$return = PhabricatorDatabaseRef::newRawConnection(
|
||||||
'mysql.implementation',
|
|
||||||
array(
|
|
||||||
array(
|
array(
|
||||||
'user' => $this->user,
|
'user' => $this->user,
|
||||||
'pass' => $this->password,
|
'pass' => $this->password,
|
||||||
|
@ -120,7 +118,6 @@ final class PhabricatorStorageManagementAPI extends Phobject {
|
||||||
'database' => $fragment
|
'database' => $fragment
|
||||||
? $database
|
? $database
|
||||||
: null,
|
: null,
|
||||||
),
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
|
|
Loading…
Reference in a new issue