fix environment check
This commit is contained in:
parent
aea797869b
commit
5f6f84bb4c
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Encryption\Encrypter;
|
||||
|
||||
(function () {
|
||||
function die_with_utf8_encoding($error)
|
||||
{
|
||||
@ -14,6 +16,17 @@
|
||||
);
|
||||
}
|
||||
|
||||
$envPath = __DIR__.'/../.env';
|
||||
if (!file_exists($envPath)) {
|
||||
copy(__DIR__.'/../.env.example', $envPath);
|
||||
}
|
||||
|
||||
$envFile = file_get_contents($envPath);
|
||||
if (preg_match('/APP_KEY\s*=\s*\n/', $envFile)) {
|
||||
$key = 'base64:'.base64_encode(Encrypter::generateKey('AES-256-CBC'));
|
||||
file_put_contents($envPath, preg_replace('/APP_KEY\s*=\s*/', 'APP_KEY='.$key."\n\n", $envFile));
|
||||
}
|
||||
|
||||
if (!empty(ini_get('disable_functions'))) {
|
||||
die_with_utf8_encoding(
|
||||
'[Error] Please don\'t disable any functions, which is specified in "php.ini" file.<br>'.
|
||||
|
@ -16,6 +16,15 @@ define('LARAVEL_START', microtime(true));
|
||||
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Environment Check
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
if (!file_exists(__DIR__.'/../storage/install.lock')) {
|
||||
require __DIR__.'/../bootstrap/chkenv.php';
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Turn On The Lights
|
||||
|
Loading…
Reference in New Issue
Block a user