提交的内容

This commit is contained in:
2025-05-12 15:45:02 +08:00
parent 629c4750da
commit b48c692775
3043 changed files with 34732 additions and 60810 deletions

0
vendor/topthink/think-multi-app/LICENSE vendored Executable file → Normal file
View File

0
vendor/topthink/think-multi-app/README.md vendored Executable file → Normal file
View File

0
vendor/topthink/think-multi-app/composer.json vendored Executable file → Normal file
View File

3
vendor/topthink/think-multi-app/src/MultiApp.php vendored Executable file → Normal file
View File

@ -216,8 +216,7 @@ class MultiApp
if (is_file($appPath . 'provider.php')) {
$this->app->bind(include $appPath . 'provider.php');
}
// 加载应用默认语言包
// 加载应用语言包
$this->app->loadLangPack($this->app->lang->defaultLangSet());
}

64
vendor/topthink/think-multi-app/src/Service.php vendored Executable file → Normal file
View File

@ -1,32 +1,32 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
namespace think\app;
use think\Service as BaseService;
class Service extends BaseService
{
public function boot()
{
$this->app->event->listen('HttpRun', function () {
$this->app->middleware->add(MultiApp::class);
});
$this->commands([
'build' => command\Build::class,
'clear' => command\Clear::class,
]);
$this->app->bind([
'think\route\Url' => Url::class,
]);
}
}
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
namespace think\app;
use think\Service as BaseService;
class Service extends BaseService
{
public function boot()
{
$this->app->event->listen('HttpRun', function () {
$this->app->middleware->add(MultiApp::class);
});
$this->commands([
'build' => command\Build::class,
'clear' => command\Clear::class,
]);
$this->app->bind([
'think\route\Url' => Url::class,
]);
}
}

19
vendor/topthink/think-multi-app/src/Url.php vendored Executable file → Normal file
View File

@ -61,7 +61,12 @@ class Url extends UrlBuild
$domain = is_bool($domain) ? $key : $domain;
} elseif (!$this->app->http->isBind()) {
$url = $app . '/' . $url;
$map = $this->app->config->get('app.app_map', []);
if ($key = array_search($app, $map)) {
$url = $key . '/' . $url;
} else {
$url = $app . '/' . $url;
}
}
}
@ -141,20 +146,10 @@ class Url extends UrlBuild
throw new \InvalidArgumentException('route name not exists:' . $name);
} else {
// 检测URL绑定
$bind = $this->route->getDomainBind($domain && is_string($domain) ? $domain : null);
$bind = (string) $this->route->getDomainBind($domain && is_string($domain) ? $domain : null);
if ($bind && 0 === strpos($url, $bind)) {
$url = substr($url, strlen($bind) + 1);
} else {
$binds = $this->route->getBind();
foreach ($binds as $key => $val) {
if (is_string($val) && 0 === strpos($url, $val) && substr_count($val, '/') > 1) {
$url = substr($url, strlen($val) + 1);
$domain = $key;
break;
}
}
}
// 路由标识不存在 直接解析

0
vendor/topthink/think-multi-app/src/command/Build.php vendored Executable file → Normal file
View File

0
vendor/topthink/think-multi-app/src/command/Clear.php vendored Executable file → Normal file
View File

0
vendor/topthink/think-multi-app/src/command/stubs/controller.stub vendored Executable file → Normal file
View File