@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think; |
14 | 14 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | return $this->make($abstract); |
132 | 132 | } |
133 | 133 | |
134 | - throw new ClassNotFoundException('class not exists: ' . $abstract, $abstract); |
|
134 | + throw new ClassNotFoundException('class not exists: '.$abstract, $abstract); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | } else { |
302 | 302 | $function .= '()'; |
303 | 303 | } |
304 | - throw new Exception('function not exists: ' . $function, 0, $e); |
|
304 | + throw new Exception('function not exists: '.$function, 0, $e); |
|
305 | 305 | } |
306 | 306 | } |
307 | 307 | |
@@ -334,12 +334,12 @@ discard block |
||
334 | 334 | } catch (ReflectionException $e) { |
335 | 335 | if (is_array($method)) { |
336 | 336 | $class = is_object($method[0]) ? get_class($method[0]) : $method[0]; |
337 | - $callback = $class . '::' . $method[1]; |
|
337 | + $callback = $class.'::'.$method[1]; |
|
338 | 338 | } else { |
339 | 339 | $callback = $method; |
340 | 340 | } |
341 | 341 | |
342 | - throw new Exception('method not exists: ' . $callback . '()', 0, $e); |
|
342 | + throw new Exception('method not exists: '.$callback.'()', 0, $e); |
|
343 | 343 | } |
344 | 344 | } |
345 | 345 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | |
407 | 407 | return $object; |
408 | 408 | } catch (ReflectionException $e) { |
409 | - throw new ClassNotFoundException('class not exists: ' . $class, $class, $e); |
|
409 | + throw new ClassNotFoundException('class not exists: '.$class, $class, $e); |
|
410 | 410 | } |
411 | 411 | } |
412 | 412 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | } elseif ($param->isDefaultValueAvailable()) { |
468 | 468 | $args[] = $param->getDefaultValue(); |
469 | 469 | } else { |
470 | - throw new InvalidArgumentException('method param miss:' . $name); |
|
470 | + throw new InvalidArgumentException('method param miss:'.$name); |
|
471 | 471 | } |
472 | 472 | } |
473 | 473 | |
@@ -485,13 +485,13 @@ discard block |
||
485 | 485 | */ |
486 | 486 | public static function factory(string $name, string $namespace = '', ...$args) |
487 | 487 | { |
488 | - $class = false !== strpos($name, '\\') ? $name : $namespace . ucwords($name); |
|
488 | + $class = false !== strpos($name, '\\') ? $name : $namespace.ucwords($name); |
|
489 | 489 | |
490 | 490 | if (class_exists($class)) { |
491 | 491 | return Container::getInstance()->invokeClass($class, $args); |
492 | 492 | } |
493 | 493 | |
494 | - throw new ClassNotFoundException('class not exists:' . $class, $class); |
|
494 | + throw new ClassNotFoundException('class not exists:'.$class, $class); |
|
495 | 495 | } |
496 | 496 | |
497 | 497 | /** |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\route\dispatch; |
14 | 14 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if ($bind && preg_match('/^[a-z]/is', $bind)) { |
48 | 48 | $bind = str_replace('/', $depr, $bind); |
49 | 49 | // 如果有模块/控制器绑定 |
50 | - $url = $bind . ('.' != substr($bind, -1) ? $depr : '') . ltrim($url, $depr); |
|
50 | + $url = $bind.('.' != substr($bind, -1) ? $depr : '').ltrim($url, $depr); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $path = $this->rule->parseUrlPath($url); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $controller = !empty($path) ? array_shift($path) : null; |
60 | 60 | |
61 | 61 | if ($controller && !preg_match('/^[A-Za-z][\w|\.]*$/', $controller)) { |
62 | - throw new HttpException(404, 'controller not exists:' . $controller); |
|
62 | + throw new HttpException(404, 'controller not exists:'.$controller); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | // 解析操作 |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | // 解析额外参数 |
70 | 70 | if ($path) { |
71 | - preg_replace_callback('/(\w+)\|([^\|]+)/', function ($match) use (&$var) { |
|
71 | + preg_replace_callback('/(\w+)\|([^\|]+)/', function($match) use (&$var) { |
|
72 | 72 | $var[$match[1]] = strip_tags($match[2]); |
73 | 73 | }, implode('|', $path)); |
74 | 74 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $route = [$controller, $action]; |
87 | 87 | |
88 | 88 | if ($this->hasDefinedRoute($route)) { |
89 | - throw new HttpException(404, 'invalid request:' . str_replace('|', $depr, $url)); |
|
89 | + throw new HttpException(404, 'invalid request:'.str_replace('|', $depr, $url)); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | return $route; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | list($controller, $action) = $route; |
104 | 104 | |
105 | 105 | // 检查地址是否被定义过路由 |
106 | - $name = strtolower(Str::studly($controller) . '/' . $action); |
|
106 | + $name = strtolower(Str::studly($controller).'/'.$action); |
|
107 | 107 | |
108 | 108 | $host = $this->request->host(true); |
109 | 109 | $method = $this->request->method(); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\session\driver; |
14 | 14 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function read(string $sessID): string |
90 | 90 | { |
91 | - return (string) $this->handler->get($this->config['prefix'] . $sessID); |
|
91 | + return (string) $this->handler->get($this->config['prefix'].$sessID); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -101,9 +101,9 @@ discard block |
||
101 | 101 | public function write(string $sessID, string $data): bool |
102 | 102 | { |
103 | 103 | if ($this->config['expire'] > 0) { |
104 | - $result = $this->handler->setex($this->config['prefix'] . $sessID, $this->config['expire'], $data); |
|
104 | + $result = $this->handler->setex($this->config['prefix'].$sessID, $this->config['expire'], $data); |
|
105 | 105 | } else { |
106 | - $result = $this->handler->set($this->config['prefix'] . $sessID, $data); |
|
106 | + $result = $this->handler->set($this->config['prefix'].$sessID, $data); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | return $result ? true : false; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function delete(string $sessID): bool |
119 | 119 | { |
120 | - return $this->handler->del($this->config['prefix'] . $sessID) > 0; |
|
120 | + return $this->handler->del($this->config['prefix'].$sessID) > 0; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | } |
@@ -54,21 +54,21 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | if ($app) { |
57 | - $appPath = $this->app->getBasePath() . $app . DIRECTORY_SEPARATOR; |
|
58 | - $namespace = 'app\\' . $app; |
|
57 | + $appPath = $this->app->getBasePath().$app.DIRECTORY_SEPARATOR; |
|
58 | + $namespace = 'app\\'.$app; |
|
59 | 59 | } else { |
60 | 60 | $appPath = $this->app->getBasePath(); |
61 | 61 | $namespace = 'app'; |
62 | 62 | } |
63 | 63 | |
64 | - $path = $appPath . 'model'; |
|
64 | + $path = $appPath.'model'; |
|
65 | 65 | $list = is_dir($path) ? scandir($path) : []; |
66 | 66 | |
67 | 67 | foreach ($list as $file) { |
68 | 68 | if (0 === strpos($file, '.')) { |
69 | 69 | continue; |
70 | 70 | } |
71 | - $class = '\\' . $namespace . '\\model\\' . pathinfo($file, PATHINFO_FILENAME); |
|
71 | + $class = '\\'.$namespace.'\\model\\'.pathinfo($file, PATHINFO_FILENAME); |
|
72 | 72 | $this->buildModelSchema($class); |
73 | 73 | } |
74 | 74 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | return; |
77 | 77 | } |
78 | 78 | |
79 | - $db = isset($dbName) ? $dbName . '.' : ''; |
|
79 | + $db = isset($dbName) ? $dbName.'.' : ''; |
|
80 | 80 | $this->buildDataBaseSchema($schemaPath, $tables, $db); |
81 | 81 | |
82 | 82 | $output->writeln('<info>Succeed!</info>'); |
@@ -93,27 +93,27 @@ discard block |
||
93 | 93 | $table = $model->getTable(); |
94 | 94 | $dbName = $model->getConnection()->getConfig('database'); |
95 | 95 | $path = $model->getConnection()->getConfig('schema_cache_path'); |
96 | - $content = '<?php ' . PHP_EOL . 'return '; |
|
96 | + $content = '<?php '.PHP_EOL.'return '; |
|
97 | 97 | $info = $model->db()->getConnection()->getFields($table); |
98 | - $content .= var_export($info, true) . ';'; |
|
98 | + $content .= var_export($info, true).';'; |
|
99 | 99 | |
100 | - file_put_contents($path . $dbName . '.' . $table . '.php', $content); |
|
100 | + file_put_contents($path.$dbName.'.'.$table.'.php', $content); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | 104 | protected function buildDataBaseSchema(string $path, array $tables, string $db): void |
105 | 105 | { |
106 | 106 | if ('' == $db) { |
107 | - $dbName = $this->app->db->getConnection()->getConfig('database') . '.'; |
|
107 | + $dbName = $this->app->db->getConnection()->getConfig('database').'.'; |
|
108 | 108 | } else { |
109 | 109 | $dbName = $db; |
110 | 110 | } |
111 | 111 | |
112 | 112 | foreach ($tables as $table) { |
113 | - $content = '<?php ' . PHP_EOL . 'return '; |
|
114 | - $info = $this->app->db->getConnection()->getFields($db . $table); |
|
115 | - $content .= var_export($info, true) . ';'; |
|
116 | - file_put_contents($path . $dbName . $table . '.php', $content); |
|
113 | + $content = '<?php '.PHP_EOL.'return '; |
|
114 | + $info = $this->app->db->getConnection()->getFields($db.$table); |
|
115 | + $content .= var_export($info, true).';'; |
|
116 | + file_put_contents($path.$dbName.$table.'.php', $content); |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | } |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | return false; |
35 | 35 | } |
36 | 36 | |
37 | - $path = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . ($app ? $app . DIRECTORY_SEPARATOR : ''); |
|
37 | + $path = $this->app->getRootPath().'runtime'.DIRECTORY_SEPARATOR.($app ? $app.DIRECTORY_SEPARATOR : ''); |
|
38 | 38 | |
39 | - $filename = $path . 'route.php'; |
|
39 | + $filename = $path.'route.php'; |
|
40 | 40 | if (is_file($filename)) { |
41 | 41 | unlink($filename); |
42 | 42 | } |
@@ -51,21 +51,21 @@ discard block |
||
51 | 51 | $this->app->route->lazy(false); |
52 | 52 | |
53 | 53 | // 路由检测 |
54 | - $path = $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR . ($app ? $app . DIRECTORY_SEPARATOR : ''); |
|
54 | + $path = $this->app->getRootPath().'route'.DIRECTORY_SEPARATOR.($app ? $app.DIRECTORY_SEPARATOR : ''); |
|
55 | 55 | |
56 | 56 | $files = is_dir($path) ? scandir($path) : []; |
57 | 57 | |
58 | 58 | foreach ($files as $file) { |
59 | 59 | if (strpos($file, '.php')) { |
60 | - include $path . $file; |
|
60 | + include $path.$file; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | 64 | //触发路由载入完成事件 |
65 | 65 | $this->app->event->trigger(RouteLoaded::class); |
66 | 66 | |
67 | - $content = '<?php ' . PHP_EOL . 'return '; |
|
68 | - $content .= '\Opis\Closure\unserialize(\'' . \Opis\Closure\serialize($this->app->route->getName()) . '\');'; |
|
67 | + $content = '<?php '.PHP_EOL.'return '; |
|
68 | + $content .= '\Opis\Closure\unserialize(\''.\Opis\Closure\serialize($this->app->route->getName()).'\');'; |
|
69 | 69 | return $content; |
70 | 70 | } |
71 | 71 |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | if ($app) { |
51 | - $filename = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . $app . DIRECTORY_SEPARATOR . 'route_list_' . $app . '.php'; |
|
51 | + $filename = $this->app->getRootPath().'runtime'.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.'route_list_'.$app.'.php'; |
|
52 | 52 | } else { |
53 | - $filename = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . 'route_list.php'; |
|
53 | + $filename = $this->app->getRootPath().'runtime'.DIRECTORY_SEPARATOR.'route_list.php'; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | if (is_file($filename)) { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | $content = $this->getRouteList($app); |
63 | - file_put_contents($filename, 'Route List' . PHP_EOL . $content); |
|
63 | + file_put_contents($filename, 'Route List'.PHP_EOL.$content); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | protected function getRouteList(string $app = null): string |
@@ -69,16 +69,16 @@ discard block |
||
69 | 69 | $this->app->route->clear(); |
70 | 70 | |
71 | 71 | if ($app) { |
72 | - $path = $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR . $app . DIRECTORY_SEPARATOR; |
|
72 | + $path = $this->app->getRootPath().'route'.DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR; |
|
73 | 73 | } else { |
74 | - $path = $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR; |
|
74 | + $path = $this->app->getRootPath().'route'.DIRECTORY_SEPARATOR; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $files = is_dir($path) ? scandir($path) : []; |
78 | 78 | |
79 | 79 | foreach ($files as $file) { |
80 | 80 | if (strpos($file, '.php')) { |
81 | - include $path . $file; |
|
81 | + include $path.$file; |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $sort = $this->sortBy[$sort]; |
118 | 118 | } |
119 | 119 | |
120 | - uasort($rows, function ($a, $b) use ($sort) { |
|
120 | + uasort($rows, function($a, $b) use ($sort) { |
|
121 | 121 | $itemA = $a[$sort] ?? null; |
122 | 122 | $itemB = $b[$sort] ?? null; |
123 | 123 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: yunwuxin <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\console; |
14 | 14 | |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | ]; |
405 | 405 | $replacements = [ |
406 | 406 | $name, |
407 | - $_SERVER['PHP_SELF'] . ' ' . $name, |
|
407 | + $_SERVER['PHP_SELF'].' '.$name, |
|
408 | 408 | ]; |
409 | 409 | |
410 | 410 | return str_replace($placeholders, $replacements, $this->getHelp()); |
@@ -508,6 +508,6 @@ discard block |
||
508 | 508 | protected function isMultiApp(): bool |
509 | 509 | { |
510 | 510 | $autoMulti = $this->app->config->get('app.auto_multi_app', false); |
511 | - return $autoMulti || !is_dir($this->app->getBasePath() . 'controller'); |
|
511 | + return $autoMulti || !is_dir($this->app->getBasePath().'controller'); |
|
512 | 512 | } |
513 | 513 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think; |
14 | 14 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | public function __construct(App $app) |
64 | 64 | { |
65 | 65 | $this->app = $app; |
66 | - $this->multi = is_dir($this->app->getBasePath() . 'controller') ? false : true; |
|
66 | + $this->multi = is_dir($this->app->getBasePath().'controller') ? false : true; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | if (!$this->app->initialized()) { |
168 | 168 | $this->app->initialize(); |
169 | 169 | // 加载全局中间件 |
170 | - if (is_file($this->app->getBasePath() . 'middleware.php')) { |
|
171 | - $this->app->middleware->import(include $this->app->getBasePath() . 'middleware.php'); |
|
170 | + if (is_file($this->app->getBasePath().'middleware.php')) { |
|
171 | + $this->app->middleware->import(include $this->app->getBasePath().'middleware.php'); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | // 监听HttpRun |
196 | 196 | $this->app->event->trigger('HttpRun'); |
197 | 197 | |
198 | - $withRoute = $this->app->config->get('app.with_route', true) ? function () { |
|
198 | + $withRoute = $this->app->config->get('app.with_route', true) ? function() { |
|
199 | 199 | $this->loadRoutes(); |
200 | 200 | } : null; |
201 | 201 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $routePath = $this->getRoutePath(); |
214 | 214 | |
215 | 215 | if (is_dir($routePath)) { |
216 | - $files = glob($routePath . '*.php'); |
|
216 | + $files = glob($routePath.'*.php'); |
|
217 | 217 | foreach ($files as $file) { |
218 | 218 | include $file; |
219 | 219 | } |
@@ -229,11 +229,11 @@ discard block |
||
229 | 229 | */ |
230 | 230 | protected function getRoutePath(): string |
231 | 231 | { |
232 | - if ($this->isMulti() && is_dir($this->app->getAppPath() . 'route')) { |
|
233 | - return $this->app->getAppPath() . 'route' . DIRECTORY_SEPARATOR; |
|
232 | + if ($this->isMulti() && is_dir($this->app->getAppPath().'route')) { |
|
233 | + return $this->app->getAppPath().'route'.DIRECTORY_SEPARATOR; |
|
234 | 234 | } |
235 | 235 | |
236 | - return $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR . ($this->isMulti() ? $this->getName() . DIRECTORY_SEPARATOR : ''); |
|
236 | + return $this->app->getRootPath().'route'.DIRECTORY_SEPARATOR.($this->isMulti() ? $this->getName().DIRECTORY_SEPARATOR : ''); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | /** |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | $appName = $map[$name]; |
320 | 320 | } |
321 | 321 | } elseif ($name && (false !== array_search($name, $map) || in_array($name, $deny))) { |
322 | - throw new HttpException(404, 'app not exists:' . $name); |
|
322 | + throw new HttpException(404, 'app not exists:'.$name); |
|
323 | 323 | } elseif ($name && isset($map['*'])) { |
324 | 324 | $appName = $map['*']; |
325 | 325 | } else { |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | } |
328 | 328 | |
329 | 329 | if ($name) { |
330 | - $this->app->request->setRoot('/' . $name); |
|
330 | + $this->app->request->setRoot('/'.$name); |
|
331 | 331 | $this->app->request->setPathinfo(strpos($path, '/') ? ltrim(strstr($path, '/'), '/') : ''); |
332 | 332 | } |
333 | 333 | } |
@@ -347,26 +347,26 @@ discard block |
||
347 | 347 | { |
348 | 348 | $this->name = $appName; |
349 | 349 | $this->app->request->setApp($appName); |
350 | - $this->app->setAppPath($this->path ?: $this->app->getBasePath() . $appName . DIRECTORY_SEPARATOR); |
|
351 | - $this->app->setRuntimePath($this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . $appName . DIRECTORY_SEPARATOR); |
|
350 | + $this->app->setAppPath($this->path ?: $this->app->getBasePath().$appName.DIRECTORY_SEPARATOR); |
|
351 | + $this->app->setRuntimePath($this->app->getRootPath().'runtime'.DIRECTORY_SEPARATOR.$appName.DIRECTORY_SEPARATOR); |
|
352 | 352 | |
353 | 353 | //加载app文件 |
354 | 354 | if (!isset($this->register[$appName])) { |
355 | 355 | if (is_dir($this->app->getAppPath())) { |
356 | 356 | $appPath = $this->app->getAppPath(); |
357 | 357 | |
358 | - if (is_file($appPath . 'common.php')) { |
|
359 | - include_once $appPath . 'common.php'; |
|
358 | + if (is_file($appPath.'common.php')) { |
|
359 | + include_once $appPath.'common.php'; |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | $configPath = $this->app->getConfigPath(); |
363 | 363 | |
364 | 364 | $files = []; |
365 | 365 | |
366 | - if (is_dir($configPath . $appName)) { |
|
367 | - $files = array_merge($files, glob($configPath . $appName . DIRECTORY_SEPARATOR . '*' . $this->app->getConfigExt())); |
|
368 | - } elseif (is_dir($appPath . 'config')) { |
|
369 | - $files = array_merge($files, glob($appPath . 'config' . DIRECTORY_SEPARATOR . '*' . $this->app->getConfigExt())); |
|
366 | + if (is_dir($configPath.$appName)) { |
|
367 | + $files = array_merge($files, glob($configPath.$appName.DIRECTORY_SEPARATOR.'*'.$this->app->getConfigExt())); |
|
368 | + } elseif (is_dir($appPath.'config')) { |
|
369 | + $files = array_merge($files, glob($appPath.'config'.DIRECTORY_SEPARATOR.'*'.$this->app->getConfigExt())); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | foreach ($files as $file) { |
@@ -375,16 +375,16 @@ discard block |
||
375 | 375 | $this->register[$appName]['config'][$name] = $this->app->config->load($file, $name, false); |
376 | 376 | } |
377 | 377 | |
378 | - if (is_file($appPath . 'event.php')) { |
|
379 | - $this->register[$appName]['event'] = include $appPath . 'event.php'; |
|
378 | + if (is_file($appPath.'event.php')) { |
|
379 | + $this->register[$appName]['event'] = include $appPath.'event.php'; |
|
380 | 380 | } |
381 | 381 | |
382 | - if (is_file($appPath . 'middleware.php')) { |
|
383 | - $this->register[$appName]['middleware'] = include $appPath . 'middleware.php'; |
|
382 | + if (is_file($appPath.'middleware.php')) { |
|
383 | + $this->register[$appName]['middleware'] = include $appPath.'middleware.php'; |
|
384 | 384 | } |
385 | 385 | |
386 | - if (is_file($appPath . 'provider.php')) { |
|
387 | - $this->register[$appName]['provider'] = include $appPath . 'provider.php'; |
|
386 | + if (is_file($appPath.'provider.php')) { |
|
387 | + $this->register[$appName]['provider'] = include $appPath.'provider.php'; |
|
388 | 388 | } |
389 | 389 | } |
390 | 390 | } |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | $this->app->loadLangPack($this->app->lang->defaultLangSet()); |
412 | 412 | |
413 | 413 | // 设置应用命名空间 |
414 | - $this->app->setNamespace($this->app->config->get('app.app_namespace') ?: 'app\\' . $appName); |
|
414 | + $this->app->setNamespace($this->app->config->get('app.app_namespace') ?: 'app\\'.$appName); |
|
415 | 415 | } |
416 | 416 | |
417 | 417 | /** |