国家排序及普通话名称的恢宏,4之上版本各个错误难题处理

澳门葡京备用网址 1

澳门葡京备用网址 2

在php5.4版本之后有不少的函数与效果拓展扬弃与升级功能了,现在国内众多CMS都还未按php5.4标准来做了,上面我整理了有的在ecshop在PHP
5.4上述版本各样不当难点处理.

CREATE TABLE root (
USER_ID INT(11) NOT NULL ,
USER_澳门葡京备用网址 ,NAME VARCHAR(45) NOT NULL,
USER_ADDR VARCHAR(60),
PRIMARY KEY (USER_ID)
) ENGINE=INNODB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8

说到底完结效益如上

末尾落到实处效益如上

1、PHP 5.4.X条件下安装ECShop出现“includes/cls_template.php on
line 406”的化解方案。
将 $tag_sel = array_shift(explode(‘ ‘, $tag));
这句话拆开为两句。
$tag_arr = explode(‘ ‘, $tag);
国家排序及普通话名称的恢宏,4之上版本各个错误难题处理。$tag_sel = array_shift($tag_arr);
array_shift()
的参数是援引传递的,5.3以上默认只可以传递具体的变量,而无法经过函数再次来到值
end(&array) 也一律(前边也会有end的函数,也要求拆分为两行)。
2、PHP 5.4.X环境下安装ECShop出现“includes/lib_base.php on line
346”的解决方案。
将 cls_image.php 中 function gd_version() 改成 static function
gd_version() 即可。
3、后台点击 开店向导 警告的缓解方案。
admin/include/modules/payment 下的几个公文构造函数错误,删掉即可。
4、php5.4下安装的时候处理难题,Strict Standards: Non-static method
cls_image::gd_version() should not be called statically in
\install\includes\lib_installer.php on line 31
解决:找到install/includes/lib_installer.php中的第31行   return
cls_image::gd_version();然后在找到include/cls_image.php中的678行,发现gd_version()方法未表明静态static,所以会出错。那时候只要:
将function gd_version()改成static function gd_version()即可。
5、安装好前面世 Strict standards: Only variables should be passed by
reference in \includes\lib_main.php on line 1329
$ext = end(explode(‘.’, $tmp));
修改为:
$ext = explode(‘.’,$tmp);
$ext = end($ext);
6、Strict standards: Only variables should be passed by reference in
\includes\cls_template.php on line 418
tag_sel = array_shift(explode(‘ ‘, $tag));
修改为:
$tag_arr = explode(‘ ‘, $tag); $tag_sel = array_shift($tag_arr);
7、ECSHOP后台“商店设置”报错 Strict Standards: mktime(): You should be
using the time() function instead in
/www/web/zhuli/public_html/admin/sms_url.php on line 31。
php版本难题  mktime()修改为  time()
8、 ECSHOP后台“商店设置”报错 Strict Standards: mktime(): You should be
using the time() function instead in
/www/web/zhuli/public_html/admin/shop_config.php on line 32。
php版本难题  mktime()修改为  time()

;
— 修改列的数据类型描述
ALTER TABLE root MODIFY COLUMN user_ID INT(11) NOT NULL
;
— 修改列的数据类型描述 另一种艺术
ALTER TABLE root CHANGE function_change_id function_change_id BIGINT
NOT NULL;
;
— 增加列
ALTER TABLE root ADD COLUMN function_id INT(11) DEFAULT 1 COMMENT
‘测试使用的函数ID’
;
— 删除列
ALTER TABLE root DROP COLUMN function_change_id
;
— 重命名列
ALTER TABLE root CHANGE function_id function_change_id INT(20)
COMMENT ‘哈哈哈哈’
;
— 增添索引
ALTER TABLE root ADD INDEX myindex (USER_NAME)
;
— 加主键索引
ALTER TABLE root ADD PRIMARY KEY(USER_ID,USER_NAME)
;
— 删除索引
ALTER TABLE root DROP PRIMARY KEY
;
— 一遍扩张多列
ALTER TABLE AAA
ADD COLUMN JJJ VARCHAR(100) DEFAULT NULL COMMENT ‘111’,
ADD COLUMN UUU VARCHAR(20) DEFAULT NULL COMMENT ‘222’,
ADD COLUMN TTT INT(20) DEFAULT 0 COMMENT ‘333’
;
— update 从一张表更新字段到另一张表
UPDATE
AA T1,BB T2
SET
T1.WE = T2.RT,
T1.DF=T2.GH
WHERE T1.ID = T2.ID

具体步骤:

具体步骤:

3 安装好前面世 Strict standards: Only variables should be passed by
reference in \includes\lib_main.php on line 1329
$ext = end(explode(‘.’, $tmp));
修改为:
$ext = explode(‘.’,$tmp);
$ext = end($ext);
Strict standards: Only variables should be passed by reference in
\includes\cls_template.php on line 418
tag_sel = array_shift(explode(‘ ‘, $tag));
修改为:
$tag_arr = explode(‘ ‘, $tag); $tag_sel = array_shift($tag_arr);
 
array_shift()
的参数是援引传递的,5.3以上默许只可以传递具体的变量,而无法通过函数重临值
end(&array) 也一律(前边也会有end的函数,也要求拆分为两行)。
 
修改后到后台更新缓存
 
4 后台 Strict standards: Redefining already defined constructor for
class alipay in \includes\modules\payment\alipay.php on line 85
后台更新缓存
 
5 Strict standards: mktime(): You should be using the time() function
instead in \admin\sms_url.php on line 31
php版本难点  mktime()修改为  time()
 
6 Strict standards: Redefining already defined constructor for class
alipay in \includes\modules\payment\alipay.php on line 85Call
Stack
这里是php4与php5的区别
PHP4中构造方法是一个与类同名的措施,而从PHP5初叶,用__construct()做为构造方法,但仍旧支撑PHP4的构造方法。如若还要利用以来,要是同名方法在前的话,则会报错

  1. 手动或SQL修改数据表,扩充2个字段

    ALTER TABLE countries ADD countries_name_cn VARCHAR( 64 ) NULL DEFAULT ”, ADD order_by int(11) NOT NULL DEFAULT ‘0’;

  2. 修改admin/countries.php文件,增添表单插入编辑功效,
    共计7处,此处忽略具体代码。

  1. 手动或SQL修改数据表,扩大2个字段

    ALTER TABLE countries ADD countries_name_cn VARCHAR( 64 ) NULL DEFAULT ”, ADD order_by int(11) NOT NULL DEFAULT ‘0’;

  2. 修改admin/countries.php文件,扩张表单插入编辑作用,
    共计7处,此处忽略具体代码。

只须求把 function __construct()移到同名函数以前

3. 之后还要修改五个得到国家下拉列表的函数(前台后台分别对应一个)

3. 事后还要修改多个得到国家下拉列表的函数(前台后台分别对应一个)

7 Deprecated: Assigning the return value of new by reference is
deprecated in  \admin\sitemap.php on line 46

#includes/functions/functions_lookups.php

#includes/functions/functions_lookups.php

$sm     =& new google_sitemap();

  function zen_get_countries($countries_id = '', $with_iso_codes = false) {
    global $db;
    $countries_array = array();
    if (zen_not_null($countries_id)) {
~
~
    } else {
      $countries = "select countries_id, countries_name, countries_name_cn
                    from " . TABLE_COUNTRIES . "
                    order by order_by, countries_name";

      $countries_values = $db->Execute($countries);

      while (!$countries_values->EOF) {
        $countries_array[] = array('countries_id' => $countries_values->fields['countries_id'],
                                   'countries_name' => $countries_values->fields['countries_name']." - ".$countries_values->fields['countries_name_cn']);

        $countries_values->MoveNext();
      }
    }

    return $countries_array;
  }
  function zen_get_countries($countries_id = '', $with_iso_codes = false) {
    global $db;
    $countries_array = array();
    if (zen_not_null($countries_id)) {
~
~
    } else {
      $countries = "select countries_id, countries_name, countries_name_cn
                    from " . TABLE_COUNTRIES . "
                    order by order_by, countries_name";

      $countries_values = $db->Execute($countries);

      while (!$countries_values->EOF) {
        $countries_array[] = array('countries_id' => $countries_values->fields['countries_id'],
                                   'countries_name' => $countries_values->fields['countries_name']." - ".$countries_values->fields['countries_name_cn']);

        $countries_values->MoveNext();
      }
    }

    return $countries_array;
  }

    
在5.3版本之后一度分化意在先后中行使”=&”符号。假如你的网站出现了Deprecated:
Assigning the return value of new by reference is deprecated in
错误,别着急,先稳住到不可相信的文件,查找下是还是不是在先后中应用了”=&”,例如阿兹猫刚才定位到网站先后中发现了下图的先后,发现选拔了”=&”符号,去掉‘&’符号之后程序运行正常。
 
8  PHPStrict Standards: Declaration of ucenter::login() should be
compatible with integrate::login($username, $password, $remember = NULL)
in \includes\modules\integrates\ucenter.php on line 52 PHP Strict
Standards: Declaration of ucenter::add_user() should be compatible with
integrate::add_user($username, $password, $email, $gender = -1, $bday =
0, $reg_date = 0, $md5password = ”) in
\includes\modules\integrates\ucenter.php on line 52 PHP Strict
Standards: Declaration of ucenter::set_cookie() should be compatible
with integrate::set_cookie($username = ”, $remember = NULL) in
\includes\modules\integrates\ucenter.php on line 52
 
PHP5.4,子类的方法名即使和父类方法名相同,则子类的参数列表也要和父类的参数列相同。
修改接口文件之中的主意
 
9  ecshop2.7.3 gbk版在php5.4下安装后,分类名称文字不彰显难点
htmlspecialchars()从 php5.4.0 版本开端第四个参数字符串编码的默认值改成了
UTF-8,而ecshop2.7.3 gbk版的华语编码是 GB2312
编码的,跟现在的默许参数不平等,导致所有htmlspecialchars()处理的字符都无法儿展示。
解决办法:
$str_converted = htmlspecialchars($str, ENT_COMPAT ,’GB2312′);
指出php5.4下不要设置gbk编码ecshop。

#admin/includes/functions/general.php

#admin/includes/functions/general.php

  function zen_get_countries($default = '') {
    global $db;
    $countries_array = array();
    if ($default) {
      $countries_array[] = array('id' => '',
                                 'text' => $default);
    }
    $countries = $db->Execute("select countries_id, countries_name,countries_name_cn
                               from " . TABLE_COUNTRIES . "
                               order by order_by, countries_name");

    while (!$countries->EOF) {
      $countries_array[] = array('id' => $countries->fields['countries_id'],
                                 'text' => $countries->fields['countries_name']." - ".$countries->fields['countries_name_cn']);
      $countries->MoveNext();
    }

    return $countries_array;
  }
  function zen_get_countries($default = '') {
    global $db;
    $countries_array = array();
    if ($default) {
      $countries_array[] = array('id' => '',
                                 'text' => $default);
    }
    $countries = $db->Execute("select countries_id, countries_name,countries_name_cn
                               from " . TABLE_COUNTRIES . "
                               order by order_by, countries_name");

    while (!$countries->EOF) {
      $countries_array[] = array('id' => $countries->fields['countries_id'],
                                 'text' => $countries->fields['countries_name']." - ".$countries->fields['countries_name_cn']);
      $countries->MoveNext();
    }

    return $countries_array;
  }

终极效果

末段效果

澳门葡京备用网址 3

澳门葡京备用网址 4

万一不是特意须求,后台函数也可不修改。

若果不是越发须求,后台函数也可不改动。

 

 

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

*
*
Website