Skip to content

Commit bed4638

Browse files
committed
Backported display_errors-handling to sf1
1 parent 8bc7519 commit bed4638

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/config/sfApplicationConfiguration.class.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,15 @@ public function initConfiguration()
128128
}
129129

130130
// error settings
131-
ini_set('display_errors', $this->isDebug() ? 'on' : 'off');
131+
if (!in_array(PHP_SAPI, array('cli', 'phpdbg', 'embed'), true)) {
132+
ini_set('display_errors', 0);
133+
} elseif (
134+
!filter_var(ini_get('log_errors'), FILTER_VALIDATE_BOOLEAN)
135+
|| ini_get('error_log')
136+
) {
137+
// CLI - display errors only if they're not already logged to STDERR
138+
ini_set('display_errors', 1);
139+
}
132140
error_reporting(sfConfig::get('sf_error_reporting'));
133141

134142
// initialize plugin configuration objects

0 commit comments

Comments
 (0)