Skip to content

Commit

Permalink
功能:关闭Service功能的调整
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyecommerce committed Dec 29, 2017
1 parent e820ac5 commit ab35063
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions services/Service.php
Expand Up @@ -67,7 +67,7 @@ public function getChildService($childServiceName)
$childService = $this->childService;
if (isset($childService[$childServiceName])) {
$service = $childService[$childServiceName];
if(!isset($service['enableService']) || $service['enableService']){
if ($service['enableService'] !== false) {
$this->_childService[$childServiceName] = Yii::createObject($service);
}else{
throw new InvalidConfigException('Child Service ['.$childServiceName.'] is disable in '.get_called_class().', you must config it! ');
Expand All @@ -81,15 +81,15 @@ public function getChildService($childServiceName)
}
/**
* 得到所有的子服务
* 如果子服务含有enable字段,并且设置成false,则该子服务会被判定为关闭
* 如果子服务含有enableService字段,并且设置成false,则该子服务会被判定为关闭
*/
public function getAllChildServiceName()
{
$childService = $this->childService;
$arr = [];
if(is_array($childService) && !empty($childService)){
foreach($childService as $childName => $service){
if(!isset($service['enable']) || $service['enable']){
if ($service['enableService'] !== false) {
$arr[] = $childName;
}
}
Expand Down

0 comments on commit ab35063

Please sign in to comment.