ECSHOP如何解决Deprecated: preg_replace()报错 Home / 开源程序 / ECSHOP / ECSHOP如何解决Deprecated: preg_replace()报错
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in D:\wyh\ecshop\includes\cls_template.php on line 300
1、错误原因:
preg_replace() 函数中用到的修饰符 /e 在 PHP5.5.x
中已经被弃用了。
如果你的PHP版本恰好是PHP5.5.X,那你的ECSHOP肯定就会报类似这样的错误。
2、解决办法:
一、将 cls_template.php的300行
return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source); |
换成:
return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source); |
二、将cls_template.php的493行
$out ="<?php \n" . '$k = ' . preg_replace("/(\'\\$[^,]+)/e" , "stripslashes(trim('\\1','\''));",$t, true)) .";\n"; |
换成:
$out = <?php" . '$k = ' . preg_replace_callback("/(\'\\$[^,]+)/" , function($r) {return\''));}, var_export($t, true)) . |
三、将cls_template.php的552行
$val ="/\[([^\[\]]*)\]/eis", "'.'.str_replace('$','\$','\\1')",$val); |
换成:
$val ="/\[([^\[\]]*)\]/", function($r)return '.'.str_replace('$','$',$r[1]);}, $val); |
四、将cls_template.php的1069行
$pattern ='/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/se'; |
$replacement ="'{include file='.strtolower('\\1'). '}'"; |
$source =$pattern,$replacement, $source); |
换成:
$pattern ='/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/s'; |
$source =$pattern, function($r){return '{include file='.strtolower($r[1]). '}';}, $source); |
ECSHOP如何解决Deprecated: preg_replace()报错 Home / 开源程序 / ECSHOP / ECSHOP如何解决Deprecated: preg_replace()报错的更多相关文章
- 解压tar.gz文件报错gzip: stdin: not in gzip format解决方法
解压tar.gz文件报错gzip: stdin: not in gzip format解决方法 在解压tar.gz文件的时候报错 1 2 3 4 5 [Sun@localhost Downloads] ...
- jenkins编辑报错Exception when publishing, exception message的解决办法
jenkins编辑报错Exception when publishing, exception message的解决办法 查看目标主机的磁盘空间是否占满,清理磁盘空间即可
- 小程序-报错 xxx is not defined (已解决)
小程序-报错 xxx is not defined (已解决) 问题情境: 这样一段代码,微信的小程序报错 is not defined 我 wxml 想这样调用 //wxml 代码 <view ...
- LR回放webservice脚本报错------------mmdrv.exe应用程序错误(未解决)
1.录制完成webservice脚本如下: 2.回放脚本,报错: 3.网上查看了一些解决办法,但都是没有起到作用.
- 第一次打开pycharm运行python文件报错”No Python interpreter selected“问题的解决办法
前面没有细讲,这里细述一下安装pycharm后,第一次打开pycharm运行python文件报错"No Python interpreter selected"问题的解决办法. 出 ...
- 项目报错:/uploads: Read-only file system(解决办法)
项目报错:/uploads: Read-only file system(解决办法) 本来以为是service层没加注解,翻到最后才发现问题 原因是项目根目录没有对应的文件夹,在项目根目录创建uplo ...
- 解决Pyqt打包后运行报错:应用程序无法启动 因为程序的并行配置不正确
做了一个生成二维码的小程序:http://www.cnblogs.com/dcb3688/p/4241048.html 直接运行脚本没问题,用pyinstaller打包后再运行就直接报错了: 应用程序 ...
- Windows 8.1升级至Windows 10后,启动VisualSVN Server Manager报错:提供程序无法执行所尝试的操作 (0x80041024)的解决
1.1.Windows 8.1升级至Windows 10后,启动VisualSVN Server Manager报错:提供程序无法执行所尝试的操作 (0x80041024),VisualSVN Ser ...
- IE浏览器F12调试模式不能使用或报错以及安装程序遇到错误0x80240037的解决办法
记录一下,方便以后查找 IE浏览器F12调试模式不能使用: 需要下载补丁: 64位系统 然后下载安装,就能解决问题. 要是在安装时遇到出现: 安装程序遇到错误 0x80240037 解决方式 最后 ...
随机推荐
- BIP_开发案例01_BI Publisher报表手工提交和控制(案例)
2014-12-27 Created By BaoXinjian
- NeHe OpenGL教程 第三课:颜色渲染
转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...
- JavaScript事件基础知识总结【思维导图】
另外附上来自Nicholas C.Zakas<JavaScript高级程序设计 第3版>中的跨浏览器兼容EventUtil对象. var EventUtil = { //注册事件 addH ...
- Studio右键选项中没有Git?
从Git clone一个Project并打开后,都会习惯性的像使用Eclipse一样,选中工程右键,选择Git的对应版本控制选项. 如下图,你只看到了svn. 如何配置才能在右键选项中看到Git呢,我 ...
- 使用Topshelf 5步创建Windows 服务 z
使用Topshelf创建Windows 服务简要的介绍了创建Windows服务的另一种方法,老外的一篇文章Create a .NET Windows Service in 5 steps with T ...
- SQL Server 2005中的分区表(一):什么是分区表?为什么要用分区表?如何创建分区表?(转)
如果你的数据库中某一个表中的数据满足以下几个条件,那么你就要考虑创建分区表了. 1.数据库中某个表中的数据很多.很多是什么概念?一万条?两万条?还是十万条.一百万条?这个,我觉得是仁者见仁.智者见 ...
- C++学习30 重载++和--(自增自减运算符)
自增“++”和自减“--”都是一元运算符,它的前置形式和后置形式都可以被重载.请看下面的例子: #include <iostream> #include <iomanip> u ...
- [Flex] as3xls读取excel,修改保存单表(二)
这个方法仅用了as3xls读取excel的功能,修改保存独立出来了. <?xml version="1.0" encoding="utf-8"?> ...
- [SQL]多列的行转列
create table t(name varchar(),subject varchar(),mark int) insert into t union all union all union al ...
- 使用 FileZilla FTP Client连接Vsftpd在执行LIST命令后提示连接超时
使用 FileZilla FTP Client 连接 Vsftpd在执行LIST命令后提示连接超时. vi /etc/vsftpd/vsftpd.conf 添加: #开启被动模式 pasv_enabl ...