From d25b5676a8c060b655aa978045b7c95a99082c17 Mon Sep 17 00:00:00 2001 From: Garming Date: Wed, 5 Sep 2018 17:59:49 +0800 Subject: [PATCH] fix bugj --- res/tangram-module-schema.json | 3 +-- src/Tangram/Config/ModuleConfig.php | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/res/tangram-module-schema.json b/res/tangram-module-schema.json index 859b988..c5377ba 100644 --- a/res/tangram-module-schema.json +++ b/res/tangram-module-schema.json @@ -77,7 +77,6 @@ "required": [ "name", "description", - "autoload", - "module" + "autoload" ] } \ No newline at end of file diff --git a/src/Tangram/Config/ModuleConfig.php b/src/Tangram/Config/ModuleConfig.php index 9825f02..bd514cc 100644 --- a/src/Tangram/Config/ModuleConfig.php +++ b/src/Tangram/Config/ModuleConfig.php @@ -65,7 +65,8 @@ public function __construct(string $module,string $absoluteModulePath = null) { } $config = $file->read(); $this->name = $config['name']; - $this->module = $config['module']; + $module = explode("/",$this->name); + $this->module = isset($config['module']) ? $config['module'] : end($module); $this->description = $config['description']; $this->keywords = $config['keywords']; $this->type = $config['type'];