Commit 412f5ec7 by yeran

cli 模式下支持module config初始化

1 parent 0b7c0367
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"description": "Phalcon", "description": "Phalcon",
"keywords": ["phwoolcon"], "keywords": ["phwoolcon"],
"type": "library", "type": "library",
"version": "1.0.11", "version": "1.0.12",
"license": "proprietary", "license": "proprietary",
"authors": [ "authors": [
{ {
......
...@@ -47,6 +47,14 @@ class TaskCommand extends Command ...@@ -47,6 +47,14 @@ class TaskCommand extends Command
$this->output->writeln(''); $this->output->writeln('');
return false; return false;
} }
// 处理config注入
$secondSplit = strpos($classArray[0], '\\', strpos($classArray[0], '\\') + 1);
$moduleClass = substr($classArray[0], 0, $secondSplit) . '\Module';
if (class_exists($moduleClass) && method_exists($moduleClass, 'registerServices') && method_exists($moduleClass, 'registerAutoloaders')) {
$moduleObject = new $moduleClass;
$moduleObject->registerAutoloaders($this->getDi());
$moduleObject->registerServices($this->getDi());
}
$parameters = []; $parameters = [];
if ($options) { if ($options) {
parse_str($options, $parameters); parse_str($options, $parameters);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!