Skip to content

Commit 05846d5

Browse files
author
epriestley
committed
Ensure syntax errors and other configuration problems are surfaced to the user.
Summary: Some PHP has junky defaults for error_reporting / display_errors, and the "@" silences fatals. The @ should never have been there, I just copied it from the libphutil initializer where we use @ because the default error message can be confusing and we display a more useful one. Test Plan: Added fatals to my conf file, got a decent error message instead of silent exit with err=255. Reviewed By: aran Reviewers: tuomaspelkonen, aran, jungejason CC: aran Differential Revision: 355
1 parent cc5a86f commit 05846d5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

conf/__init_conf__.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
function phabricator_read_config_file($config) {
2020
$root = dirname(dirname(__FILE__));
21-
$conf = @include $root.'/conf/'.$config.'.conf.php';
21+
$conf = include $root.'/conf/'.$config.'.conf.php';
2222
if ($conf === false) {
2323
throw new Exception("Failed to read config file '{$config}'.");
2424
}

scripts/__init_script__.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* limitations under the License.
1717
*/
1818

19+
error_reporting(E_ALL | E_STRICT);
20+
ini_set('display_errors', 1);
21+
1922
$include_path = ini_get('include_path');
2023
ini_set('include_path', $include_path.':'.dirname(__FILE__).'/../../');
2124
@include_once 'libphutil/src/__phutil_library_init__.php';

0 commit comments

Comments
 (0)