diff --git a/src/Application.php b/src/Application.php index 89ccd9b..0ed7455 100644 --- a/src/Application.php +++ b/src/Application.php @@ -427,17 +427,18 @@ public function beforeRun() $this->getResponse()->setSwooleResponse($this->getSwooleResponse()); foreach ($this->bootstrap as $k => $component) { - if (is_object($component)) + if ( ! is_object($component)) { - if (in_array(get_class($component), $this->bootstrapRefresh)) - { - /** @var BootstrapInterface $component */ - $component->bootstrap($this); - } - elseif ($component instanceof Refreshable) - { - $component->refresh(); - } + $component = $this->get($component); + } + if (in_array(get_class($component), $this->bootstrapRefresh)) + { + /** @var BootstrapInterface $component */ + $component->bootstrap($this); + } + elseif ($component instanceof Refreshable) + { + $component->refresh(); } } }