Home > php教程 > php手册 > THINKPHP框架代码_个人修复

THINKPHP框架代码_个人修复

WBOY
Release: 2016-06-07 11:39:44
Original
1147 people have browsed it

TP_个人修改核心文件部分_持续更新
(1)关联模型更新/删除,condition与pk互斥问题
ThinkPHP\Library\Think\Model\RelationModel.class.php 273行
源代码:if(!empty($val['condition'])) {<br>     $mappingCondition   =   $val['condition'];<br> }else{<br>     $mappingCondition               =   array();<br>     $mappingCondition[$mappingFk]   =   $pk;<br> }修改为:$mappingCondition               =   array();<br> if(!empty($val['condition'])) {<br>     $mappingCondition['_string']   =   $val['condition'];<br> }<br> $mappingCondition[$mappingFk]   =   $pk;(2)标签库taglib,autoBuildVar统一格式
ThinkPHP\Library\Think\Template\Taglib.class.php 161行
源代码:if(0===strpos($val,'$')) {<br>     $name .= '["{'.$val.'}"]';<br> }else{<br>     $name .= '["'.$val.'"]';<br> }修改为if(0===strpos($val,'$')) {<br>     $name .= '[\'{'.$val.'}\']';<br> }else{<br>     $name .= '[\''.$val.'\']';<br> }(3)修正设置SESSION前缀情况下$Think.session.admin.info失效
ThinkPHP\Library\Think\Template.class.php 605行开始case 'COOKIE':<br>     if(isset($vars[3])) {<br>         $parseStr = '$_COOKIE[\''.$vars[2].'\'][\''.$vars[3].'\']';<br>     }else{<br>         $parseStr = 'cookie(\''.$vars[2].'\')';<br>     }<br>     break;<br> case 'SESSION':<br>     if(isset($vars[3])) {<br>         $parseStr = '$_SESSION[\''.$vars[2].'\'][\''.$vars[3].'\']';<br>     }else{<br>         $parseStr = 'session(\''.$vars[2].'\')';<br>     }<br>     break;修改为case 'COOKIE':<br>     if(isset($vars[3])) {<br>         $prefix=C('COOKIE_PREFIX');<br>         $prefixStr=empty($prefix) ? '' : "['".$prefix."']";<br>         $parseStr = '$_COOKIE'.$prefixStr.'[\''.$vars[2].'\'][\''.$vars[3].'\']';<br>     }else{<br>         $parseStr = 'cookie(\''.$vars[2].'\')';<br>     }<br>     break;<br> case 'SESSION':<br>     if(isset($vars[3])) {<br>         $prefix=C('SESSION_PREFIX');<br>         $prefixStr=empty($prefix) ? '' : "['".$prefix."']";<br>         $parseStr = '$_SESSION'.$prefixStr.'[\''.$vars[2].'\'][\''.$vars[3].'\']';<br>     }else{<br>         $parseStr = 'session(\''.$vars[2].'\')';<br>     }<br>     break;

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template