modified: yotsubanome.php
* @date $Date: 2009-04-06 09:30:13 +0800 (星期一, 06 四月 2009) $
*/
+/**
+ * 更改 PHP 捕捉錯誤功能並顯示自訂錯誤
+ */
+function PMCCore_errorHandler($errno, $errstr, $errfile, $errline){
+ header('Content-type: text/plain;charset=utf-8');
+ switch($errno){
+ case E_USER_ERROR:
+ case E_ERROR:
+ exit('Error: '.$errstr);
+ break;
+ case E_WARNING:
+ exit('Warning: '.$errstr.' '.$errfile.' #'.$errline);
+ break;
+ }
+}
+
/* css data */
$style_load = false;
$style_bar = '';
說明條目可資參考。
*/
-error_reporting(E_ALL); // show all errors for debugging
+
+if(version_compare(PHP_VERSION, '5.0.0', '>=')){ // PHP5+
+ set_error_handler('PMCCore_errorHandler', E_ERROR | E_WARNING | E_USER_ERROR); // Handle Errors
+}else{
+ set_error_handler('PMCCore_errorHandler');
+}
+
+
+//error_reporting(E_ALL); // show all errors for debugging
/* Enviorment Settings */
// Do not change unless you renamed the directories