#1 some more installer scaffolding

This commit is contained in:
Nabeel Shahzad
2017-07-13 17:52:08 -05:00
parent e596db592a
commit 0de8033c88

View File

@@ -7,7 +7,11 @@ use Illuminate\Console\Command;
class Install extends Command
{
protected $signature = 'phpvms:install {--update}';
protected $signature = 'phpvms:install
{--update}
{--airline-name?}
{--airline-code?}';
protected $description = 'Install or update phpVMS';
public function __construct()
@@ -20,7 +24,11 @@ class Install extends Command
$this->info('Installing phpVMS...');
$this->setupDatabase();
$this->initialData();
# Only run these if we're doing an initial install
if(!$this->option('update')) {
$this->initialData();
}
}
/**
@@ -34,6 +42,7 @@ class Install extends Command
$this->call('database:create');
}
$this->info('Running database migrations...');
$this->call('migrate:refresh');
# TODO: Call initial seed data, for the groups and other supporting data
@@ -44,7 +53,17 @@ class Install extends Command
*/
protected function initialData()
{
# TODO: Prompt for initial airline name
# TODO: Prompt for initial airline info
$airline_name = $this->option('airline-name');
if(!$airline_name) {
$airline_name = $this->ask('Enter your airline name');
}
$airline_code = $this->option('airline-code');
if(!$airline_code) {
$airline_code = $this->ask('Enter your airline code');
}
# TODO: Prompt for admin user/password
}
}