diff options
author | rvelices <rv-github@modusoptimus.com> | 2008-09-05 01:24:01 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2008-09-05 01:24:01 +0000 |
commit | b8a5fde84629cdc4885016b76c90d9836c4f65b0 (patch) | |
tree | 0120912c4862214944e2689c49c44c095f112810 /include/common.inc.php | |
parent | 116f1bc4fb9c2825a87d7fab9dbfdde78434431a (diff) |
- better management of fatal errors (instead of die or trigger_error rather use fatal_error ...)
git-svn-id: http://piwigo.org/svn/trunk@2502 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/common.inc.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/common.inc.php b/include/common.inc.php index a762eeade..1ddebfc9b 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -21,10 +21,8 @@ // | USA. | // +-----------------------------------------------------------------------+ -if (!defined('PHPWG_ROOT_PATH')) -{ - die('Hacking attempt!'); -} +defined('PHPWG_ROOT_PATH') or trigger_error('Hacking attempt!', E_USER_ERROR); + // determine the initial instant to indicate the generation time of this page $t1 = explode( ' ', microtime() ); $t2 = explode( '.', $t1[0] ); @@ -146,7 +144,7 @@ include(PHPWG_ROOT_PATH . 'include/template.class.php'); @mysql_select_db( $cfgBase ) or my_error( 'mysql_select_db', true ); defined('PWG_CHARSET') and defined('DB_CHARSET') - or die('PWG_CHARSET and/or DB_CHARSET is not defined'); + or fatal_error('PWG_CHARSET and/or DB_CHARSET is not defined'); if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) { if (DB_CHARSET!='') @@ -158,7 +156,7 @@ else { if ( strtolower(PWG_CHARSET)!='iso-8859-1' ) { - die('PWG supports only iso-8859-1 charset on MySql version '.mysql_get_server_info()); + fatal_error('PWG supports only iso-8859-1 charset on MySql version '.mysql_get_server_info()); } } |