File tree Expand file tree Collapse file tree 5 files changed +31
-10
lines changed
applications/base/storage/configuration Expand file tree Collapse file tree 5 files changed +31
-10
lines changed Original file line number Diff line number Diff line change 5959// Use always the version from the commandline if it is defined
6060$ next_version = isset ($ options ['v ' ]) ? (int )$ options ['v ' ] : null ;
6161
62- // TODO: Get this stuff from DatabaseConfigurationProvider?
62+ $ conf = DatabaseConfigurationProvider::getConfiguration ();
63+
6364if ($ options ['u ' ]) {
6465 $ conn_user = $ options ['u ' ];
6566 $ conn_pass = $ options ['p ' ];
6667} else {
67- $ conn_user = PhabricatorEnv:: getEnvConfig ( ' mysql.user ' );
68- $ conn_pass = PhabricatorEnv:: getEnvConfig ( ' mysql.pass ' );
68+ $ conn_user = $ conf -> getUser ( );
69+ $ conn_pass = $ conf -> getPassword ( );
6970}
70- $ conn_host = PhabricatorEnv:: getEnvConfig ( ' mysql.host ' );
71+ $ conn_host = $ conf -> getHost ( );
7172
7273// Split out port information, since the command-line client requires a
7374// separate flag for the port.
Original file line number Diff line number Diff line change @@ -48,4 +48,15 @@ final protected function getDao() {
4848 final protected function getMode () {
4949 return $ this ->mode ;
5050 }
51+
52+ public static function getConfiguration () {
53+ // Get DB info. Note that we are using a dummy PhabricatorUser object in
54+ // creating the DatabaseConfigurationProvider, which is not used at all.
55+ $ conf_provider = PhabricatorEnv::getEnvConfig (
56+ 'mysql.configuration_provider ' , 'DatabaseConfigurationProvider ' );
57+ PhutilSymbolLoader::loadClass ($ conf_provider );
58+ $ conf = newv ($ conf_provider , array (new PhabricatorUser (), 'r ' ));
59+ return $ conf ;
60+ }
61+
5162}
Original file line number Diff line number Diff line change 66
77
88
9+ phutil_require_module ('phabricator ' , 'applications/people/storage/user ' );
910phutil_require_module ('phabricator ' , 'infrastructure/env ' );
1011
12+ phutil_require_module ('phutil ' , 'symbols ' );
13+ phutil_require_module ('phutil ' , 'utils ' );
14+
1115
1216phutil_require_source ('DatabaseConfigurationProvider.php ' );
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ public static function runSetup() {
6868 } else {
6969 if (trim ($ stdout ) == 'YES ' ) {
7070 self ::write (" okay pcntl is available from the command line. \n" );
71- self ::write ("[OKAY] All extensions OKAY \n\n " );
71+ self ::write ("[OKAY] All extensions OKAY \n" );
7272 } else {
7373 self ::write (" warn pcntl is not available! \n" );
7474 self ::write ("[WARN] *** WARNING *** pcntl extension not available. " .
@@ -120,7 +120,7 @@ public static function runSetup() {
120120 }
121121 }
122122 }
123- self ::write ("[OKAY] All submodules OKAY. " );
123+ self ::write ("[OKAY] All submodules OKAY. \n " );
124124
125125 self ::writeHeader ("BASIC CONFIGURATION " );
126126
@@ -241,9 +241,10 @@ public static function runSetup() {
241241
242242 self ::writeHeader ("MySQL DATABASE CONFIGURATION " );
243243
244- $ conn_user = PhabricatorEnv::getEnvConfig ('mysql.user ' );
245- $ conn_pass = PhabricatorEnv::getEnvConfig ('mysql.pass ' );
246- $ conn_host = PhabricatorEnv::getEnvConfig ('mysql.host ' );
244+ $ conf = DatabaseConfigurationProvider::getConfiguration ();
245+ $ conn_user = $ conf ->getUser ();
246+ $ conn_pass = $ conf ->getPassword ();
247+ $ conn_host = $ conf ->getHost ();
247248
248249 $ timeout = ini_get ('mysql.connect_timeout ' );
249250 if ($ timeout > 5 ) {
Original file line number Diff line number Diff line change 44 * @generated
55 */
66
7+
8+
9+ phutil_require_module ('phabricator ' , 'applications/base/storage/configuration ' );
710phutil_require_module ('phabricator ' , 'infrastructure/env ' );
811phutil_require_module ('phabricator ' , 'infrastructure/setup/sql ' );
912phutil_require_module ('phabricator ' , 'storage/connection/mysql ' );
1518phutil_require_module ('phutil ' , 'parser/uri ' );
1619phutil_require_module ('phutil ' , 'utils ' );
1720
18- phutil_require_source ('PhabricatorSetup.php ' );
21+
22+ phutil_require_source ('PhabricatorSetup.php ' );
You can’t perform that action at this time.
0 commit comments