"auto": true,
"host": "localhost",
"password": "root",
- "username": "root",
- "dbNumber": "2"
+ "username": "root"
},
"useDefaultInstallPath": true,
"forceStaticCookiePrefix": true
$dbUser = $_ENV['WCFSETUP_DBUSER'];
$dbPassword = $_ENV['WCFSETUP_DBPASSWORD'];
$dbName = $_ENV['WCFSETUP_DBNAME'];
- $dbNumber = 1;
$attemptConnection = true;
} elseif (self::$developerMode && ($config = DevtoolsSetup::getInstance()->getDatabaseConfig()) !== null) {
$dbUser = $config['username'];
$dbPassword = $config['password'];
$dbName = $config['dbName'];
- $dbNumber = $config['dbNumber'];
if ($config['auto']) {
$attemptConnection = true;
$dbUser = 'root';
$dbPassword = '';
$dbName = 'wcf';
- $dbNumber = 1;
}
if ($attemptConnection) {
$dbName = $_POST['dbName'];
}
- // ensure that $dbNumber is zero or a positive integer
- if (isset($_POST['dbNumber'])) {
- $dbNumber = \max(0, \intval($_POST['dbNumber']));
- }
-
// get port
$dbHostWithoutPort = $dbHost;
$dbPort = 0;
*/
// check for table conflicts
- $conflictedTables = $this->getConflictedTables($db, $dbNumber);
+ $conflictedTables = $this->getConflictedTables($db);
// write config.inc
if (empty($conflictedTables)) {
$file->write("\$dbUser = '" . \str_replace("'", "\\'", $dbUser) . "';\n");
$file->write("\$dbPassword = '" . \str_replace("'", "\\'", $dbPassword) . "';\n");
$file->write("\$dbName = '" . \str_replace("'", "\\'", $dbName) . "';\n");
- $file->write("if (!defined('WCF_N')) define('WCF_N', {$dbNumber});\n");
+ $file->write("if (!defined('WCF_N')) define('WCF_N', 1);\n");
$file->close();
// go to next step
'dbUser' => $dbUser,
'dbPassword' => $dbPassword,
'dbName' => $dbName,
- 'dbNumber' => $dbNumber,
'nextStep' => 'configureDB',
]);
WCF::getTPL()->display('stepConfigureDB');
* which will be created in the next step.
*
* @param \wcf\system\database\Database $db
- * @param int $dbNumber
* @return string[] list of already existing tables
*/
- protected function getConflictedTables($db, $dbNumber)
+ protected function getConflictedTables($db)
{
// get content of the sql structure file
$sql = \file_get_contents(TMP_DIR . 'setup/db/install.sql');
- // installation number value 'n' (WCF_N) must be reflected in the executed sql queries
- $sql = \str_replace('wcf1_', 'wcf' . $dbNumber . '_', $sql);
-
// get all tablenames which should be created
\preg_match_all("%CREATE\\s+TABLE\\s+(\\w+)%", $sql, $matches);
'password' => $dbConfig['password'],
'username' => $dbConfig['username'],
'dbName' => $dbName,
- 'dbNumber' => $dbConfig['dbNumber'],
];
}
<item name="wcf.global.configureDB.password"><![CDATA[Kennwort]]></item>
<item name="wcf.global.configureDB.database"><![CDATA[Datenbankname]]></item>
<item name="wcf.global.configureDB.database.description"><![CDATA[Die spezifizierte Datenbank muss bereits angelegt sein.]]></item>
- <item name="wcf.global.configureDB.number"><![CDATA[Installationsnummer]]></item>
- <item name="wcf.global.configureDB.number.description"><![CDATA[Die Installationsnummer erlaubt Ihnen mehrere Installationen der Software in der gleichen Datenbank zu speichern. Wenn dies Ihre erste Installation der Software in dieser Datenbank ist, sollten Sie hier den Wert <em>1</em> wählen.]]></item>
<item name="wcf.global.configureDB.error"><![CDATA[Beim Verbindungsversuch mit der Datenbank ist folgender Fehler aufgetreten:
<br><strong>{$exception->getMessage()}{if $exception->getPrevious()}<br>{$exception->getPrevious()->getMessage()}{/if}</strong>]]></item>
- <item name="wcf.global.configureDB.conflictedTables"><![CDATA[Folgende Tabelle{if $conflictedTables|count > 1}n{/if} existier{if $conflictedTables|count > 1}en{else}t{/if} schon in der Datenbank „{$dbName}“:<br>{implode from=$conflictedTables item="table"}{$table}{/implode}.<br><br>Um dieses Problem zu beheben, können Sie:<br>1. diese Tabelle{if $conflictedTables|count > 1}n{/if} manuell löschen und die „Weiter“ Schaltfläche betätigen, oder<br>2. Sie geben die Daten einer anderen Datenbank ein und betätigen die „Weiter“ Schaltfläche, oder<br>3. Sie geben eine von „{$dbNumber}“ unterschiedliche Installationsnummer an und betätigen die „Weiter“ Schaltfläche.]]></item>
+ <item name="wcf.global.configureDB.conflictedTables"><![CDATA[Folgende Tabelle{if $conflictedTables|count > 1}n{/if} existier{if $conflictedTables|count > 1}en{else}t{/if} schon in der Datenbank „{$dbName}“:<br>{implode from=$conflictedTables item="table"}{$table}{/implode}.<br><br>Um dieses Problem zu beheben, können Sie:<br>1. diese Tabelle{if $conflictedTables|count > 1}n{/if} manuell löschen und die „Weiter“ Schaltfläche betätigen, oder<br>2. Sie geben die Daten einer anderen Datenbank ein und betätigen die „Weiter“ Schaltfläche.]]></item>
<item name="wcf.global.createUser"><![CDATA[Administrator erstellen]]></item>
<item name="wcf.global.createUser.description"><![CDATA[Der Installationsassistent erstellt nun ein Administrator-Konto für Sie. Bitte geben Sie dazu einen Benutzernamen, eine E-Mail-Adresse und ein Kennwort ein.]]></item>
<item name="wcf.global.createUser.username"><![CDATA[Benutzername]]></item>
<item name="wcf.global.configureDB.password"><![CDATA[Password]]></item>
<item name="wcf.global.configureDB.database"><![CDATA[Database Name]]></item>
<item name="wcf.global.configureDB.database.description"><![CDATA[The database must already exist.]]></item>
- <item name="wcf.global.configureDB.number"><![CDATA[Installation Number]]></item>
- <item name="wcf.global.configureDB.number.description"><![CDATA[The installation number allows you to install multiple installations of this software into the same database. If this is your first installation in this database, you should enter <em>1</em>.]]></item>
<item name="wcf.global.configureDB.error"><![CDATA[An error has occurred while trying to connect to your database:
<br><strong>{$exception->getMessage()}{if $exception->getPrevious()}<br>{$exception->getPrevious()->getMessage()}{/if}</strong>]]></item>
- <item name="wcf.global.configureDB.conflictedTables"><![CDATA[The following table{if $conflictedTables|count > 1}s{/if} already exist{if $conflictedTables|count == 1}s{/if} within your “{$dbName}” Database:<br>{implode from=$conflictedTables item="table"}{$table}{/implode}.<br><br>To solve this problem, please do one of the following:<br>1. Remove the table{if $conflictedTables|count > 1}s{/if} manually and continue the installation with the “Next” button or<br>2. You re-enter the database access information, but to a different database and continue the installation with the “Next” button or<br>3. Enter a new installation number, not forgetting to continue the installation with the “Next” Button.]]></item>
+ <item name="wcf.global.configureDB.conflictedTables"><![CDATA[The following table{if $conflictedTables|count > 1}s{/if} already exist{if $conflictedTables|count == 1}s{/if} within your “{$dbName}” Database:<br>{implode from=$conflictedTables item="table"}{$table}{/implode}.<br><br>To solve this problem, please do one of the following:<br>1. Remove the table{if $conflictedTables|count > 1}s{/if} manually and continue the installation with the “Next” button or<br>2. You re-enter the database access information, but to a different database and continue the installation with the “Next” button.]]></item>
<item name="wcf.global.createUser"><![CDATA[Create an Administrator]]></item>
<item name="wcf.global.createUser.description"><![CDATA[The installation will now generate an administrator account for you. Please provide username, email address and password.]]></item>
<item name="wcf.global.createUser.username"><![CDATA[Username]]></item>
<small>{lang}wcf.global.configureDB.database.description{/lang}</small>
</dd>
</dl>
-
- <dl>
- <dt><label for="dbNumber">{lang}wcf.global.configureDB.number{/lang}</label></dt>
- <dd>
- <input type="number" id="dbNumber" name="dbNumber" value="{$dbNumber}" required min="1" class="short">
- <small>{lang}wcf.global.configureDB.number.description{/lang}</small>
- </dd>
- </dl>
</section>
<div class="formSubmit">