From bafa28590375f4d1837717ae2e98b838c76f4625 Mon Sep 17 00:00:00 2001 From: printempw Date: Wed, 28 Sep 2016 18:08:16 +0800 Subject: [PATCH] update .env.example --- .env.example | 9 ++++++--- config/app.php | 2 +- config/secure.php | 2 +- setup/includes/bootstrap.php | 14 +++++--------- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.env.example b/.env.example index 80fa40f9..5855db31 100644 --- a/.env.example +++ b/.env.example @@ -24,14 +24,17 @@ DB_PASSWORD = secret # It should only contains characters, numbers and underscores. DB_PREFIX = null -# Encrypt Method for Passwords +# Encrypt Method for Passwords. # # Available values: MD5, SALTED2MD5, SHA256 PWD_METHOD = SALTED2MD5 -# Salt & App Key -# Change them to any random strings to secure your passwords & tokens +# Salt +# Change it to any random string to secure your passwords & tokens. SALT = change-it+to*what)you^like + +# App Key should be setted to any random, 32 character string, +# otherwise all the encrypted strings will not be safe. APP_KEY = NkccevHHNRoRBTdGZ4osmKnwdebrjCYw # Mail Configurations diff --git a/config/app.php b/config/app.php index a4c6473c..d71cf6fe 100644 --- a/config/app.php +++ b/config/app.php @@ -100,7 +100,7 @@ return [ | */ - 'key' => menv('APP_KEY', 'this_is_dangerous_default_key'), + 'key' => menv('APP_KEY', 'xrjmRQ/RE3B0ICoYqfWzPYizA7MPZz3fNXdnxQ7Cbcg='), 'cipher' => 'AES-256-CBC', diff --git a/config/secure.php b/config/secure.php index 0d764849..77aa58fe 100644 --- a/config/secure.php +++ b/config/secure.php @@ -10,5 +10,5 @@ return [ | */ 'cipher' => menv('PWD_METHOD', 'SALTED2MD5'), - 'salt' => menv('APP_KEY', '') + 'salt' => menv('SALT', '') ]; diff --git a/setup/includes/bootstrap.php b/setup/includes/bootstrap.php index e7063b7d..15149cc8 100644 --- a/setup/includes/bootstrap.php +++ b/setup/includes/bootstrap.php @@ -7,7 +7,7 @@ define('BASE_DIR', dirname(dirname(__DIR__))); // Set Display Errors -ini_set('display_errors', 'on'); +@ini_set('display_errors', 'on'); // Register Composer Auto Loader if (file_exists(BASE_DIR.'/vendor')) { @@ -16,10 +16,9 @@ if (file_exists(BASE_DIR.'/vendor')) { exit('错误:/vendor 文件夹不存在'); } -// Check integrity of vendor -if (!class_exists('Illuminate\Foundation\Application')) { - exit('错误:/vendor 文件夹不完整,请仔细阅读安装教程并下载完整的 vendor 包'); -} +// Register Helpers +require BASE_DIR.'/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php'; +require __DIR__."/helpers.php"; // Load dotenv Configuration if (file_exists(BASE_DIR."/.env")) { @@ -29,7 +28,7 @@ if (file_exists(BASE_DIR."/.env")) { exit('错误:.env 配置文件不存在'); } -if (!isset($_ENV['APP_KEY'])) { +if (false === menv('APP_KEY', false)) { exit('错误:.env 已过期,请重新复制一份 .env.example 并修改配置'); } @@ -85,9 +84,6 @@ $app->instance('request', $request); $app->singleton('database', App\Services\Database\Database::class); $app->singleton('option', App\Services\OptionRepository::class); -require BASE_DIR.'/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php'; -require __DIR__."/helpers.php"; - View::addExtension('tpl', 'blade'); $db_config = get_db_config();