Skip to content

Commit

Permalink
修复bootstrap传组件名时, 不会在每次请求时refresh的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ywisax committed Nov 10, 2016
1 parent 15e3fdd commit f541e3d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down

0 comments on commit f541e3d

Please sign in to comment.