改名
This commit is contained in:
+15
-9
@@ -45,19 +45,25 @@ class Service extends Component
|
|||||||
if (isset($this->_components[$id])) {
|
if (isset($this->_components[$id])) {
|
||||||
return $this->_components[$id];
|
return $this->_components[$id];
|
||||||
}
|
}
|
||||||
if (isset($this->_definition[$id])) {
|
if (!isset($this->_definition[$id]) && !isset($this->_alias[$id])) {
|
||||||
$config = $this->_definition[$id];
|
if ($try === false) {
|
||||||
if (!is_object($config)) {
|
return null;
|
||||||
$config = Snowflake::createObject($config);
|
|
||||||
}
|
}
|
||||||
return $this->_components[$id] = $config;
|
|
||||||
}
|
|
||||||
if ($try !== false) {
|
|
||||||
throw new ComponentException("Unknown component ID: $id");
|
throw new ComponentException("Unknown component ID: $id");
|
||||||
}
|
}
|
||||||
return null;
|
if (isset($this->_definition[$id])) {
|
||||||
}
|
$config = $this->_definition[$id];
|
||||||
|
if (is_object($config)) {
|
||||||
|
return $this->_components[$id] = $config;
|
||||||
|
}
|
||||||
|
$object = Snowflake::createObject($config);
|
||||||
|
} else {
|
||||||
|
$config = $this->_alias[$id];
|
||||||
|
|
||||||
|
$object = Snowflake::createObject($config);
|
||||||
|
}
|
||||||
|
return $this->_components[$id] = $object;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $className
|
* @param string $className
|
||||||
|
|||||||
Reference in New Issue
Block a user