Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/option/PhabricatorMySQLConfigOptions.php
| <?php | <?php | ||||
| final class PhabricatorMySQLConfigOptions | final class PhabricatorMySQLConfigOptions | ||||
| extends PhabricatorApplicationConfigOptions { | extends PhabricatorApplicationConfigOptions { | ||||
| public function getName() { | public function getName() { | ||||
| return pht("MySQL"); | return pht('MySQL'); | ||||
| } | } | ||||
| public function getDescription() { | public function getDescription() { | ||||
| return pht("Database configuration."); | return pht('Database configuration.'); | ||||
| } | } | ||||
| public function getOptions() { | public function getOptions() { | ||||
| return array( | return array( | ||||
| $this->newOption('mysql.host', 'string', 'localhost') | $this->newOption('mysql.host', 'string', 'localhost') | ||||
| ->setLocked(true) | ->setLocked(true) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht("MySQL database hostname.")) | pht('MySQL database hostname.')) | ||||
| ->addExample('localhost', pht('MySQL on this machine')) | ->addExample('localhost', pht('MySQL on this machine')) | ||||
| ->addExample('db.example.com:3300', pht('Nonstandard port')), | ->addExample('db.example.com:3300', pht('Nonstandard port')), | ||||
| $this->newOption('mysql.user', 'string', 'root') | $this->newOption('mysql.user', 'string', 'root') | ||||
| ->setLocked(true) | ->setLocked(true) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht("MySQL username to use when connecting to the database.")), | pht('MySQL username to use when connecting to the database.')), | ||||
| $this->newOption('mysql.pass', 'string', null) | $this->newOption('mysql.pass', 'string', null) | ||||
| ->setHidden(true) | ->setHidden(true) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht("MySQL password to use when connecting to the database.")), | pht('MySQL password to use when connecting to the database.')), | ||||
| $this->newOption( | $this->newOption( | ||||
| 'mysql.configuration-provider', | 'mysql.configuration-provider', | ||||
| 'class', | 'class', | ||||
| 'DefaultDatabaseConfigurationProvider') | 'DefaultDatabaseConfigurationProvider') | ||||
| ->setLocked(true) | ->setLocked(true) | ||||
| ->setBaseClass('DatabaseConfigurationProvider') | ->setBaseClass('DatabaseConfigurationProvider') | ||||
| ->setSummary( | ->setSummary( | ||||
| pht('Configure database configuration class.')) | pht('Configure database configuration class.')) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht( | pht( | ||||
| "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( | $this->newOption( | ||||
| 'mysql.implementation', | 'mysql.implementation', | ||||
| 'class', | 'class', | ||||
| (extension_loaded('mysqli') | (extension_loaded('mysqli') | ||||
| ? 'AphrontMySQLiDatabaseConnection' | ? 'AphrontMySQLiDatabaseConnection' | ||||
| : 'AphrontMySQLDatabaseConnection')) | : 'AphrontMySQLDatabaseConnection')) | ||||
| ->setLocked(true) | ->setLocked(true) | ||||
| ->setBaseClass('AphrontMySQLDatabaseConnectionBase') | ->setBaseClass('AphrontMySQLDatabaseConnectionBase') | ||||
| ->setSummary( | ->setSummary( | ||||
| pht('Configure database connection class.')) | pht('Configure database connection class.')) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht( | pht( | ||||
| "Phabricator connects to MySQL through a swappable abstraction ". | 'Phabricator connects to MySQL through a swappable abstraction '. | ||||
| "layer. You can choose an alternate implementation by setting ". | 'layer. You can choose an alternate implementation by setting '. | ||||
| "this option. To provide your own implementation, extend ". | 'this option. To provide your own implementation, extend '. | ||||
| "`AphrontMySQLDatabaseConnectionBase`. It is very unlikely that ". | '`AphrontMySQLDatabaseConnectionBase`. It is very unlikely that '. | ||||
| "you need to change this.")), | 'you need to change this.')), | ||||
| $this->newOption('storage.default-namespace', 'string', 'phabricator') | $this->newOption('storage.default-namespace', 'string', 'phabricator') | ||||
| ->setLocked(true) | ->setLocked(true) | ||||
| ->setSummary( | ->setSummary( | ||||
| pht("The namespace that Phabricator databases should use.")) | pht('The namespace that Phabricator databases should use.')) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht( | pht( | ||||
| "Phabricator puts databases in a namespace, which defaults to ". | "Phabricator puts databases in a namespace, which defaults to ". | ||||
| "'phabricator' -- for instance, the Differential database is ". | "'phabricator' -- for instance, the Differential database is ". | ||||
| "named 'phabricator_differential' by default. You can change ". | "named 'phabricator_differential' by default. You can change ". | ||||
| "this namespace if you want. Normally, you should not do this ". | "this namespace if you want. Normally, you should not do this ". | ||||
| "unless you are developing Phabricator and using namespaces to ". | "unless you are developing Phabricator and using namespaces to ". | ||||
| "separate multiple sandbox datasets.")), | "separate multiple sandbox datasets.")), | ||||
| $this->newOption('mysql.port', 'string', null) | $this->newOption('mysql.port', 'string', null) | ||||
| ->setLocked(true) | ->setLocked(true) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht("MySQL port to use when connecting to the database.")), | pht('MySQL port to use when connecting to the database.')), | ||||
| ); | ); | ||||
| } | } | ||||
| } | } | ||||