*/
protected function configureDB() {
$availableDBClasses = self::getAvailableDBClasses();
- $dbHost = 'localhost';
- $dbUser = 'root';
- $dbPassword = '';
- $dbName = 'wcf';
- $dbNumber = 1;
- $dbClass = '';
+ if (self::$developerMode && isset($_ENV['WCFSETUP_DBHOST'])) {
+ $dbHost = $_ENV['WCFSETUP_DBHOST'];
+ $dbUser = $_ENV['WCFSETUP_DBUSER'];
+ $dbPassword = $_ENV['WCFSETUP_DBPASSWORD'];
+ $dbName = $_ENV['WCFSETUP_DBNAME'];
+ $dbNumber = 1;
+ }
+ else {
+ $dbHost = 'localhost';
+ $dbUser = 'root';
+ $dbPassword = '';
+ $dbName = 'wcf';
+ $dbNumber = 1;
+ $dbClass = '';
+ }
+
// set $dbClass to first item in $availableDBClasses
foreach ($availableDBClasses as $dbClass) {
$dbClass = $dbClass['class'];
break;
}
- if (isset($_POST['send'])) {
+ if (isset($_POST['send']) || (self::$developerMode && isset($_ENV['WCFSETUP_DBHOST']))) {
if (isset($_POST['dbHost'])) $dbHost = $_POST['dbHost'];
if (isset($_POST['dbUser'])) $dbUser = $_POST['dbUser'];
if (isset($_POST['dbPassword'])) $dbPassword = $_POST['dbPassword'];