1212
1313/*
1414 * --------------------------------------------------------------------
15- * CodeIgniter command-line tools
15+ * CODEIGNITER COMMAND-LINE TOOLS
1616 * --------------------------------------------------------------------
1717 * The main entry point into the CLI system and allows you to run
1818 * commands and perform maintenance on your application.
19- *
20- * Because CodeIgniter can handle CLI requests as just another web request
21- * this class mainly acts as a passthru to the framework itself.
19+ */
20+
21+ /*
22+ *---------------------------------------------------------------
23+ * CHECK SERVER API
24+ *---------------------------------------------------------------
2225 */
2326
2427// Refuse to run when called from php-cgi
2528if (strpos (PHP_SAPI , 'cgi ' ) === 0 ) {
2629 exit ("The cli tool is not supported when running php-cgi. It needs php-cli to function! \n\n" );
2730}
2831
29- // Check PHP version.
30- $ minPhpVersion = '7.4 ' ; // If you update this, don't forget to update `public/index.php`.
32+ /*
33+ *---------------------------------------------------------------
34+ * CHECK PHP VERSION
35+ *---------------------------------------------------------------
36+ */
37+
38+ $ minPhpVersion = '8.1 ' ; // If you update this, don't forget to update `public/index.php`.
3139if (version_compare (PHP_VERSION , $ minPhpVersion , '< ' )) {
3240 $ message = sprintf (
3341 'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s ' ,
@@ -42,12 +50,11 @@ if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
4250error_reporting (E_ALL );
4351ini_set ('display_errors ' , '1 ' );
4452
45- /**
46- * @var bool
47- *
48- * @deprecated No longer in use. `CodeIgniter` has `$context` property.
53+ /*
54+ *---------------------------------------------------------------
55+ * SET THE CURRENT DIRECTORY
56+ *---------------------------------------------------------------
4957 */
50- define ('SPARKED ' , true );
5158
5259// Path to the front controller
5360define ('FCPATH ' , __DIR__ . DIRECTORY_SEPARATOR . 'public ' . DIRECTORY_SEPARATOR );
@@ -64,41 +71,14 @@ chdir(FCPATH);
6471 * and fires up an environment-specific bootstrapping.
6572 */
6673
67- // Load our paths config file
74+ // LOAD OUR PATHS CONFIG FILE
6875// This is the line that might need to be changed, depending on your folder structure.
6976require FCPATH . '../app/Config/Paths.php ' ;
7077// ^^^ Change this line if you move your application folder
7178
7279$ paths = new Config \Paths ();
7380
74- // Location of the framework bootstrap file.
75- require rtrim ($ paths ->systemDirectory , '\\/ ' ) . DIRECTORY_SEPARATOR . 'bootstrap.php ' ;
76-
77- // Load environment settings from .env files into $_SERVER and $_ENV
78- require_once SYSTEMPATH . 'Config/DotEnv.php ' ;
79- (new CodeIgniter \Config \DotEnv (ROOTPATH ))->load ();
80-
81- // Define ENVIRONMENT
82- if (! defined ('ENVIRONMENT ' )) {
83- define ('ENVIRONMENT ' , env ('CI_ENVIRONMENT ' , 'production ' ));
84- }
85-
86- // Grab our CodeIgniter
87- $ app = Config \Services::codeigniter ();
88- $ app ->initialize ();
89-
90- // Grab our Console
91- $ console = new CodeIgniter \CLI \Console ();
92-
93- // Show basic information before we do anything else.
94- if (is_int ($ suppress = array_search ('--no-header ' , $ _SERVER ['argv ' ], true ))) {
95- unset($ _SERVER ['argv ' ][$ suppress ]); // @codeCoverageIgnore
96- $ suppress = true ;
97- }
98-
99- $ console ->showHeader ($ suppress );
100-
101- // fire off the command in the main framework.
102- $ exit = $ console ->run ();
81+ // LOAD THE FRAMEWORK BOOTSTRAP FILE
82+ require $ paths ->systemDirectory . '/Boot.php ' ;
10383
104- exit (is_int ( $ exit ) ? $ exit : EXIT_SUCCESS );
84+ exit (CodeIgniter \Boot:: bootSpark ( $ paths ) );
0 commit comments