#1 some more installer scaffolding
This commit is contained in:
@@ -7,7 +7,11 @@ use Illuminate\Console\Command;
|
|||||||
|
|
||||||
class Install extends 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';
|
protected $description = 'Install or update phpVMS';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
@@ -20,7 +24,11 @@ class Install extends Command
|
|||||||
$this->info('Installing phpVMS...');
|
$this->info('Installing phpVMS...');
|
||||||
|
|
||||||
$this->setupDatabase();
|
$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->call('database:create');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->info('Running database migrations...');
|
||||||
$this->call('migrate:refresh');
|
$this->call('migrate:refresh');
|
||||||
|
|
||||||
# TODO: Call initial seed data, for the groups and other supporting data
|
# TODO: Call initial seed data, for the groups and other supporting data
|
||||||
@@ -44,7 +53,17 @@ class Install extends Command
|
|||||||
*/
|
*/
|
||||||
protected function initialData()
|
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
|
# TODO: Prompt for admin user/password
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user