|
11 | 11 | date_default_timezone_set('Asia/Shanghai'); |
12 | 12 |
|
13 | 13 | spl_autoload_register(static function ($class): void { |
14 | | - $file = null; |
| 14 | + $file = ''; |
15 | 15 |
|
16 | | - if (0 === strpos($class, 'Inhere\Console\Examples\\')) { |
17 | | - $path = str_replace('\\', '/', substr($class, strlen('Inhere\Console\Examples\\'))); |
18 | | - $file = dirname(__DIR__) . "/examples/{$path}.php"; |
19 | | - } elseif (0 === strpos($class, 'Inhere\ConsoleTest\\')) { |
20 | | - $path = str_replace('\\', '/', substr($class, strlen('Inhere\ConsoleTest\\'))); |
| 16 | + if (0 === strpos($class, 'Toolkit\Stdlib\Example\\')) { |
| 17 | + $path = str_replace('\\', '/', substr($class, strlen('Toolkit\Stdlib\Example\\'))); |
| 18 | + $file = dirname(__DIR__) . "/example/{$path}.php"; |
| 19 | + } elseif (0 === strpos($class, 'Toolkit\StdlibTest\\')) { |
| 20 | + $path = str_replace('\\', '/', substr($class, strlen('Toolkit\StdlibTest\\'))); |
21 | 21 | $file = __DIR__ . "/{$path}.php"; |
22 | | - } elseif (0 === strpos($class, 'Inhere\Console\\')) { |
23 | | - $path = str_replace('\\', '/', substr($class, strlen('Inhere\Console\\'))); |
| 22 | + } elseif (0 === strpos($class, 'Toolkit\Stdlib\\')) { |
| 23 | + $path = str_replace('\\', '/', substr($class, strlen('Toolkit\Stdlib\\'))); |
24 | 24 | $file = dirname(__DIR__) . "/src/{$path}.php"; |
25 | 25 | } |
26 | 26 |
|
|
0 commit comments