From a2a9b6c11886735d2fd1ca5798a0ad6a43582b59 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 7 May 2022 13:51:40 +0900 Subject: [PATCH] refactor: remove variables --- public/index.php | 14 ++++---------- spark | 14 ++++---------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/public/index.php b/public/index.php index 973433c70882..33601ff9b1b1 100644 --- a/public/index.php +++ b/public/index.php @@ -15,25 +15,19 @@ // Ensure the current directory is pointing to the front controller's directory chdir(FCPATH); +// Load our paths config file // This is the line that might need to be changed, depending on your folder structure. -$pathsConfig = FCPATH . '../app/Config/Paths.php'; +require FCPATH . '../app/Config/Paths.php'; // ^^^ Change this line if you move your application folder -// Load our paths config file -require $pathsConfig; - $paths = new Config\Paths(); // Location of the framework bootstrap file. -$bootstrap = rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php'; - -require $bootstrap; +require rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php'; // Load environment settings from .env files into $_SERVER and $_ENV require_once SYSTEMPATH . 'Config/DotEnv.php'; - -$env = new CodeIgniter\Config\DotEnv(ROOTPATH); -$env->load(); +(new CodeIgniter\Config\DotEnv(ROOTPATH))->load(); /* * --------------------------------------------------------------- diff --git a/spark b/spark index cb1ee1bd65c9..fd453e84ce25 100755 --- a/spark +++ b/spark @@ -52,25 +52,19 @@ define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR) // Ensure the current directory is pointing to the front controller's directory chdir(FCPATH); +// Load our paths config file // This is the line that might need to be changed, depending on your folder structure. -$pathsConfig = FCPATH . '../app/Config/Paths.php'; +require FCPATH . '../app/Config/Paths.php'; // ^^^ Change this line if you move your application folder -// Load our paths config file -require $pathsConfig; - $paths = new Config\Paths(); // Location of the framework bootstrap file. -$bootstrap = rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php'; - -require $bootstrap; +require rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php'; // Load environment settings from .env files into $_SERVER and $_ENV require_once SYSTEMPATH . 'Config/DotEnv.php'; - -$env = new CodeIgniter\Config\DotEnv(ROOTPATH); -$env->load(); +(new CodeIgniter\Config\DotEnv(ROOTPATH))->load(); $app = Config\Services::codeigniter(); $app->initialize();