php3.2.3 升级,thinkphp3.2.3 升级到3.2.4时出错问题
有些項(xiàng)目最初用OneThink做的,而OneThink 默認(rèn)使用的TP 是3.2.0 的,沒事的時(shí)候就想給升級一下,但是直接復(fù)制進(jìn)去的時(shí)候,有錯(cuò)誤,導(dǎo)致OneThink 不能運(yùn)行,排查后,需要修改兩個(gè)地方
1、修改 Application/Common/Conf/tags.php 文件內(nèi)容修改為
‘a(chǎn)pp_init’=>array(‘Common\Behavior\InitHookBehavior’);// 原來沒有 Behavior 后綴
2、TP3.2.4 不能自動過濾 數(shù)據(jù)庫中沒有的字段,修改 ThinkPHP/Library/Think/Model.class.php 文件 _parseOptions 方法,加粗自動在3.2.3中復(fù)制
foreach ( $options [‘where’] as $key => $val ) {
$key = trim ( $key );
if (in_array ( $key, $fields, true )) {
if (is_scalar ( $val )) {
$this->_parseType ( $options [‘where’], $key );
}
} elseif (! is_numeric ( $key ) && ‘_’ != substr ( $key, 0, 1 ) && false === strpos ( $key, ‘.’ ) && false === strpos ( $key, ‘(‘ ) && false === strpos ( $key, ‘|’ ) && false === strpos ( $key, ‘&’ )) {
if (! empty ( $this->options [‘strict’] )) {
E ( L ( ‘_ERROR_QUERY_EXPRESS_’ ) . ‘:[‘ . $key . ‘=>’ . $val . ‘]’ );
}
unset ( $options [‘where’] [$key] );
}
}
本文收集于網(wǎng)絡(luò),僅供技術(shù)交流使用,本站不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如果發(fā)現(xiàn)本站有涉嫌抄襲的內(nèi)容, 歡迎發(fā)送郵件至 admin@webse.cn 舉報(bào),一經(jīng)查實(shí),本站將立刻刪除涉嫌侵權(quán)內(nèi)容,本文鏈接:https://webse.cn/15775.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
以上是生活随笔為你收集整理的php3.2.3 升级,thinkphp3.2.3 升级到3.2.4时出错问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 初审过了会不会被拒
- 下一篇: php 截取音频文件后缀名,使用PHP从