Skip to content

Commit

Permalink
Merge pull request #433 from joshbrw/bugfix/set-env-installer
Browse files Browse the repository at this point in the history
Define the warning callback on the SetAppKey
  • Loading branch information
nWidart authored Nov 11, 2017
2 parents 51c73b9 + 973fd13 commit e136cd7
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Modules/Core/Console/Installers/Scripts/SetAppKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,24 @@

use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Encryption\Encrypter;
use Modules\Core\Console\Installers\SetupScript;

class SetAppKey implements SetupScript
{
use ConfirmableTrait;

/**
* @var Application
*/
private $application;

public function __construct(Application $application)
{
$this->application = $application;
}

/**
* Fire the install script
* @param Command $command
Expand Down Expand Up @@ -90,4 +102,16 @@ protected function keyReplacementPattern()

return "/^APP_KEY{$escaped}/m";
}

/**
* Get the default confirmation callback.
*
* @return \Closure
*/
protected function getDefaultConfirmCallback(): callable
{
return function () {
return $this->application->environment() === 'production';
};
}
}

0 comments on commit e136cd7

Please sign in to comment.