mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
refactor: move DotEnv::load() from system/bootstrap.php
This commit is contained in:
parent
b6a27dc512
commit
e2e94e8f0d
@ -29,6 +29,12 @@ $bootstrap = rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'boo
|
||||
|
||||
require $bootstrap;
|
||||
|
||||
// Load environment settings from .env files into $_SERVER and $_ENV
|
||||
require_once SYSTEMPATH . 'Config/DotEnv.php';
|
||||
|
||||
$env = new CodeIgniter\Config\DotEnv(ROOTPATH);
|
||||
$env->load();
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* GRAB OUR CODEIGNITER INSTANCE
|
||||
|
6
spark
6
spark
@ -62,6 +62,12 @@ $bootstrap = rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'boo
|
||||
|
||||
require $bootstrap;
|
||||
|
||||
// Load environment settings from .env files into $_SERVER and $_ENV
|
||||
require_once SYSTEMPATH . 'Config/DotEnv.php';
|
||||
|
||||
$env = new CodeIgniter\Config\DotEnv(ROOTPATH);
|
||||
$env->load();
|
||||
|
||||
$app = Config\Services::codeigniter();
|
||||
$app->initialize();
|
||||
$app->setContext('spark');
|
||||
|
@ -9,7 +9,6 @@
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use CodeIgniter\Config\DotEnv;
|
||||
use Config\Autoload;
|
||||
use Config\Modules;
|
||||
use Config\Paths;
|
||||
@ -123,11 +122,5 @@ if (is_file(COMPOSER_PATH)) {
|
||||
require_once COMPOSER_PATH;
|
||||
}
|
||||
|
||||
// Load environment settings from .env files into $_SERVER and $_ENV
|
||||
require_once SYSTEMPATH . 'Config/DotEnv.php';
|
||||
|
||||
$env = new DotEnv(ROOTPATH);
|
||||
$env->load();
|
||||
|
||||
// Always load the URL helper, it should be used in most of apps.
|
||||
helper('url');
|
||||
|
Loading…
x
Reference in New Issue
Block a user