File tree 6 files changed +126
-113
lines changed
6 files changed +126
-113
lines changed Original file line number Diff line number Diff line change 9
9
|
10
10
| If you set 'display_errors' to '1', CI4's detailed error report will show.
11
11
*/
12
+ error_reporting (E_ALL & ~E_DEPRECATED );
13
+ // If you want to suppress more types of errors.
14
+ // error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
12
15
ini_set ('display_errors ' , '0 ' );
13
- error_reporting (E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED );
14
16
15
17
/*
16
18
|--------------------------------------------------------------------------
Original file line number Diff line number Diff line change 46
46
47
47
$ paths = new App \Config \Paths ();
48
48
49
- // Location of the framework bootstrap file.
50
- require rtrim ($ paths ->systemDirectory , '\\/ ' ) . DIRECTORY_SEPARATOR . 'bootstrap.php ' ;
51
-
52
- // Load environment settings from .env files into $_SERVER and $_ENV
53
- require_once SYSTEMPATH . 'Config/DotEnv.php ' ;
54
- (new DotEnv (ROOTPATH ))->load ();
55
-
56
49
// Define ENVIRONMENT
57
50
if (! defined ('ENVIRONMENT ' )) {
58
- define ('ENVIRONMENT ' , env ('CI_ENVIRONMENT ' , 'production ' ));
51
+ // @phpstan-ignore-next-line
52
+ $ env = $ _ENV ['CI_ENVIRONMENT ' ] ?? $ _SERVER ['CI_ENVIRONMENT ' ]
53
+ ?? getenv ('CI_ENVIRONMENT ' )
54
+ ?: 'production ' ;
55
+
56
+ define ('ENVIRONMENT ' , $ env );
59
57
}
60
58
59
+ // Location of the framework bootstrap file.
60
+ require rtrim ($ paths ->systemDirectory , '\\/ ' ) . DIRECTORY_SEPARATOR . 'bootstrap.php ' ;
61
+
61
62
// Load Config Cache
62
63
// $factoriesCache = new \CodeIgniter\Cache\FactoriesCache();
63
64
// $factoriesCache->load('config');
Original file line number Diff line number Diff line change 38
38
$ benchmark ->start ('total_execution ' );
39
39
$ benchmark ->start ('bootstrap ' );
40
40
41
- /*
42
- * ------------------------------------------------------
43
- * Load any environment-specific settings from .env file
44
- * ------------------------------------------------------
45
- */
46
- if (is_file (APPPATH . 'config/Boot/ ' . ENVIRONMENT . '.php ' )) {
47
- require_once APPPATH . 'config/Boot/ ' . ENVIRONMENT . '.php ' ;
48
- } else {
49
- // @codeCoverageIgnoreStart{
50
- header ('HTTP/1.1 503 Service Unavailable. ' , true , 503 );
51
- echo 'The application environment is not set correctly. ' ;
52
-
53
- exit (EXIT_ERROR ); // EXIT_ERROR
54
- // @codeCoverageIgnoreEnd
55
- }
56
-
57
41
//--------------------------------------------------------------------
58
42
// CSRF Protection
59
43
//--------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -315,7 +315,7 @@ public static function routes($getShared = false)
315
315
* The Router class uses a RouteCollection's array of routes, and determines
316
316
* the correct Controller and Method to execute.
317
317
*/
318
- public static function router (RouteCollectionInterface $ routes = null , bool $ getShared = false )
318
+ public static function router (? RouteCollectionInterface $ routes = null , bool $ getShared = false )
319
319
{
320
320
if ($ getShared === true )
321
321
{
You can’t perform that action at this time.
0 commit comments