File tree 3 files changed +30
-9
lines changed
3 files changed +30
-9
lines changed Original file line number Diff line number Diff line change 11
11
* the LICENSE file that was distributed with this source code.
12
12
*/
13
13
14
- require_once __DIR__ . ' /vendor/codeigniter4/framework/system/Test/bootstrap.php ' ;
14
+ use Composer \ InstalledVersions ;
15
15
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 ' ;
17
19
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 ;
22
34
}
23
35
}
36
+
37
+ throw new RuntimeException ('There is no CodeIgniter4 framework installed. ' );
Original file line number Diff line number Diff line change 23
23
},
24
24
"require" : {
25
25
"php" : " ^8.1" ,
26
- "codeigniter4/framework" : " ^4.4" ,
26
+ "composer-runtime-api" : " ^2.2" ,
27
+ "codeigniter4/codeigniter4" : " 4.5.x-dev" ,
27
28
"phpstan/phpstan" : " ^1.10"
28
29
},
29
30
"require-dev" : {
39
40
"phpunit/phpunit" : " ^10.2" ,
40
41
"rector/rector" : " ^1.0.0"
41
42
},
43
+ "repositories" : [
44
+ {
45
+ "type" : " vcs" ,
46
+ "url" : " https://github.com/codeigniter4/codeigniter4"
47
+ }
48
+ ],
42
49
"conflict" : {
43
50
"codeigniter/framework" : " *"
44
51
},
Original file line number Diff line number Diff line change 12
12
*/
13
13
14
14
use CodeIgniter \Autoloader \Autoloader ;
15
- use CodeIgniter \Autoloader \FileLocator ;
15
+ use CodeIgniter \Autoloader \FileLocatorInterface ;
16
16
use CodeIgniter \Cache \CacheInterface ;
17
17
use CodeIgniter \CLI \Commands ;
18
18
use CodeIgniter \Debug \Exceptions ;
52
52
53
53
// from CodeIgniter\Config\BaseService
54
54
assertType (Autoloader::class, single_service ('autoloader ' ));
55
- assertType (FileLocator ::class, service ('locator ' ));
55
+ assertType (FileLocatorInterface ::class, service ('locator ' ));
56
56
assertType ('null ' , service ('__callStatic ' ));
57
57
assertType ('null ' , service ('serviceExists ' ));
58
58
assertType ('null ' , service ('reset ' ));
You can’t perform that action at this time.
0 commit comments