Skip to content

Commit

Permalink
改进多应用对伪静态的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Oct 29, 2019
1 parent 7eb02a5 commit 215f4a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/MultiApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected function parseMultiApp(): bool
$scriptName = $this->getScriptName();
$defaultApp = $this->app->config->get('app.default_app') ?: 'index';

if ($this->name || ($scriptName && !in_array($scriptName, ['index', 'think']))) {
if ($this->name || ($scriptName && !in_array($scriptName, ['index', 'router', 'think']))) {
$appName = $this->name ?: $scriptName;
$this->app->http->setBind();
} else {
Expand Down Expand Up @@ -129,6 +129,10 @@ protected function parseMultiApp(): bool
$deny = $this->app->config->get('app.deny_app_list', []);
$name = current(explode('/', $path));

if (strpos($name, '.')) {
$name = strstr($name, '.', true);
}

if (isset($map[$name])) {
if ($map[$name] instanceof Closure) {
$result = call_user_func_array($map[$name], [$this->app]);
Expand Down

0 comments on commit 215f4a6

Please # to comment.