* finish task #8701.
This commit is contained in:
@@ -727,6 +727,37 @@ class baseHelper
|
||||
session_id($sessionID);
|
||||
session_start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check DB to repair table.
|
||||
*
|
||||
* @param object $exception
|
||||
* @static
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public static function checkDB2Repair($exception)
|
||||
{
|
||||
global $config, $lang;
|
||||
|
||||
$repairCode = '|1034|1035|1194|1195|1459|';
|
||||
$errorInfo = $exception->errorInfo;
|
||||
$errorCode = $errorInfo[1];
|
||||
$errorMsg = $errorInfo[2];
|
||||
$message = $exception->getMessage();
|
||||
|
||||
if(strpos($repairCode, "|$errorCode|") !== false or ($errorCode == '1016' and strpos($errorMsg, 'errno: 145') !== false) or strpos($message, 'repair') !== false)
|
||||
{
|
||||
if(isset($config->framework->autoRepairTable) and $config->framework->autoRepairTable)
|
||||
{
|
||||
header("location: " . $config->webRoot . 'checktable.php');
|
||||
exit;
|
||||
}
|
||||
return $lang->repairTable;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------- 常用函数。Some tool functions.-------------------------------//
|
||||
|
||||
Reference in New Issue
Block a user