19 lines
749 B
PHP
19 lines
749 B
PHP
<?php
|
|
|
|
use Illuminate\Foundation\Inspiring;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
use App\Services\LiveSqlImportService;
|
|
|
|
Artisan::command('inspire', function () {
|
|
$this->comment(Inspiring::quote());
|
|
})->purpose('Display an inspiring quote');
|
|
|
|
Artisan::command('dewemoji:import-live-sql {path : Absolute path to dewemojiAPI_DB.sql} {--truncate : Truncate target tables first} {--batch=500 : Insert batch size}', function () {
|
|
$path = (string) $this->argument('path');
|
|
$truncate = (bool) $this->option('truncate');
|
|
$batch = (int) $this->option('batch');
|
|
|
|
$importer = app(LiveSqlImportService::class);
|
|
$importer->import($path, $truncate, $batch, $this->output);
|
|
})->purpose('Import live SQL dump into the current database');
|