ecshop错误提示:Strict standards: Redefining already defined constructor for class captcha

 ecshop安装使用  2297浏览

今天在登录ecshop的时候,验证码输入错误,出现了Strict standards: Redefining already defined constructor for class captcha的错误提示,更具体的出错信息如下:

( ! ) Strict standards: Redefining already defined constructor for class captcha in C:\develop\wamp\www\ecshop\includes\cls_captcha.php on line 119

那么如何解决Strict standards: Redefining already defined constructor for class captcha错误提示的问题呢?

把cls_captcha.php第119行的__construct函数移至第78行即可。移动后的代码如下:

/**
 * 构造函数
 *
 * @access  public
 * @param
 *
 * @return void
 */
function __construct($folder = '', $width = 145, $height = 20)
{
    $this->captcha($folder, $width, $height,3);
}

/**
 * 构造函数
 *
 * @access  public
 * @param   string  $folder 背景图片所在目录
 * @param   integer $width  图片宽度
 * @param   integer $height 图片高度
 * @return  bool
 */
function captcha($folder = '', $width = 145, $height = 20)
{
    if (!empty($folder))
    {
    $this->folder = $folder;
    }

    $this->width    = $width;
    $this->height   = $height;

    /* 检查是否支持 GD */
    if (PHP_VERSION >= '4.3')
    {

    return (function_exists('imagecreatetruecolor') || function_exists('imagecreate'),3);
    }
    else
    {

    return (((imagetypes() & IMG_GIF) > 0) || ((imagetypes() & IMG_JPG)) > 0 ,3);
    }
}

也就是说,要解决该错误提示,只需要把__construct函数放到captcha($folder = '', $width = 145, $height = 20)函数之前即可。

以下是其他地方出现 Strict standards: Redefining already defined constructor for class错误提示的解决方法。

Strict standards: Redefining already defined constructor for class alipay in C:\develop\wamp\www\ecshopdev\includes\modules\payment\alipay.php on line 85

Strict standards: Redefining already defined constructor for class balance in C:\develop\wamp\www\ecshopdev\includes\modules\payment\balance.php on line 79

Strict standards: Redefining already defined constructor for class bank in C:\develop\wamp\www\ecshopdev\includes\modules\payment\bank.php on line 79

Strict standards: Redefining already defined constructor for class cappay in C:\develop\wamp\www\ecshopdev\includes\modules\payment\cappay.php on line 81

Strict standards: Redefining already defined constructor for class chinabank in C:\develop\wamp\www\ecshopdev\includes\modules\payment\chinabank.php on line 85

Strict standards: Redefining already defined constructor for class cod in C:\develop\wamp\www\ecshopdev\includes\modules\payment\cod.php on line 82

Strict standards: Redefining already defined constructor for class epay in C:\develop\wamp\www\ecshopdev\includes\modules\payment\epay.php on line 83

Strict standards: Redefining already defined constructor for class ips in C:\develop\wamp\www\ecshopdev\includes\modules\payment\ips.php on line 82

Strict standards: Redefining already defined constructor for class kuaiqian in C:\develop\wamp\www\ecshopdev\includes\modules\payment\kuaiqian.php on line 83

Strict standards: Redefining already defined constructor for class paypal in C:\develop\wamp\www\ecshopdev\includes\modules\payment\paypal.php on line 82

Strict standards: Redefining already defined constructor for class paypal_ec in C:\develop\wamp\www\ecshopdev\includes\modules\payment\paypal_ec.php on line 96

Strict standards: Redefining already defined constructor for class post in C:\develop\wamp\www\ecshopdev\includes\modules\payment\post.php on line 79

Strict standards: Redefining already defined constructor for class tenpay in C:\develop\wamp\www\ecshopdev\includes\modules\payment\tenpay.php on line 83

Strict standards: Redefining already defined constructor for class shenzhou in C:\develop\wamp\www\ecshopdev\includes\modules\payment\shenzhou.php on line 81

Strict standards: Redefining already defined constructor for class tenpayc2c in C:\develop\wamp\www\ecshopdev\includes\modules\payment\tenpayc2c.php on line 83

Strict standards: Redefining already defined constructor for class cls_sql_dump in C:\develop\wamp\www\ecshopdev\admin\includes\cls_sql_dump.php on line 90

具体解决方法的代码我就不说了,就是把__construct函数移到相应类的构造函数前面就好了。

流行热度:超过2297次围观
生产日期:2016-03-08 22:01:43
上次围观:2016-09-18 16:31:01
转载时必须以链接形式注明原始出处及本声明。

与本文相关的文章