java多线程    Java入门    vsftp    ftp    linux配置    centos    FRP教程    HBase    Html5缓存    webp    zabbix    分布式    neo4j图数据库    

ecshop php5.5兼容utf-8版本

发生了这样的事情。

preg_replace

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /Users/ge/ge/web/php/ge/ecshop/includes/cls_template.php on line 1067

300

return preg_replace("/{([^\}\{\n]*)}/e", "\$this->sel ect('\\1');", $source);

替换为

return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->sel ect($r[1]); }, $source);

问题解决。

今天安装ecshop的时候最上面出现了一个错误提示:Strict Standards: Only variables should be passed by reference in F:\www.xxxx.com\cls_template.php on line 418

解决办法:

打开cls_template.php文件中发现下面这段代码:

$tag_sel = array_shift(explode(' ', $tag));
忘记说了,我的PHP版本是5.4.19,PHP5.3以上默认只能传递具体的变量,而不能通过函数返回值传递,所以这段代码中的explode就得移出来重新赋值了

$tagArr = explode(' ', $tag);
$tag_sel = array_shift($tagArr);

这样之后顶部的报错没掉了,左侧和底部的报错还需要去ecshop的后台点击清除缓存才能去除。

前台英文,后台中文的办法。

做外贸网站,也许很多客户想过怎么让ecshop前台英文后台中文,下面ecshop开发中心就教大家设置方法
ecshop前台英文后台中文的设置方法
这里有两种方法:
第一种方法:
打开 admin/includes/init.php 文件
找到
$_CFG = load_config();
在它下面增加一行代码

$_CFG['lang']= "zh_cn";
在去后台清除下缓存。

第二种方法:
将 languages 文件夹下 zh-cn admin 文件包 复制到 en_us文件夹里

到我的网盘下载 完全兼容php5.5 php5.6的 Ecshop版本。


This entry was posted in PHP and tagged , , . Bookmark the permalink.
月小升QQ 2651044202, 技术交流QQ群 178491360
首发地址:月小升博客https://java-er.com/blog/ecshop-php5-5-utf-8/
无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢
您的评论是我写作的动力.

Leave a Reply