File tree Expand file tree Collapse file tree 3 files changed +30
-9
lines changed Expand file tree Collapse file tree 3 files changed +30
-9
lines changed Original file line number Diff line number Diff line change 1111 * the LICENSE file that was distributed with this source code.
1212 */
1313
14- require_once __DIR__ . ' /vendor/codeigniter4/framework/system/Test/bootstrap.php ' ;
14+ use Composer \ InstalledVersions ;
1515
16- $ iterator = new RecursiveIteratorIterator (new RecursiveDirectoryIterator (__DIR__ . '/vendor/codeigniter4/framework/system/Helpers ' ));
16+ foreach (['codeigniter4/codeigniter4 ' , 'codeigniter4/framework ' ] as $ framework ) {
17+ if (InstalledVersions::isInstalled ($ framework )) {
18+ require_once __DIR__ . '/vendor/ ' . $ framework . '/system/Test/bootstrap.php ' ;
1719
18- /** @var SplFileInfo $helper */
19- foreach ($ iterator as $ helper ) {
20- if ($ helper ->isFile ()) {
21- require_once $ helper ->getRealPath ();
20+ $ iterator = new RecursiveIteratorIterator (
21+ new RecursiveDirectoryIterator (
22+ __DIR__ . '/vendor/ ' . $ framework . '/system/Helpers '
23+ )
24+ );
25+
26+ /** @var SplFileInfo $helper */
27+ foreach ($ iterator as $ helper ) {
28+ if ($ helper ->isFile ()) {
29+ require_once $ helper ->getRealPath ();
30+ }
31+ }
32+
33+ return ;
2234 }
2335}
36+
37+ throw new RuntimeException ('There is no CodeIgniter4 framework installed. ' );
Original file line number Diff line number Diff line change 2323 },
2424 "require" : {
2525 "php" : " ^8.1" ,
26- "codeigniter4/framework" : " ^4.4" ,
26+ "composer-runtime-api" : " ^2.2" ,
27+ "codeigniter4/codeigniter4" : " 4.5.x-dev" ,
2728 "phpstan/phpstan" : " ^1.10"
2829 },
2930 "require-dev" : {
3940 "phpunit/phpunit" : " ^10.2" ,
4041 "rector/rector" : " ^1.0.0"
4142 },
43+ "repositories" : [
44+ {
45+ "type" : " vcs" ,
46+ "url" : " https://github.com/codeigniter4/codeigniter4"
47+ }
48+ ],
4249 "conflict" : {
4350 "codeigniter/framework" : " *"
4451 },
Original file line number Diff line number Diff line change 1212 */
1313
1414use CodeIgniter \Autoloader \Autoloader ;
15- use CodeIgniter \Autoloader \FileLocator ;
15+ use CodeIgniter \Autoloader \FileLocatorInterface ;
1616use CodeIgniter \Cache \CacheInterface ;
1717use CodeIgniter \CLI \Commands ;
1818use CodeIgniter \Debug \Exceptions ;
5252
5353// from CodeIgniter\Config\BaseService
5454assertType (Autoloader::class, single_service ('autoloader ' ));
55- assertType (FileLocator ::class, service ('locator ' ));
55+ assertType (FileLocatorInterface ::class, service ('locator ' ));
5656assertType ('null ' , service ('__callStatic ' ));
5757assertType ('null ' , service ('serviceExists ' ));
5858assertType ('null ' , service ('reset ' ));
You can’t perform that action at this time.
0 commit comments