chore: tweak the files so that their contents are as same as possible.

This commit is contained in:
kenjis 2022-05-07 13:04:29 +09:00
parent 1adabfe043
commit b6a27dc512
No known key found for this signature in database
GPG Key ID: BD254878922AF198
2 changed files with 15 additions and 17 deletions

View File

@ -1,7 +1,5 @@
<?php
use Config\Services;
// Path to the front controller (this file)
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR);
@ -15,13 +13,13 @@ define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR);
*/
// Ensure the current directory is pointing to the front controller's directory
chdir(__DIR__);
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';
// ^^^ Change this if you move your application folder
// ^^^ Change this line if you move your application folder
// Load our paths config file
require $pathsConfig;
$paths = new Config\Paths();
@ -40,7 +38,7 @@ require $bootstrap;
* the application run, and does all of the dirty work to get
* the pieces all working together.
*/
$app = Services::codeigniter();
$app = Config\Services::codeigniter();
$app->initialize();
$context = is_cli() ? 'php-cli' : 'web';
$app->setContext($context);

22
spark
View File

@ -21,8 +21,6 @@
* this class mainly acts as a passthru to the framework itself.
*/
use Config\Services;
/**
* @var bool
*
@ -30,6 +28,9 @@ use Config\Services;
*/
define('SPARKED', true);
// Path to the front controller
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR);
/*
*---------------------------------------------------------------
* BOOTSTRAP THE APPLICATION
@ -39,30 +40,29 @@ define('SPARKED', true);
* and fires up an environment-specific bootstrapping.
*/
// Ensure the current directory is pointing to the front controller's directory
chdir(FCPATH);
// Refuse to run when called from php-cgi
if (strpos(PHP_SAPI, 'cgi') === 0) {
exit("The cli tool is not supported when running php-cgi. It needs php-cli to function!\n\n");
}
// Path to the front controller
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR);
// Load our paths config file
$pathsConfig = 'app/Config/Paths.php';
// This is the line that might need to be changed, depending on your folder structure.
$pathsConfig = 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();
// Ensure the current directory is pointing to the front controller's directory
chdir(FCPATH);
// Location of the framework bootstrap file.
$bootstrap = rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php';
require $bootstrap;
$app = Services::codeigniter();
$app = Config\Services::codeigniter();
$app->initialize();
$app->setContext('spark');