企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 命名空间调整 如果你自定义了应用类库的命名空间,需要改为设置环境变量`app_namespace`而不是应用配置文件。 如果你的应用类库中使用了下面的系统类库(主要涉及的类库是5.0静态调用的系统类库),那么命名空间需要调整如下: |5.0系统|5.1系统| |---|---| | think\App | think\facade\App (或者 App )| | think\Cache | think\facade\Cache (或者 Cache )| | think\Config | think\facade\Config (或者 Config )| | think\Cookie | think\facade\Cookie (或者 Cookie )| | think\Debug | think\facade\Debug (或者 Debug )| | think\Env | think\facade\Env (或者 Env )| | think\Hook | think\facade\Hook (或者 Hook )| | think\Lang | think\facade\Lang (或者 Lang )| | think\Log | think\facade\Log (或者 Log )| | think\Request | think\facade\Request (或者 Request )| | think\Response | think\facade\Reponse (或者 Reponse )| | think\Route | think\facade\Route (或者 Route )| | think\Session | think\facade\Session (或者 Session )| | think\Url | think\facade\Url (或者 Url )| | think\View | think\facade\View (或者 View )| >[danger] 如果只是用于依赖注入则无需更改命名空间。 举个例子,如果应用类库开头`use`了 `think\Url` ~~~ use think\Url; Url::build('index/index'); ~~~ 则需要改成 ~~~ use think\facade\Url; Url::build('index/index'); ~~~ 或者 ~~~ use Url; Url::build('index/index'); ~~~ > 5.1为系统的类库注册了类库别名,因此可以直接从根命名空间方式调用Url。 所以路由配置文件中你可以直接删除下面的一行代码 ~~~ use think\Route; ~~~