Normalize Base URL during installation

- Fix base url when is appended with a script filename
- Add default base url http://flarum.local when CLI wizard used
- Remove some code duplication
- Add minor improvement to the UX when CLI wizard used
- Add tests
- Extract base url normalisation into its own value object
This commit is contained in:
Stefan Totev 2019-09-23 23:26:51 +01:00 committed by Alexander Skvortsov
parent 93d6b235e3
commit 3decf1b658

View File

@ -10,6 +10,7 @@
*/
use Flarum\Install\AdminUser;
use Flarum\Install\BaseUrl;
use Flarum\Install\DatabaseConfig;
use Flarum\Install\Installation;
@ -48,7 +49,7 @@ $installation = new Installation(
$pipeline = $installation
->configPath('config.php')
->debugMode(true)
->baseUrl('http://localhost')
->baseUrl(BaseUrl::fromString('http://localhost'))
->databaseConfig(new DatabaseConfig(
'mysql',
env('DB_HOST', 'localhost'),