base-php/src/Commands/ApolloConfigSync.php
2021-11-30 21:34:25 +08:00

48 lines
885 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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()}");
}
}
}