index.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. use CodeIgniter\Boot;
  3. use Config\Paths;
  4. /*
  5. *---------------------------------------------------------------
  6. * CHECK PHP VERSION
  7. *---------------------------------------------------------------
  8. */
  9. $minPhpVersion = '8.2'; // If you update this, don't forget to update `spark`.
  10. if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
  11. $message = sprintf(
  12. 'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s',
  13. $minPhpVersion,
  14. PHP_VERSION,
  15. );
  16. header('HTTP/1.1 503 Service Unavailable.', true, 503);
  17. echo $message;
  18. exit(1);
  19. }
  20. /*
  21. *---------------------------------------------------------------
  22. * SET THE CURRENT DIRECTORY
  23. *---------------------------------------------------------------
  24. */
  25. // Path to the front controller (this file)
  26. define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR);
  27. // Ensure the current directory is pointing to the front controller's directory
  28. if (getcwd() . DIRECTORY_SEPARATOR !== FCPATH) {
  29. chdir(FCPATH);
  30. }
  31. /*
  32. *---------------------------------------------------------------
  33. * BOOTSTRAP THE APPLICATION
  34. *---------------------------------------------------------------
  35. * This process sets up the path constants, loads and registers
  36. * our autoloader, along with Composer's, loads our constants
  37. * and fires up an environment-specific bootstrapping.
  38. */
  39. // LOAD OUR PATHS CONFIG FILE
  40. // This is the line that might need to be changed, depending on your folder structure.
  41. require FCPATH . '../app/Config/Paths.php';
  42. // ^^^ Change this line if you move your application folder
  43. $paths = new Paths();
  44. // LOAD THE FRAMEWORK BOOTSTRAP FILE
  45. require $paths->systemDirectory . '/Boot.php';
  46. exit(Boot::bootWeb($paths));