mirror of
https://github.com/flarum/framework.git
synced 2025-01-23 03:11:01 +08:00
Remove MySQL port field from visual installer
Port can still be specified by suffixing the host with a : closes #825
This commit is contained in:
parent
34af095b2a
commit
e3a5e7eb8d
|
@ -36,11 +36,10 @@ class UserDataProvider implements DataProviderInterface
|
||||||
public function getDatabaseConfiguration()
|
public function getDatabaseConfiguration()
|
||||||
{
|
{
|
||||||
$host = $this->ask('Database host:');
|
$host = $this->ask('Database host:');
|
||||||
|
$port = '3306';
|
||||||
|
|
||||||
if (str_contains($host, ':')) {
|
if (str_contains($host, ':')) {
|
||||||
list($host, $port) = explode(':', $host, 2);
|
list($host, $port) = explode(':', $host, 2);
|
||||||
} else {
|
|
||||||
$port = $this->ask('Database port:');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -52,14 +52,21 @@ class InstallController implements ControllerInterface
|
||||||
|
|
||||||
$data = new DefaultsDataProvider;
|
$data = new DefaultsDataProvider;
|
||||||
|
|
||||||
|
$host = array_get($input, 'mysqlHost');
|
||||||
|
$port = '3306';
|
||||||
|
|
||||||
|
if (str_contains($host, ':')) {
|
||||||
|
list($host, $port) = explode(':', $host, 2);
|
||||||
|
}
|
||||||
|
|
||||||
$data->setDatabaseConfiguration([
|
$data->setDatabaseConfiguration([
|
||||||
'driver' => 'mysql',
|
'driver' => 'mysql',
|
||||||
'host' => array_get($input, 'mysqlHost'),
|
'host' => $host,
|
||||||
'database' => array_get($input, 'mysqlDatabase'),
|
'database' => array_get($input, 'mysqlDatabase'),
|
||||||
'username' => array_get($input, 'mysqlUsername'),
|
'username' => array_get($input, 'mysqlUsername'),
|
||||||
'password' => array_get($input, 'mysqlPassword'),
|
'password' => array_get($input, 'mysqlPassword'),
|
||||||
'prefix' => array_get($input, 'tablePrefix'),
|
'prefix' => array_get($input, 'tablePrefix'),
|
||||||
'port' => array_get($input, 'mysqlPort'),
|
'port' => $port,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$data->setAdminUser([
|
$data->setAdminUser([
|
||||||
|
|
|
@ -33,11 +33,6 @@
|
||||||
<input type="password" name="mysqlPassword">
|
<input type="password" name="mysqlPassword">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="FormField">
|
|
||||||
<label>MySQL Port</label>
|
|
||||||
<input type="number" name="mysqlPort">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="FormField">
|
<div class="FormField">
|
||||||
<label>Table Prefix</label>
|
<label>Table Prefix</label>
|
||||||
<input type="text" name="tablePrefix">
|
<input type="text" name="tablePrefix">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user