From 887486589df75b5c8d3b5167453f4b687bde724c Mon Sep 17 00:00:00 2001 From: zhiqiang Date: Fri, 22 Dec 2017 16:07:16 +0800 Subject: [PATCH] fix is_cli module load error --- core/lib/Hunter/App/ModuleHandler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/lib/Hunter/App/ModuleHandler.php b/core/lib/Hunter/App/ModuleHandler.php index 4322ebc..0ce7233 100644 --- a/core/lib/Hunter/App/ModuleHandler.php +++ b/core/lib/Hunter/App/ModuleHandler.php @@ -607,7 +607,11 @@ public function getModuleDirectories() { */ public function getName($module) { if(isset($this->moduleList[$module])){ - $info = Yaml::decode(file_get_contents($this->moduleList[$module]->getPathname())); + if(is_cli()){ + $info = Yaml::decode(file_get_contents(base_path().$this->moduleList[$module]->getPathname())); + }else { + $info = Yaml::decode(file_get_contents($this->moduleList[$module]->getPathname())); + } } return isset($info['name']) ? $info['name'] : $module; }