Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/Data/ExportCommand.php
- This file was copied from src/app/Console/Commands/Data/ImportCommand.php.
<?php | <?php | ||||
namespace App\Console\Commands\Data; | namespace App\Console\Commands\Data; | ||||
use Illuminate\Console\Command; | use Illuminate\Console\Command; | ||||
class ImportCommand extends Command | class ExportCommand extends Command | ||||
{ | { | ||||
/** | /** | ||||
* The name and signature of the console command. | * The name and signature of the console command. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $signature = 'data:import'; | protected $signature = 'data:export'; | ||||
/** | /** | ||||
* The console command description. | * The console command description. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $description = 'Command description'; | protected $description = 'Export data to external sources'; | ||||
/** | |||||
* Create a new command instance. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function __construct() | |||||
{ | |||||
parent::__construct(); | |||||
} | |||||
/** | /** | ||||
* Execute the console command. | * Execute the console command. | ||||
* | * | ||||
* @return int | * @return int | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$commands = [ | $commands = [ | ||||
Import\CountriesCommand::class, | Export\BalanceCommand::class, | ||||
Import\IP4NetsCommand::class, | Export\VATCommand::class | ||||
Import\IP6NetsCommand::class | |||||
]; | ]; | ||||
foreach ($commands as $command) { | foreach ($commands as $command) { | ||||
$execution = new $command(); | $execution = new $command(); | ||||
$execution->output = $this->output; | $execution->output = $this->output; | ||||
$execution->handle(); | $execution->handle(); | ||||
} | } | ||||
return 0; | |||||
} | } | ||||
} | } |