misc_pterodactyl-panel/app/Console/Commands/Overrides/KeyGenerateCommand.php

29 lines
848 B
PHP
Raw Normal View History

<?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()) {
$this->output->warning(trans('command/messages.key.warning'));
2021-01-23 20:33:34 +00:00
if (!$this->confirm(trans('command/messages.key.confirm'))) {
return;
}
2021-01-23 20:33:34 +00:00
if (!$this->confirm(trans('command/messages.key.final_confirm'))) {
return;
}
}
parent::handle();
}
}