2020-05-27 18:46:16 +02:00
|
|
|
<?php
|
|
|
|
|
2021-06-08 09:52:11 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2024-04-26 09:26:22 +00:00
|
|
|
use CodeIgniter\Boot;
|
2021-05-14 17:59:35 +00:00
|
|
|
use Config\Paths;
|
|
|
|
|
2024-04-26 09:26:22 +00:00
|
|
|
/*
|
|
|
|
*---------------------------------------------------------------
|
|
|
|
* CHECK PHP VERSION
|
|
|
|
*---------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2025-03-01 13:08:00 +00:00
|
|
|
$minPhpVersion = '8.4'; // If you update this, don't forget to update `spark`.
|
2022-10-16 10:36:54 +00:00
|
|
|
if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
|
|
|
|
$message = sprintf(
|
|
|
|
'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s',
|
|
|
|
$minPhpVersion,
|
2025-03-01 13:08:00 +00:00
|
|
|
PHP_VERSION,
|
2022-10-16 10:36:54 +00:00
|
|
|
);
|
|
|
|
|
2024-04-26 09:26:22 +00:00
|
|
|
header('HTTP/1.1 503 Service Unavailable.', true, 503);
|
|
|
|
echo $message;
|
|
|
|
|
|
|
|
exit(1);
|
2022-10-16 10:36:54 +00:00
|
|
|
}
|
|
|
|
|
2024-04-26 09:26:22 +00:00
|
|
|
/*
|
|
|
|
*---------------------------------------------------------------
|
|
|
|
* SET THE CURRENT DIRECTORY
|
|
|
|
*---------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2020-05-27 18:46:16 +02:00
|
|
|
// Path to the front controller (this file)
|
|
|
|
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR);
|
|
|
|
|
2022-06-13 16:30:34 +00:00
|
|
|
// Ensure the current directory is pointing to the front controller's directory
|
2023-08-27 13:26:06 +00:00
|
|
|
if (getcwd() . DIRECTORY_SEPARATOR !== FCPATH) {
|
|
|
|
chdir(FCPATH);
|
|
|
|
}
|
2022-06-13 16:30:34 +00:00
|
|
|
|
2020-05-27 18:46:16 +02:00
|
|
|
/*
|
|
|
|
*---------------------------------------------------------------
|
|
|
|
* BOOTSTRAP THE APPLICATION
|
|
|
|
*---------------------------------------------------------------
|
|
|
|
* This process sets up the path constants, loads and registers
|
|
|
|
* our autoloader, along with Composer's, loads our constants
|
|
|
|
* and fires up an environment-specific bootstrapping.
|
|
|
|
*/
|
|
|
|
|
2024-04-26 09:26:22 +00:00
|
|
|
// LOAD OUR PATHS CONFIG FILE
|
2021-04-02 17:20:02 +00:00
|
|
|
// This is the line that might need to be changed, depending on your folder structure.
|
2022-06-13 16:30:34 +00:00
|
|
|
require FCPATH . '../app/Config/Paths.php';
|
|
|
|
// ^^^ Change this line if you move your application folder
|
2021-04-02 17:20:02 +00:00
|
|
|
|
2021-05-14 17:59:35 +00:00
|
|
|
$paths = new Paths();
|
2020-05-27 18:46:16 +02:00
|
|
|
|
2024-04-26 09:26:22 +00:00
|
|
|
// LOAD THE FRAMEWORK BOOTSTRAP FILE
|
|
|
|
require $paths->systemDirectory . '/Boot.php';
|
2023-08-27 13:26:06 +00:00
|
|
|
|
2024-04-26 09:26:22 +00:00
|
|
|
exit(Boot::bootWeb($paths));
|