48 lines
885 B
PHP
48 lines
885 B
PHP
<?php
|
||
declare(strict_types=1);
|
||
|
||
namespace BvBeJ\Commands;
|
||
|
||
use Exception;
|
||
use Illuminate\Console\Command;
|
||
|
||
class ApolloConfigSync extends Command
|
||
{
|
||
/**
|
||
* The name and signature of the console command.
|
||
*
|
||
* @var string
|
||
*/
|
||
protected $signature = 'apollo:sync';
|
||
|
||
/**
|
||
* The console command description.
|
||
*
|
||
* @var string
|
||
*/
|
||
protected $description = '同步Apollo配置';
|
||
|
||
/**
|
||
* Create a new command instance.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function __construct()
|
||
{
|
||
parent::__construct();
|
||
}
|
||
|
||
/**
|
||
* Execute the console command.
|
||
*/
|
||
public function handle()
|
||
{
|
||
try {
|
||
app('BvBeJApollo')->updateEnv();
|
||
$this->info('Success');
|
||
} catch (Exception $exception) {
|
||
$this->error("Error:{$exception->getMessage()}");
|
||
}
|
||
}
|
||
}
|