Merge pull request #1773 from CachetHQ/remove-setup-key-generate

Setup doesn't need to generate the key anymore
This commit is contained in:
James Brooks 2016-05-08 17:47:08 +01:00
commit c315d04d5d

View File

@ -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);
}
}