Skip to content

Commit

Permalink
refactor: remove variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed May 17, 2022
1 parent 7880727 commit a2a9b6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
14 changes: 4 additions & 10 deletions public/index.php
Expand Up @@ -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();

/*
* ---------------------------------------------------------------
Expand Down
14 changes: 4 additions & 10 deletions spark
Expand Up @@ -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();
Expand Down

0 comments on commit a2a9b6c

Please sign in to comment.