forked from GithubBackups/vichan
By default, no longer treat deprecations as errors
Close #363. See also https://www.youtube.com/watch?v=9crnlHLVdno
This commit is contained in:
parent
a2ba03849f
commit
5e809047ad
@ -45,6 +45,9 @@
|
|||||||
$config['debug'] = false;
|
$config['debug'] = false;
|
||||||
// For development purposes. Displays (and "dies" on) all errors and warnings. Turn on with the above.
|
// For development purposes. Displays (and "dies" on) all errors and warnings. Turn on with the above.
|
||||||
$config['verbose_errors'] = true;
|
$config['verbose_errors'] = true;
|
||||||
|
// Warn about deprecations? See vichan-devel/vichan#363 and https://www.youtube.com/watch?v=9crnlHLVdno
|
||||||
|
$config['deprecation_errors'] = false;
|
||||||
|
|
||||||
// EXPLAIN all SQL queries (when in debug mode).
|
// EXPLAIN all SQL queries (when in debug mode).
|
||||||
$config['debug_explain'] = false;
|
$config['debug_explain'] = false;
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
* Copyright (c) 2010-2014 Tinyboard Development Group
|
* Copyright (c) 2010-2014 Tinyboard Development Group
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
if (realpath($_SERVER['SCRIPT_FILENAME']) == str_replace('\\', '/', __FILE__)) {
|
if (realpath($_SERVER['SCRIPT_FILENAME']) == str_replace('\\', '/', __FILE__)) {
|
||||||
// You cannot request this file directly.
|
// You cannot request this file directly.
|
||||||
exit;
|
exit;
|
||||||
@ -279,7 +280,7 @@ function loadConfig() {
|
|||||||
|
|
||||||
if ($config['verbose_errors']) {
|
if ($config['verbose_errors']) {
|
||||||
set_error_handler('verbose_error_handler');
|
set_error_handler('verbose_error_handler');
|
||||||
error_reporting(E_ALL);
|
error_reporting($config['deprecation_errors'] ? E_ALL : E_ALL & ~E_DEPRECATED);
|
||||||
ini_set('display_errors', true);
|
ini_set('display_errors', true);
|
||||||
ini_set('html_errors', false);
|
ini_set('html_errors', false);
|
||||||
} else {
|
} else {
|
||||||
@ -377,8 +378,13 @@ function _syslog($priority, $message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function verbose_error_handler($errno, $errstr, $errfile, $errline) {
|
function verbose_error_handler($errno, $errstr, $errfile, $errline) {
|
||||||
|
global $config;
|
||||||
|
|
||||||
if (error_reporting() == 0)
|
if (error_reporting() == 0)
|
||||||
return false; // Looks like this warning was suppressed by the @ operator.
|
return false; // Looks like this warning was suppressed by the @ operator.
|
||||||
|
if ($errno == E_DEPRECATED && !$config['deprecation_errors'])
|
||||||
|
return false;
|
||||||
|
|
||||||
error(utf8tohtml($errstr), true, array(
|
error(utf8tohtml($errstr), true, array(
|
||||||
'file' => $errfile . ':' . $errline,
|
'file' => $errfile . ':' . $errline,
|
||||||
'errno' => $errno,
|
'errno' => $errno,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user