add clear
This commit is contained in:
+5
-1
@@ -37,7 +37,11 @@ class Container
|
|||||||
static::$_instance->generate($config);
|
static::$_instance->generate($config);
|
||||||
|
|
||||||
if (static::$_instance->exists($class)) {
|
if (static::$_instance->exists($class)) {
|
||||||
return static::$_instance->get($class);
|
$newInstance = static::$_instance->get($class);
|
||||||
|
if (method_exists($newInstance, 'initConfig')) {
|
||||||
|
$newInstance->initConfig($config);
|
||||||
|
}
|
||||||
|
return $newInstance;
|
||||||
} else {
|
} else {
|
||||||
return static::$_instance->createObject($class);
|
return static::$_instance->createObject($class);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user