1. 程式人生 > >Bigcommerce:PHP版本升級錯誤解決辦法

Bigcommerce:PHP版本升級錯誤解決辦法

報錯內容一:Strict Standards: Declaration of....should be compatible with .....

Strict Standards: Declaration of ISC_CHECKOUT_PROVIDER::GetPropertiesSheet() should be compatible with ISC_MODULE::GetPropertiesSheet($tab_id, $idGlobal, $jsGlobal, $jsSelectedFunction, $customVars = Array, $moduleId = NULL) in /home/ipcamera/public_html/includes/classes/class.checkoutprovider.php

on line892

報錯的意思:子類重寫的父類的函式,子類函式裡面的引數與父類的引數不對應

檢視檔案class.checkoutprovider.php報錯的892行,GetPropertiesSheet()函式如下

public function GetPropertiesSheet($tabId, $doHeaderRows=true, $moduleId=''){

.....

}

解決方法:GetPropertiesSheet()函式的引數改為父類中的引數,其實直接Copy報錯提示的資訊就可以啦~

更改後:

public function GetPropertiesSheet($tabId,  $idGlobal, $jsGlobal, $jsSelectedFunction, $customVars = Array(), $moduleId = NULL)
{

.....

}

報錯內容二:Strict Standards: Non-static method....should not be called statically in .....

Strict Standards: Non-static method ISC_REDIRECTS::generateRedirectUrl() should not be called statically in/home/ipcamera/public_html/lib/class.redirects.php on line30

報錯的意思:generateRedirectUrl()函式是非靜態宣告,他不可以被靜態(static

)宣告的方法呼叫

檢視檔案class.redirects.php報錯的30行,GetPropertiesSheet()函式如下:

publicstatic function checkRedirect($urlPath)
{
     // @codeCoverageIgnoreStart
     $newUrl = self::generateRedirectUrl($urlPath);

.....

}

public function generateRedirectUrl($urlPath)
{

.....

}

解決方法:generateRedirectUrl()函式改為靜態宣告

更改後:

public static function generateRedirectUrl($urlPath)
{

.....

}

報錯內容三:Strict Standards: mktime(): You should be using the time() function instead in.....

Strict Standards: mktime(): You should be using the time() function instead in/home/ipcamera/public_html/lib/general.php on line 3590

報錯的意思:mktime()方法不帶引數被呼叫時,會被丟擲一個報錯提示

檢視檔案general.php報錯的3590行,如下:

$args = func_get_args();
$result = call_user_func_array("mktime", $args);

解決方法:mktime()方法改為time()方法

更改後:

$args = func_get_args();
$result = call_user_func_array("time", $args);