Port from master
This commit is contained in:
@ -49,34 +49,21 @@ $serendipity['version'] = '2.0-alpha1';
|
||||
|
||||
// Setting this to 'false' will enable debugging output. All alpa/beta/cvs snapshot versions will emit debug information by default. To increase the debug level (to enable Smarty debugging), set this flag to 'debug'.
|
||||
if (!isset($serendipity['production'])) {
|
||||
$serendipity['production'] = (preg_match('@\-(alpha|beta|cvs)@', $serendipity['version']) ? false : true);
|
||||
$serendipity['production'] = (preg_match('@\-(alpha|beta|cvs|rc)@', $serendipity['version']) ? false : true);
|
||||
}
|
||||
|
||||
// Set error reporting
|
||||
// TODO: E_STRICT throws problematic errors due to "hook_event" being a static function, but all of our plugins don't really define that...
|
||||
error_reporting(E_ALL & ~E_NOTICE ^ E_STRICT);
|
||||
error_reporting(E_ALL & ~(E_STRICT|E_NOTICE));
|
||||
|
||||
if ($serendipity['production'] !== true) {
|
||||
if ($serendipity['production'] === 'debug') {
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
@ini_set('display_errors', 'on');
|
||||
}
|
||||
|
||||
|
||||
// The serendipity errorhandler string
|
||||
$serendipity['errorhandler'] = 'errorToExceptionHandler';
|
||||
|
||||
//[internal callback function]: errorToExceptionHandler()
|
||||
if(is_callable($serendipity['errorhandler'], false, $callable_name)) {
|
||||
// set serendipity global error to exeption handler
|
||||
#if ($serendipity['production'] === 'debug') {
|
||||
# set_error_handler($serendipity['errorhandler'], E_ALL);
|
||||
#} else {
|
||||
// Caution! If we want to have the same noshow effect as upper set error_reporting(E_ALL) in 'debug' mode,
|
||||
// do not clone it to set_error_handler(E_ALL), else everythimg is haltet to debug, which makes using debug obsolet.
|
||||
set_error_handler($serendipity['errorhandler'], E_ALL & ~E_NOTICE ^ E_STRICT);
|
||||
#}
|
||||
}
|
||||
|
||||
// Default rewrite method
|
||||
$serendipity['rewrite'] = 'none';
|
||||
@ -146,7 +133,7 @@ if (!isset($serendipity['languages'])) {
|
||||
'fi' => 'Finnish',
|
||||
'cs' => 'Czech (Win-1250)',
|
||||
'cz' => 'Czech (ISO-8859-2)',
|
||||
'sk' => 'Slovak',
|
||||
'sk' => 'Slovak',
|
||||
'nl' => 'Dutch',
|
||||
'is' => 'Icelandic',
|
||||
'tr' => 'Turkish',
|
||||
@ -266,6 +253,22 @@ if (!is_readable($local_config)) {
|
||||
|
||||
include($local_config);
|
||||
|
||||
if ($serendipity['production'] === 'debug') {
|
||||
error_reporting(E_ALL &~E_NOTICE | E_STRICT);
|
||||
}
|
||||
|
||||
//[internal callback function]: errorToExceptionHandler()
|
||||
if(is_callable($serendipity['errorhandler'], false, $callable_name)) {
|
||||
// set serendipity global error to exeption handler
|
||||
if ($serendipity['production'] === 'debug') {
|
||||
set_error_handler($serendipity['errorhandler'], error_reporting()); // Yes, DEBUG mode should actually report E_STRICT errors! In PHP 5.4s is contained in E_ALL already, but not in PHP 5.2.
|
||||
} else {
|
||||
// Caution! If we want to have the same noshow effect as upper set error_reporting(E_ALL) in 'debug' mode,
|
||||
// do not clone it to set_error_handler(E_ALL), else everythimg is haltet to debug, which makes using debug obsolet.
|
||||
set_error_handler($serendipity['errorhandler'], E_ALL & ~(E_NOTICE|E_STRICT));
|
||||
}
|
||||
}
|
||||
|
||||
define('IS_up2date', version_compare($serendipity['version'], $serendipity['versionInstalled'], '<='));
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user