Ecshop _php instances of PHP5.5 and high-resolution escalation errors

Source: Internet
Author: User
Tags deprecated
Ecshop did not have time to modify, if the Ecshop program installed on the high version of the PHP virtual host, there is a compatibility issue.

Small series on the local environment php5.5 installed on the following two kinds of error prompts :

Only variables should is passed by reference PHP
Deprecated:preg_replace (): the/e modifier is Deprecated, use Preg_replace_callback instead ...?

Through the search on the network, small compilation found not only in the lower version of PHP installation, but also found a solution, convenient for everyone to debug the php5.5 version of the program. The small series here to share the solution to everyone:

First, the solution to the first problem:

PHP 5.3 or later issues, and configuration about as long as 418 lines to break this sentence into two sentences there is no problem.

The following:

$tag _sel = Array_shift (Explode (", $tag));

Modified to:

$tag _arr = Explode (", $tag); $tag _sel = Array_shift ($tag _arr);

Because the arguments of Array_shift are passed by reference, more than 5.3 by default can only pass specific variables, but not through function return values

The second answer to the error:

Files found:include/cls_template.php

Put the following code:

Return Preg_replace ("/{([^\}\{\n]*)}/e", "\ $this->select (' \\1 ');", $source);

Modified to:

Return Preg_replace_callback ("/{([^\}\{\n]*)}/", function ($r) {return $this->select ($r [1]);}, $source);

Small series at present only encountered such two error, if in the program debugging and development process encountered other problems, if can solve, small series will be sorted out the solution.

Ecshop solution for error in high version PHP

1. Ecshop hint Strict standards:non-static method cls_image

:: Gd_version () should not being called statically ine:/wwwroot/weirenchou/includes/lib_base.php on line 346

Find 346 rows.

Return Cls_image::gd_version ()

Replace with:

$p = new Cls_image (); return $p->gd_version ();

2. The following error occurred when Ecshop:

Deprecated:preg_replace (): the/e modifier is Deprecated, use Preg_replace_callback instead in/ecshop/includes/cls_temp Late.php on line 300

Open the Ecshop directory to find includes/cls_template.php to line No. 300

Put

Return Preg_replace ("/{([^/}/{/n]*)}/e", "/$this->select ('//1 ');", $source);

Replaced by

Return Preg_replace_callback ("/{([^/}/{/n]*)}/", function ($r) {return $this->select ($r [1]);}, $source);

3. Strict standards:only variables should be passed by reference in e:/web/shopex/includes/cls_template.php on line 422

$tag _sel = Array_shift (Explode (", $tag));

Change to:

$tag _arr = Explode (", $tag); $tag _sel = Array_shift ($tag _arr);

4. Membership Integration appears

Phpbb::set_cookie () should is compatible with integrate/includes/modules/integrates/phpbb.php on line 232110 function Set_cookie ($username = "")

Modified into

function Set_cookie ($username = "", $remember = NULL) includes/modules/integrates/phpwind6.php

ucenter.php vbb.php also modified

ucenter.php 210 Line modified into

function Add_user ($username, $password, $email, $gender =-1, $bday = 0, $reg _date = 0, $md 5password = ")

127 lines are modified into

function login ($username, $password, $remember = NULL)

5. Database backup appears

Edefining already defined constructor for class cls_sql_dump/admin/includes/cls_sql_dump.php on line  function __ Construct (& $db, $max _size =)  {    $this->cls_sql_dump ($db, $max _size);  }

Move to function Cls_sql_dump (& $db, $max _size=0) front

Non-static method Cls_sql_dump::get_random_name () admin/database.php on line 64

Open includes/cls_sql_dump.php

479 rows

function Get_random_name ()

Modified into

static function Get_random_name ()
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.