2018-01-03 11:00:46 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
|
2018-03-20 09:50:40 +08:00
|
|
|
use App\Console\Command;
|
2018-01-03 11:00:46 +08:00
|
|
|
|
2018-03-20 09:50:40 +08:00
|
|
|
class ImportFromClassic extends Command
|
2018-01-03 11:00:46 +08:00
|
|
|
{
|
2018-01-04 05:41:21 +08:00
|
|
|
protected $signature = 'phpvms:importer {db_host} {db_name} {db_user} {db_pass?} {table_prefix=phpvms_}';
|
2018-01-03 11:00:46 +08:00
|
|
|
protected $description = 'Import from an older version of phpVMS';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Run dev related commands
|
|
|
|
*/
|
|
|
|
public function handle()
|
|
|
|
{
|
|
|
|
$db_creds = [
|
2018-03-20 09:50:40 +08:00
|
|
|
'host' => $this->argument('db_host'),
|
|
|
|
'name' => $this->argument('db_name'),
|
|
|
|
'user' => $this->argument('db_user'),
|
|
|
|
'pass' => $this->argument('db_pass'),
|
2018-08-27 00:40:04 +08:00
|
|
|
'table_prefix' => $this->argument('table_prefix'),
|
2018-01-03 11:00:46 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
$importerSvc = new \App\Console\Services\Importer($db_creds);
|
|
|
|
$importerSvc->run();
|
|
|
|
}
|
|
|
|
}
|