mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 21:49:01 +01:00
Merge pull request #1773 from CachetHQ/remove-setup-key-generate
Setup doesn't need to generate the key anymore
This commit is contained in:
commit
c315d04d5d
@ -96,11 +96,6 @@ class SetupController extends Controller
|
||||
*/
|
||||
public function getIndex()
|
||||
{
|
||||
// If we've copied the .env.example file, then we should try and reset it.
|
||||
if (strlen(Config::get('app.key')) !== 32) {
|
||||
$this->keyGenerate();
|
||||
}
|
||||
|
||||
$supportedLanguages = Request::getLanguages();
|
||||
$userLanguage = Config::get('app.locale');
|
||||
|
||||
@ -235,26 +230,4 @@ class SetupController extends Controller
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the app.key value.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function keyGenerate()
|
||||
{
|
||||
$key = str_random(32);
|
||||
|
||||
$dir = app()->environmentPath();
|
||||
$file = app()->environmentFile();
|
||||
$path = "{$dir}/{$file}";
|
||||
|
||||
(new Dotenv($dir, $file))->load();
|
||||
|
||||
file_put_contents($path, str_replace(
|
||||
Config::get('app.key'), $key, file_get_contents($path)
|
||||
));
|
||||
|
||||
Config::set('app.key', $key);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user