mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 12:25:57 +08:00
Don't require database password confirmation
This commit is contained in:
parent
b30004a9d4
commit
d549e26a4b
@ -54,13 +54,12 @@ class InstallAction extends Action
|
||||
$data = new DefaultData;
|
||||
|
||||
$data->setDatabaseConfiguration([
|
||||
'driver' => 'mysql',
|
||||
'host' => array_get($input, 'mysqlHost'),
|
||||
'database' => array_get($input, 'mysqlDatabase'),
|
||||
'username' => array_get($input, 'mysqlUsername'),
|
||||
'password' => array_get($input, 'mysqlPassword'),
|
||||
'password_confirmation' => array_get($input, 'mysqlPasswordConfirmation'),
|
||||
'prefix' => array_get($input, 'tablePrefix'),
|
||||
'driver' => 'mysql',
|
||||
'host' => array_get($input, 'mysqlHost'),
|
||||
'database' => array_get($input, 'mysqlDatabase'),
|
||||
'username' => array_get($input, 'mysqlUsername'),
|
||||
'password' => array_get($input, 'mysqlPassword'),
|
||||
'prefix' => array_get($input, 'tablePrefix'),
|
||||
]);
|
||||
|
||||
$data->setAdminUser([
|
||||
|
@ -37,13 +37,12 @@ class DataFromUser implements ProvidesData
|
||||
public function getDatabaseConfiguration()
|
||||
{
|
||||
return [
|
||||
'driver' => 'mysql',
|
||||
'host' => $this->ask('Database host:'),
|
||||
'database' => $this->ask('Database name:'),
|
||||
'username' => $this->ask('Database user:'),
|
||||
'password' => $this->secret('Database password:'),
|
||||
'password_confirmation' => $this->secret('Database password (confirmation):'),
|
||||
'prefix' => $this->ask('Prefix:'),
|
||||
'driver' => 'mysql',
|
||||
'host' => $this->ask('Database host:'),
|
||||
'database' => $this->ask('Database name:'),
|
||||
'username' => $this->ask('Database user:'),
|
||||
'password' => $this->secret('Database password:'),
|
||||
'prefix' => $this->ask('Prefix:'),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -13,13 +13,12 @@ namespace Flarum\Install\Console;
|
||||
class DefaultData implements ProvidesData
|
||||
{
|
||||
protected $databaseConfiguration = [
|
||||
'driver' => 'mysql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'flarum',
|
||||
'username' => 'root',
|
||||
'password' => 'root',
|
||||
'password_confirmation' => 'root',
|
||||
'prefix' => '',
|
||||
'driver' => 'mysql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'flarum',
|
||||
'username' => 'root',
|
||||
'password' => 'root',
|
||||
'prefix' => '',
|
||||
];
|
||||
|
||||
protected $baseUrl = 'http://flarum.dev';
|
||||
|
@ -129,10 +129,6 @@ class InstallCommand extends Command
|
||||
{
|
||||
$dbConfig = $this->dataSource->getDatabaseConfiguration();
|
||||
|
||||
if ($dbConfig['password'] !== $dbConfig['password_confirmation']) {
|
||||
throw new Exception('The password did not match it\'s confirmation.');
|
||||
}
|
||||
|
||||
$config = [
|
||||
'debug' => true,
|
||||
'database' => [
|
||||
@ -253,7 +249,7 @@ class InstallCommand extends Command
|
||||
$admin = $this->dataSource->getAdminUser();
|
||||
|
||||
if ($admin['password'] !== $admin['password_confirmation']) {
|
||||
throw new Exception('The password did not match it\'s confirmation.');
|
||||
throw new Exception('The password did not match its confirmation.');
|
||||
}
|
||||
|
||||
$this->info('Creating admin user '.$admin['username']);
|
||||
|
@ -31,9 +31,8 @@
|
||||
<div class="FormField">
|
||||
<label>MySQL Password</label>
|
||||
<input type="password" name="mysqlPassword">
|
||||
<input type="password" name="mysqlPasswordConfirmation">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="FormField">
|
||||
<label>Table Prefix</label>
|
||||
<input type="text" name="tablePrefix">
|
||||
@ -54,6 +53,10 @@
|
||||
<div class="FormField">
|
||||
<label>Admin Password</label>
|
||||
<input type="password" name="adminPassword">
|
||||
</div>
|
||||
|
||||
<div class="FormField">
|
||||
<label>Confirm Password</label>
|
||||
<input type="password" name="adminPasswordConfirmation">
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user