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);



發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *