File tree 5 files changed +31
-10
lines changed
applications/base/storage/configuration 5 files changed +31
-10
lines changed Original file line number Diff line number Diff line change 59
59
// Use always the version from the commandline if it is defined
60
60
$ next_version = isset ($ options ['v ' ]) ? (int )$ options ['v ' ] : null ;
61
61
62
- // TODO: Get this stuff from DatabaseConfigurationProvider?
62
+ $ conf = DatabaseConfigurationProvider::getConfiguration ();
63
+
63
64
if ($ options ['u ' ]) {
64
65
$ conn_user = $ options ['u ' ];
65
66
$ conn_pass = $ options ['p ' ];
66
67
} 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 ( );
69
70
}
70
- $ conn_host = PhabricatorEnv:: getEnvConfig ( ' mysql.host ' );
71
+ $ conn_host = $ conf -> getHost ( );
71
72
72
73
// Split out port information, since the command-line client requires a
73
74
// separate flag for the port.
Original file line number Diff line number Diff line change @@ -48,4 +48,15 @@ final protected function getDao() {
48
48
final protected function getMode () {
49
49
return $ this ->mode ;
50
50
}
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
+
51
62
}
Original file line number Diff line number Diff line change 6
6
7
7
8
8
9
+ phutil_require_module ('phabricator ' , 'applications/people/storage/user ' );
9
10
phutil_require_module ('phabricator ' , 'infrastructure/env ' );
10
11
12
+ phutil_require_module ('phutil ' , 'symbols ' );
13
+ phutil_require_module ('phutil ' , 'utils ' );
14
+
11
15
12
16
phutil_require_source ('DatabaseConfigurationProvider.php ' );
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ public static function runSetup() {
68
68
} else {
69
69
if (trim ($ stdout ) == 'YES ' ) {
70
70
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" );
72
72
} else {
73
73
self ::write (" warn pcntl is not available! \n" );
74
74
self ::write ("[WARN] *** WARNING *** pcntl extension not available. " .
@@ -120,7 +120,7 @@ public static function runSetup() {
120
120
}
121
121
}
122
122
}
123
- self ::write ("[OKAY] All submodules OKAY. " );
123
+ self ::write ("[OKAY] All submodules OKAY. \n " );
124
124
125
125
self ::writeHeader ("BASIC CONFIGURATION " );
126
126
@@ -241,9 +241,10 @@ public static function runSetup() {
241
241
242
242
self ::writeHeader ("MySQL DATABASE CONFIGURATION " );
243
243
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 ();
247
248
248
249
$ timeout = ini_get ('mysql.connect_timeout ' );
249
250
if ($ timeout > 5 ) {
Original file line number Diff line number Diff line change 4
4
* @generated
5
5
*/
6
6
7
+
8
+
9
+ phutil_require_module ('phabricator ' , 'applications/base/storage/configuration ' );
7
10
phutil_require_module ('phabricator ' , 'infrastructure/env ' );
8
11
phutil_require_module ('phabricator ' , 'infrastructure/setup/sql ' );
9
12
phutil_require_module ('phabricator ' , 'storage/connection/mysql ' );
15
18
phutil_require_module ('phutil ' , 'parser/uri ' );
16
19
phutil_require_module ('phutil ' , 'utils ' );
17
20
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