crm-summit/public/index.php

60 lines
1.7 KiB
PHP
Raw Normal View History

2024-04-24 13:20:52 +07:00
<?php
2025-08-15 11:38:41 +07:00
use CodeIgniter\Boot;
use Config\Paths;
/*
*---------------------------------------------------------------
* CHECK PHP VERSION
*---------------------------------------------------------------
*/
$minPhpVersion = '8.1'; // If you update this, don't forget to update `spark`.
2024-04-24 13:20:52 +07: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-08-15 11:38:41 +07:00
PHP_VERSION,
2024-04-24 13:20:52 +07:00
);
2025-08-15 11:38:41 +07:00
header('HTTP/1.1 503 Service Unavailable.', true, 503);
echo $message;
exit(1);
2024-04-24 13:20:52 +07:00
}
2025-08-15 11:38:41 +07:00
/*
*---------------------------------------------------------------
* SET THE CURRENT DIRECTORY
*---------------------------------------------------------------
*/
2024-04-24 13:20:52 +07:00
// Path to the front controller (this file)
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR);
// Ensure the current directory is pointing to the front controller's directory
2025-08-15 11:38:41 +07:00
if (getcwd() . DIRECTORY_SEPARATOR !== FCPATH) {
chdir(FCPATH);
}
2024-04-24 13:20:52 +07: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.
*/
2025-08-15 11:38:41 +07:00
// LOAD OUR PATHS CONFIG FILE
2024-04-24 13:20:52 +07:00
// This is the line that might need to be changed, depending on your folder structure.
require FCPATH . '../app/Config/Paths.php';
// ^^^ Change this line if you move your application folder
2025-08-15 11:38:41 +07:00
$paths = new Paths();
2024-04-24 13:20:52 +07:00
2025-08-15 11:38:41 +07:00
// LOAD THE FRAMEWORK BOOTSTRAP FILE
require $paths->systemDirectory . '/Boot.php';
2024-04-24 13:20:52 +07:00
2025-08-15 11:38:41 +07:00
exit(Boot::bootWeb($paths));