diff --git a/src/Install/Console/DefaultsDataProvider.php b/src/Install/Console/DefaultsDataProvider.php index 75fe35e1e..e34235404 100644 --- a/src/Install/Console/DefaultsDataProvider.php +++ b/src/Install/Console/DefaultsDataProvider.php @@ -20,6 +20,7 @@ class DefaultsDataProvider implements DataProviderInterface 'username' => 'root', 'password' => 'root', 'prefix' => '', + 'port' => '3306', ]; protected $baseUrl = 'http://flarum.dev'; diff --git a/src/Install/Console/InstallCommand.php b/src/Install/Console/InstallCommand.php index adea81866..69c0acc68 100644 --- a/src/Install/Console/InstallCommand.php +++ b/src/Install/Console/InstallCommand.php @@ -134,7 +134,8 @@ class InstallCommand extends AbstractCommand 'host' => 'required', 'database' => 'required|string', 'username' => 'required|string', - 'prefix' => 'alpha_dash|max:10' + 'prefix' => 'alpha_dash|max:10', + 'port' => 'required|integer|min:1|max:65535', ] ); @@ -204,6 +205,7 @@ class InstallCommand extends AbstractCommand 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => $dbConfig['prefix'], + 'port' => $dbConfig['port'], 'strict' => false ], 'url' => $this->baseUrl, diff --git a/src/Install/Controller/InstallController.php b/src/Install/Controller/InstallController.php index e5a84b409..e8bc7fec1 100644 --- a/src/Install/Controller/InstallController.php +++ b/src/Install/Controller/InstallController.php @@ -59,6 +59,7 @@ class InstallController implements ControllerInterface 'username' => array_get($input, 'mysqlUsername'), 'password' => array_get($input, 'mysqlPassword'), 'prefix' => array_get($input, 'tablePrefix'), + 'port' => array_get($input, 'mysqlPort'), ]); $data->setAdminUser([ diff --git a/views/install/install.php b/views/install/install.php index 5d53cd021..aae8128c8 100644 --- a/views/install/install.php +++ b/views/install/install.php @@ -33,6 +33,11 @@ +
+ + +
+