Skip to content

Commit

Permalink
Merge pull request #23 from poppabear8883/dev
Browse files Browse the repository at this point in the history
Release 1.0-Beta.7
  • Loading branch information
poppabear8883 authored Sep 9, 2018
2 parents 1363366 + a802960 commit 0e20dcb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/Installer/Database/MySqlSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public function handle()
* Critical
*/
$this->process([
"mysql -e \"CREATE database $db\"",
"mysql -e \"DROP USER IF EXISTS $dbuser\"",
"mysql -e \"DROP DATABASE IF EXISTS $db\"",
"mysql -e \"CREATE DATABASE $db\"",
"mysql -e \"CREATE USER '$dbuser'@'localhost' IDENTIFIED BY '$dbpass';\"",
"mysql -e \"GRANT ALL PRIVILEGES ON $db . * TO '$dbuser'@'localhost'\"",
"mysql -e \"UPDATE mysql.user SET authentication_string=PASSWORD('$root_pass') WHERE User='root'\"",
Expand Down
14 changes: 7 additions & 7 deletions src/Installer/Server/ServerSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected function server()
$this->config->app('server_name', trim($server_name));

do {
$hostname = $this->question('The FQDN for this server', fqdn());
$hostname = strtolower($this->question('The FQDN for this server', fqdn()));

$valid = (str_contains($hostname, '.') || $hostname === 'localhost');

Expand Down Expand Up @@ -83,17 +83,17 @@ protected function database()
$driver = $this->io->choice('Choose a database driver', $driver_choices, $default_driver);
$this->config->app('database_driver', $driver);

$this->io->writeln('<fg=red>It is STRONGLY advised to set a Database Server Password.</>');
$mysql_pass = $this->question('Database Server Password', '');
$this->config->app('dbrootpass', $mysql_pass);
$this->io->writeln('<fg=red>It is STRONGLY advised to set a DB Server Root Password.</>');
$db_root_pass = $this->question('DB Server Root Password', '');
$this->config->app('dbrootpass', $db_root_pass);

$db = $this->question('Database Name', 'unit3d');
$db = $this->question('UNIT3D DB Name', 'unit3d');
$this->config->app('db', $db);

$dbuser = $this->question('Database User', 'unit3d');
$dbuser = $this->question('UNIT3D DB User', 'unit3d');
$this->config->app('dbuser', $dbuser);

$dbpass = $this->question('Database Password', '');
$dbpass = $this->question('UNIT3D DB Password', '');
$this->config->app('dbpass', $dbpass);
}

Expand Down
1 change: 0 additions & 1 deletion src/Installer/UNIT3D/Unit3dSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ protected function env()
[
'{{FQDN}}' => $this->config->app('hostname'),
'{{DBDRIVER}}' => strtolower($this->config->app('database_driver')),
'{{DBPORT}}' => $this->config->app('dbpass'),
'{{DB}}' => $this->config->app('db'),
'{{DBUSER}}' => $this->config->app('dbuser'),
'{{DBPASS}}' => $this->config->app('dbpass'),
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/.env.stub
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LOG_CHANNEL=daily

DB_CONNECTION={{DBDRIVER}}
DB_HOST=127.0.0.1
DB_PORT={{DBPORT}}
DB_PORT=3306
DB_DATABASE={{DB}}
DB_USERNAME={{DBUSER}}
DB_PASSWORD={{DBPASS}}
Expand Down

0 comments on commit 0e20dcb

Please sign in to comment.