From ba3f62f79a24b1df8a5c1ef76504c55ad24a6b70 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 17 Feb 2012 09:00:53 -0600 Subject: [PATCH] added auto_key config option. --- application/config/application.php | 6 ++++++ laravel/laravel.php | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/application/config/application.php b/application/config/application.php index d81b4221..bb3f95a9 100644 --- a/application/config/application.php +++ b/application/config/application.php @@ -38,10 +38,16 @@ | remain secret and should not be shared with anyone. Make it about 32 | characters of random gibberish. | + | The "auto_key" option tells Laravel to automatically set this key value + | if one has not already been set. This is generally done on the first + | request to the Laravel splash screen. + | */ 'key' => '', + 'auto_key' => true, + /* |-------------------------------------------------------------------------- | Application Character Encoding diff --git a/laravel/laravel.php b/laravel/laravel.php index b5cec3c5..e6c23ce3 100644 --- a/laravel/laravel.php +++ b/laravel/laravel.php @@ -57,7 +57,9 @@ * string for the developer. This provides the developer with * a zero configuration install process. */ -if (Config::get('application.key') == '') +$auto_key = Config::get('application.auto_key'); + +if ($auto_key and Config::get('application.key') == '') { ob_start() and with(new CLI\Tasks\Key)->generate();