webman2.0 + think-orm,查出来的每个数据(每个字段的每个数据),在toArray或者转json的时候,都会被Composer里面的ClassLoader当成类去加载
在数据库查出数据后,调用json或者toArray,就会把每个查出的字段值都当成类去加载
这里写具体的系统环境相关信息 webman2.1,thinkorm2.1,win10,php8.2zts
可能是thinkphp官方 topthink/think-orm v4的缺陷,已经反馈给tp官方。 先手动执行composer require topthink/think-orm ~3.0 降级下
topthink/think-orm
composer require topthink/think-orm ~3.0
好的,谢谢大佬!
tp官方已经修复了,执行composer require topthink/think-orm ^4.0.30 升级下。
composer require topthink/think-orm ^4.0.30
think-orm4建议不要用,才刚开始就出现不兼容,后期大概率会不以前的版本兼容,等他稳定了再说。 在composer.json中指定版本限制一下: "topthink/think-orm": "~3.0.0"
"topthink/think-orm": "~3.0.0"
composer require -W webman/think-orm 使用这个组件安装的。。如何能在composer.json 里限制使用think-orm 3.0 composer.json里只有webman/think-orm...没有topthink/think-orm
webman/think-orm 支持 think-orm 3.0 | think-orm 4.0,默认情况会使用高版本的4.0。 但可以在网站根目录的composer.json加以限制。 像1楼说的composer require topthink/think-orm ~3.0命令,或者修改composer.json加上"topthink/think-orm": "~3.0.0",然后composer update
composer update
"require": { "php": ">=8.0", "workerman/webman-framework": "^1.5.0", "monolog/monolog": "^2.0", "psr/container": "^1.1.1", "webman/think-orm": "^1.1", "illuminate/redis": "^9.52", "illuminate/events": "^9.52", "vlucas/phpdotenv": "^5.5", "webman/captcha": "^1.0", "webman/console": "^1.2", }, 比如这是我的composer.json 我能直接在webman/think-orm限制吗?还是要新增一条 "topthink/think-orm": "~3.0",
新增
同时写webman/think-orm 和 topthink/think-orm 会不会冲突。。
最好还是用lv的orm 稳定 安全
可能是thinkphp官方
topthink/think-orm
v4的缺陷,已经反馈给tp官方。先手动执行
composer require topthink/think-orm ~3.0
降级下好的,谢谢大佬!
tp官方已经修复了,执行
composer require topthink/think-orm ^4.0.30
升级下。好的,谢谢大佬!
think-orm4建议不要用,才刚开始就出现不兼容,后期大概率会不以前的版本兼容,等他稳定了再说。
在composer.json中指定版本限制一下:
"topthink/think-orm": "~3.0.0"
composer require -W webman/think-orm
使用这个组件安装的。。如何能在composer.json 里限制使用think-orm 3.0
composer.json里只有webman/think-orm...没有topthink/think-orm
webman/think-orm 支持 think-orm 3.0 | think-orm 4.0,默认情况会使用高版本的4.0。
但可以在网站根目录的composer.json加以限制。
像1楼说的
composer require topthink/think-orm ~3.0
命令,或者修改composer.json加上"topthink/think-orm": "~3.0.0"
,然后composer update
"require": {
"php": ">=8.0",
"workerman/webman-framework": "^1.5.0",
"monolog/monolog": "^2.0",
"psr/container": "^1.1.1",
"webman/think-orm": "^1.1",
"illuminate/redis": "^9.52",
"illuminate/events": "^9.52",
"vlucas/phpdotenv": "^5.5",
"webman/captcha": "^1.0",
"webman/console": "^1.2",
},
比如这是我的composer.json 我能直接在webman/think-orm限制吗?还是要新增一条
"topthink/think-orm": "~3.0",
新增
同时写webman/think-orm 和 topthink/think-orm 会不会冲突。。
最好还是用lv的orm 稳定 安全