Skip to content

Commit

Permalink
fix: 修改app namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
titrxw committed Sep 9, 2021
1 parent 98aa733 commit 57db0d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Src/Core/Route/Provider/RouterProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function register() {
$enableStatic = $this->config->get('server.common.enable_static_handler', true);

return new Router($routeCollector, [
'app_namespace' => App::getApp()->getAppNamespace(),
'document_root' => $documentRoot,
'enable_static_handler' => $enableStatic
]);
Expand Down
3 changes: 2 additions & 1 deletion Src/Core/Route/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Router implements RouterInterface {
* @var array
*/
private $currentMiddleware = [];
private $defaultNamespace = 'W7\App';
private $defaultNamespace;
private $defaultModule = 'system';

private $name = '';
Expand All @@ -50,6 +50,7 @@ public function __construct(RouteCollector $routeCollector = null, $config = [])
if (!$routeCollector) {
$routeCollector = new RouteCollector(new Std(), new GroupCountBased());
}
$this->defaultNamespace = $config['app_namespace'] ?? '';
$this->routerCollector = $routeCollector;
$this->config = $config;
}
Expand Down

0 comments on commit 57db0d5

Please sign in to comment.