Path: blob/1.0-develop/app/Console/Commands/Overrides/KeyGenerateCommand.php
7460 views
<?php12namespace Pterodactyl\Console\Commands\Overrides;34use Illuminate\Foundation\Console\KeyGenerateCommand as BaseKeyGenerateCommand;56class KeyGenerateCommand extends BaseKeyGenerateCommand7{8/**9* Override the default Laravel key generation command to throw a warning to the user10* if it appears that they have already generated an application encryption key.11*/12public function handle()13{14if (!empty(config('app.key')) && $this->input->isInteractive()) {15$this->output->warning('It appears you have already configured an application encryption key. Continuing with this process with overwrite that key and cause data corruption for any existing encrypted data. DO NOT CONTINUE UNLESS YOU KNOW WHAT YOU ARE DOING.');16if (!$this->confirm('I understand the consequences of performing this command and accept all responsibility for the loss of encrypted data.')) {17return;18}1920if (!$this->confirm('Are you sure you wish to continue? Changing the application encryption key WILL CAUSE DATA LOSS.')) {21return;22}23}2425parent::handle();26}27}282930