12
12
13
13
/*
14
14
* --------------------------------------------------------------------
15
- * CodeIgniter command-line tools
15
+ * CODEIGNITER COMMAND-LINE TOOLS
16
16
* --------------------------------------------------------------------
17
17
* The main entry point into the CLI system and allows you to run
18
18
* 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
+ *---------------------------------------------------------------
22
25
*/
23
26
24
27
// Refuse to run when called from php-cgi
25
28
if (strpos (PHP_SAPI , 'cgi ' ) === 0 ) {
26
29
exit ("The cli tool is not supported when running php-cgi. It needs php-cli to function! \n\n" );
27
30
}
28
31
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`.
31
39
if (version_compare (PHP_VERSION , $ minPhpVersion , '< ' )) {
32
40
$ message = sprintf (
33
41
'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s ' ,
@@ -42,12 +50,11 @@ if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
42
50
error_reporting (E_ALL );
43
51
ini_set ('display_errors ' , '1 ' );
44
52
45
- /**
46
- * @var bool
47
- *
48
- * @deprecated No longer in use. `CodeIgniter` has `$context` property.
53
+ /*
54
+ *---------------------------------------------------------------
55
+ * SET THE CURRENT DIRECTORY
56
+ *---------------------------------------------------------------
49
57
*/
50
- define ('SPARKED ' , true );
51
58
52
59
// Path to the front controller
53
60
define ('FCPATH ' , __DIR__ . DIRECTORY_SEPARATOR . 'public ' . DIRECTORY_SEPARATOR );
@@ -64,41 +71,14 @@ chdir(FCPATH);
64
71
* and fires up an environment-specific bootstrapping.
65
72
*/
66
73
67
- // Load our paths config file
74
+ // LOAD OUR PATHS CONFIG FILE
68
75
// This is the line that might need to be changed, depending on your folder structure.
69
76
require FCPATH . '../app/Config/Paths.php ' ;
70
77
// ^^^ Change this line if you move your application folder
71
78
72
79
$ paths = new Config \Paths ();
73
80
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 ' ;
103
83
104
- exit (is_int ( $ exit ) ? $ exit : EXIT_SUCCESS );
84
+ exit (CodeIgniter \Boot:: bootSpark ( $ paths ) );
0 commit comments