2929// Path to the front controller
3030define ('FCPATH ' , __DIR__ . DIRECTORY_SEPARATOR . 'public ' . DIRECTORY_SEPARATOR );
3131
32- /**
33- * See https://www.php.net/manual/en/function.str-contains.php#126277
34- */
35- if (! function_exists ('str_contains ' )) {
36- /**
37- * Polyfill of str_contains()
38- */
39- function str_contains (string $ haystack , string $ needle ): bool
40- {
41- return empty ($ needle ) || strpos ($ haystack , $ needle ) !== false ;
42- }
43- }
44-
4532class preload
4633{
4734 /**
@@ -51,6 +38,7 @@ class preload
5138 [
5239 'include ' => __DIR__ . '/vendor/codeigniter4/framework/system ' , // Change this path if using manual installation
5340 'exclude ' => [
41+ '/system/bootstrap.php ' ,
5442 // Not needed if you don't use them.
5543 '/system/Database/OCI8/ ' ,
5644 '/system/Database/Postgre/ ' ,
@@ -77,16 +65,18 @@ public function __construct()
7765 $ this ->loadAutoloader ();
7866 }
7967
80- private function loadAutoloader ()
68+ private function loadAutoloader (): void
8169 {
8270 $ paths = new Config \Paths ();
83- require rtrim ($ paths ->systemDirectory , '\\/ ' ) . DIRECTORY_SEPARATOR . 'bootstrap.php ' ;
71+ require rtrim ($ paths ->systemDirectory , '\\/ ' ) . DIRECTORY_SEPARATOR . 'Boot.php ' ;
72+
73+ CodeIgniter \Boot::preload ($ paths );
8474 }
8575
8676 /**
8777 * Load PHP files.
8878 */
89- public function load ()
79+ public function load (): void
9080 {
9181 foreach ($ this ->paths as $ path ) {
9282 $ directory = new RecursiveDirectoryIterator ($ path ['include ' ]);
0 commit comments