Skip to content

在v8.1.4上使用$request->path();会引发Call to undefined method #3211

Description

@trustedinster

所属功能组件

请求(Request)

ThinkPHP 版本

8.1.4

操作系统

Debian

错误信息

#0 [0]Error in UrlHandler.php line 204
Call to undefined method app\Request::config()

$suffix = $this->config('url_html_suffix');

Call Stack

in UrlHandler.php line 204
at Request->path() in InstallCheck.php line 20
at InstallCheck->handle()
at call_user_func() in Middleware.php line 134
at Middleware->think\{closure}() in Pipeline.php line 85
at Pipeline->think\{closure}() in MethodGuard.php line 60
at MethodGuard->handle()
at call_user_func() in Middleware.php line 134
at Middleware->think\{closure}() in Pipeline.php line 85
at Pipeline->think\{closure}() in SecurityHeaders.php line 32
at SecurityHeaders->handle()
at call_user_func() in Middleware.php line 134
at Middleware->think\{closure}() in Pipeline.php line 85
at Pipeline->think\{closure}() in TraceDebug.php line 72
at TraceDebug->handle()
at call_user_func() in Middleware.php line 134
at Middleware->think\{closure}() in Pipeline.php line 85
at Pipeline->think\{closure}() in Pipeline.php line 66
at Pipeline->then() in Http.php line 197
at Http->runWithRequest() in Http.php line 162
at Http->run() in index.php line 75

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER	www
HOME	/home/www
HTTP_PRIORITY	u=0, i
HTTP_ACCEPT_LANGUAGE	zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6
HTTP_ACCEPT_ENCODING	gzip, deflate, br, zstd
HTTP_SEC_FETCH_DEST	document
HTTP_SEC_FETCH_USER	?1
HTTP_SEC_FETCH_MODE	navigate
HTTP_SEC_FETCH_SITE	none
HTTP_ACCEPT	text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
HTTP_USER_AGENT	Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36 Edg/149.0.0.0
HTTP_UPGRADE_INSECURE_REQUESTS	1
HTTP_DNT	1
HTTP_SEC_CH_UA_PLATFORM	"Windows"
HTTP_SEC_CH_UA_MOBILE	?0
HTTP_SEC_CH_UA	"Microsoft Edge";v="149", "Chromium";v="149", "Not)A;Brand";v="24"
PATH_INFO	
HTTP_HOST	mall.debian.local
REDIRECT_STATUS	200
SERVER_NAME	mall.debian.local
SERVER_PORT	443
SERVER_ADDR	192.168.246.128
REMOTE_PORT	52174
REMOTE_ADDR	192.168.246.1
SERVER_SOFTWARE	nginx/1.30.4
GATEWAY_INTERFACE	CGI/1.1
HTTPS	on
REQUEST_SCHEME	https
SERVER_PROTOCOL	HTTP/2.0
DOCUMENT_ROOT	/www/wwwroot/mall.debian.local/public
DOCUMENT_URI	/index.php
REQUEST_URI	/index.php?s=/setup/index
SCRIPT_NAME	/index.php
CONTENT_LENGTH	
CONTENT_TYPE	
REQUEST_METHOD	GET
QUERY_STRING	s=/setup/index
SCRIPT_FILENAME	/www/wwwroot/mall.debian.local/public/index.php
FCGI_ROLE	RESPONDER
PHP_SELF	/index.php
REQUEST_TIME_FLOAT	1786937761.4215
REQUEST_TIME	1786937761

其它说明

中间件的代码片段如下

public function handle(Request $request, Closure $next): Response
    {
       $path = $request->path();

#3186 似乎提到了此问题,我们已经看到标记为已完成,但是依然有此问题,可能没有将修复推到tag v8.1.4上

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions