2018-03-10 21:18:24 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Console\Commands\Overrides;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Console\KeyGenerateCommand as BaseKeyGenerateCommand;
|
|
|
|
|
|
|
|
class KeyGenerateCommand extends BaseKeyGenerateCommand
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Override the default Laravel key generation command to throw a warning to the user
|
|
|
|
* if it appears that they have already generated an application encryption key.
|
|
|
|
*/
|
|
|
|
public function handle()
|
|
|
|
{
|
2021-01-23 20:33:34 +00:00
|
|
|
if (!empty(config('app.key')) && $this->input->isInteractive()) {
|
2018-03-10 21:18:24 +00:00
|
|
|
$this->output->warning(trans('command/messages.key.warning'));
|
2021-01-23 20:33:34 +00:00
|
|
|
if (!$this->confirm(trans('command/messages.key.confirm'))) {
|
2018-03-10 21:18:24 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-01-23 20:33:34 +00:00
|
|
|
if (!$this->confirm(trans('command/messages.key.final_confirm'))) {
|
2018-03-10 21:18:24 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
parent::handle();
|
|
|
|
}
|
|
|
|
}
|