Skip to content
This repository was archived by the owner on Jun 11, 2020. It is now read-only.

Commit 1d4dd51

Browse files
committed
bug fixed for autoload
1 parent 903c51d commit 1d4dd51

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/boot.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
spl_autoload_register(function ($class) {
1111
$file = null;
1212

13-
if (0 === strpos($class,'MyLib\File\Example\\')) {
14-
$path = str_replace('\\', '/', substr($class, strlen('MyLib\File\Example\\')));
15-
$file = dirname(__DIR__) . "/examples/{$path}.php";
16-
} elseif (0 === strpos($class,'MyLib\File\Test\\')) {
17-
$path = str_replace('\\', '/', substr($class, strlen('MyLib\File\Test\\')));
13+
if (0 === strpos($class,'MyLib\ArrUtil\Example\\')) {
14+
$path = str_replace('\\', '/', substr($class, strlen('MyLib\ArrUtil\Example\\')));
15+
$file = dirname(__DIR__) . "/example/{$path}.php";
16+
} elseif (0 === strpos($class,'MyLib\ArrUtil\Test\\')) {
17+
$path = str_replace('\\', '/', substr($class, strlen('MyLib\ArrUtil\Test\\')));
1818
$file = dirname(__DIR__) . "/{$path}.php";
19-
} elseif (0 === strpos($class,'MyLib\File\\')) {
20-
$path = str_replace('\\', '/', substr($class, strlen('MyLib\File\\')));
19+
} elseif (0 === strpos($class,'MyLib\ArrUtil\\')) {
20+
$path = str_replace('\\', '/', substr($class, strlen('MyLib\ArrUtil\\')));
2121
$file = dirname(__DIR__) . "/src/{$path}.php";
2222
}
2323

0 commit comments

Comments
 (0)