Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
Development Tools
>
Wiki/Document
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
11
Star
133
Fork
17
HG
/
thinkphp-apidoc
Code
Issues
2
Pull Requests
0
Wiki
Insights
Pipelines
Service
PHPDoc
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
tp5.1使用bug
Done
#I5H1WS
yqsphp
Opened this issue
2022-07-14 14:02
tp5.1使用是按照文档操作一直都不成功,然后去一步步调试错误位置在vendor\hg\apidoc\src\Controller.php文件 在初始化__construct方法中 ``` if (!is_dir($path)){ $path =$namespace.'\\controller'; } ``` 这句话是判断$path是否是一个路径,在tp5.1中返回结果是 application\controller 所以多模块就没有,单模块可以。 tp5.1 默认多模块,application中默认有index文件夹 所以说需要在上述代码中加入 ``` if($this->tp_version === 6){ if (!is_dir($path)){ $path =$namespace.'\\controller'; } } ``` 只有在tp6才执行这段,那么就正常显示编写的接口,这段判断不影响tp6。 **另外,是不是需要做个提示访问http://域名/apidoc时提示php版本大于7.0. 如果上线用tp5.1框架而php用的是5.6,那么这个接口根本不能用,不可能因为接口apidoc而改变php版本,否则影响其他**
tp5.1使用是按照文档操作一直都不成功,然后去一步步调试错误位置在vendor\hg\apidoc\src\Controller.php文件 在初始化__construct方法中 ``` if (!is_dir($path)){ $path =$namespace.'\\controller'; } ``` 这句话是判断$path是否是一个路径,在tp5.1中返回结果是 application\controller 所以多模块就没有,单模块可以。 tp5.1 默认多模块,application中默认有index文件夹 所以说需要在上述代码中加入 ``` if($this->tp_version === 6){ if (!is_dir($path)){ $path =$namespace.'\\controller'; } } ``` 只有在tp6才执行这段,那么就正常显示编写的接口,这段判断不影响tp6。 **另外,是不是需要做个提示访问http://域名/apidoc时提示php版本大于7.0. 如果上线用tp5.1框架而php用的是5.6,那么这个接口根本不能用,不可能因为接口apidoc而改变php版本,否则影响其他**
Comments (
1
)
Sign in
to comment
Status
Done
Backlog
Doing
Done
Closed
Assignees
Not set
Labels
Not set
Label settings
Milestones
No related milestones
No related milestones
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (4)
Tags (53)
master
docs-pages
docs
v1
v3.1.9
v3.1.8
v3.1.7
v3.1.6
v3.1.5
v3.1.4
v3.1.3
v3.1.2
v3.1.1
v3.1.0
v3.0.8
v3.0.7
v3.0.6
v3.0.5
v3.0.4
v3.0.3
v3.0.2
v3.0.1
v3.0.0
v2.6.1
v2.6.0
v2.5.3
v2.5.2
v2.5.1
v2.5.0
v2.4.4
v2.4.3
v2.4.2
v2.4.1
v2.4.0
v2.3.0
v2.2.2
v2.2.1
v2.2.0
v2.1.3
v1.1.2
v2.1.2
v2.1.1
v2.1.0
v2.0.5
v2.0.4
v2.0.3
v2.0.2
v2.0.1
v2.0.0
v1.1.1
v1.1.0
v1.0.5
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0.0
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
参与者(1)
PHP
1
https://gitee.com/hg-code/thinkphp-apidoc.git
git@gitee.com:hg-code/thinkphp-apidoc.git
hg-code
thinkphp-apidoc
thinkphp-apidoc
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register