framework icon indicating copy to clipboard operation
framework copied to clipboard

ThinkPHP Framework

Results 260 framework issues
Sort by recently updated
recently updated
newest added

建议增加应用名称归类标识 在传统fpm下没有问题,会每次请求后重新加载 但是在cli下,会一直在内存中,这将导致一些【多应用】下的配置都混在一起, 比如A应用访问时候 会有B应用的配置,访问B的时候 又有A 的标识 目前config类中没有剔除,建议不增加这个功能,而是额外增加标识,这样可以不用重复加载 说起来这也算是bug,依赖每次请求自动清除数据这种做法 感觉会为以后埋下后患

**Code logic error causes file upload getshell** Verify version:Thinkphp5.1.41/Thinkphp5.0.24 Install:composer create-project topthink/think tp 5.xxx test version:Thinkphp5.1.41 If the user directly uses the move method of thinkphp like this:Add an upload...

topthink/framework:8.0 topthink/think-annotation:2.0 例如定义了文件路由的MISS路由,然后注解路由定义的所有路由都不能使用; ``` Route::group('/', function () { Route::miss(function () { var_dump(111); }); }) ``` 能否调整下加载事件 ![image](https://github.com/top-think/framework/assets/28684103/cb3a981d-c393-45aa-bb0e-0da85ec65dfb) 试着调整了下 就可以访问 ![image](https://github.com/top-think/framework/assets/28684103/3cd3a520-a690-4719-bef2-9f628d6cf0ff) 官方看看,是否能适当调整下

.env中: xxx[] = xxxxxx 获取xxx时报错: Fatal error: Uncaught TypeError: strtoupper(): Argument #1 ($string) must be of type string, int given in /vendor/topthink/framework/src/think/Env.php:118 ================== [qqq] xxx[] = xxxxxx 这么写没有问题,可是我不想有qqq ![image](https://github.com/top-think/framework/assets/73475361/0b6589bf-8df6-4654-bdcb-2282b1d2463c)

- 查阅代码,发现ModelService中启动时使用Model::setDb($db)设置了一次db实例,然后在DbManager中的modelMaker中也使用Model::setDb($this)设置了一次db,但是在继承他的think\Db类中,modelMaker成了空方法,导致就算重新创建了容器中的db实例,也无法更新Model中存储的静态变量$db,从而导致在cli模式下运行时手动重新创建db却仍然出问题的情况。 - 其次,在App.php文件中,发现db和think\DbManager都对应Db类,cache和think\CacheManager都对应Cache类,log和think\LogManager都对应Log类 - 在facade文件中,Cache标识是cache,Log标识是log,Db标识却又成了think\DbManager 以上问题,麻烦确认下是否存在不合理之处,尤其是第一点!

ORM

对于 ``` Log::info('info1'); Log::error('error1'); Log::info('info2'); Log::error('error2'); ``` 写入到文件会是: ``` [2023-08-04T17:05:52+08:00][info] info1 [2023-08-04T17:05:52+08:00][info] info2 [2023-08-04T17:05:52+08:00][error] error1 [2023-08-04T17:05:52+08:00][error] error2 ``` 看了代码,TP 会把日志按日志等级划分到不同数组里导致的。开启实时写入则顺序正常。 希望关闭实时写入时的顺序也能正常。

Log

database文件配置 ```php 'auto_timestamp' => true, // 时间字段取出后的默认时间格式 'datetime_format' => 'Y-m-d H:i:s', // 时间字段配置 配置格式:create_time,update_time 'datetime_field' => 'created_at,updated_at', ``` 模型文件必需配置$createTime、$updateTime或者$autoWriteTimestamp,或者将ModelService设置autoWriteTimestamp的代码调至设置时间字段代码的后面,就能生效。 不生效 ```php class Model extends \think\Model { } ``` 生效 ```php...

`glob($this->config['path'] . '*.log')` 会按照文件名排序返回,删除第一个文件不太合理。#2877

记录日志时的方法checkLogSize(检查日志文件大小并自动生成备份文件)中生成备份文件时,备份文件以时间戳为前缀【如1659063483-20220729_api.log】。如果设置了文件数量限制,glob($this->config['path'] . '*.log')会按照文件名排序返回,就会导致时间戳前缀文件永远是最先删除的文件,只保留每天最后生成的日志文件,导致日志文件不完整了。

多应用模式 应用配置session prefix配置无效,不起作用 仅公共配置才生效 /config/session.php ![image](https://github.com/top-think/framework/assets/29880762/ec11f3ee-4149-4942-baf0-f9d594437b26)