国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

【緊急bug】webman2.1+tp-orm,數(shù)據(jù)庫查出來的每個數(shù)據(jù)值,都會被當成類去加載!

會行走的bug

問題描述

webman2.0 + think-orm,查出來的每個數(shù)據(jù)(每個字段的每個數(shù)據(jù)),在toArray或者轉json的時候,都會被Composer里面的ClassLoader當成類去加載

程序代碼或配置

php版本

依賴

代碼

調用json或者toArray,就會把每個查出的字段值都當成類去加載

重現(xiàn)問題的步驟

數(shù)據(jù)庫中的數(shù)據(jù)
在數(shù)據(jù)庫查出數(shù)據(jù)后,調用json或者toArray,就會把每個查出的字段值都當成類去加載

操作系統(tǒng)環(huán)境及workerman/webman等具體版本

這里寫具體的系統(tǒng)環(huán)境相關信息
webman2.1,thinkorm2.1,win10,php8.2zts

621 4 1
4個回答

walkor 打賞

可能是thinkphp官方 topthink/think-orm v4的缺陷,已經反饋給tp官方。
先手動執(zhí)行composer require topthink/think-orm ~3.0 降級下

walkor 打賞

tp官方已經修復了,執(zhí)行composer require topthink/think-orm ^4.0.30 升級下。

ichynul

think-orm4建議不要用,才剛開始就出現(xiàn)不兼容,后期大概率會不以前的版本兼容,等他穩(wěn)定了再說。
在composer.json中指定版本限制一下:
"topthink/think-orm": "~3.0.0"

  • Le 2025-05-17

    composer require -W webman/think-orm
    使用這個組件安裝的。。如何能在composer.json 里限制使用think-orm 3.0
    composer.json里只有webman/think-orm...沒有topthink/think-orm

  • ichynul 2025-05-17

    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

  • Le 2025-05-17

    "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",

  • ichynul 2025-05-17

    新增

  • Le 2025-05-17

    同時寫webman/think-orm 和 topthink/think-orm 會不會沖突。。

tanhongbin

最好還是用lv的orm 穩(wěn)定 安全

  • 暫無評論
??