mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Slightly improve error message when the user specifies a bogus
config file.
This commit is contained in:
parent
bb79418615
commit
c72d9980d5
2 changed files with 18 additions and 11 deletions
|
@ -18,7 +18,7 @@
|
|||
|
||||
function phabricator_read_config_file($config) {
|
||||
$root = dirname(dirname(__FILE__));
|
||||
$conf = include $root.'/conf/'.$config.'.conf.php';
|
||||
$conf = @include $root.'/conf/'.$config.'.conf.php';
|
||||
if ($conf === false) {
|
||||
throw new Exception("Failed to read config file '{$config}'.");
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ if (!isset($_REQUEST['__path__'])) {
|
|||
|
||||
require_once dirname(dirname(__FILE__)).'/conf/__init_conf__.php';
|
||||
|
||||
try {
|
||||
$conf = phabricator_read_config_file($env);
|
||||
$conf['phabricator.env'] = $env;
|
||||
|
||||
|
@ -57,8 +58,14 @@ phutil_require_module('phabricator', 'aphront/console/plugin/xhprof/api');
|
|||
DarkConsoleXHProfPluginAPI::hookProfiler();
|
||||
|
||||
phutil_require_module('phabricator', 'aphront/console/plugin/errorlog/api');
|
||||
set_error_handler(array('DarkConsoleErrorLogPluginAPI', 'handleError'));
|
||||
set_exception_handler(array('DarkConsoleErrorLogPluginAPI', 'handleException'));
|
||||
set_error_handler(
|
||||
array('DarkConsoleErrorLogPluginAPI', 'handleError'));
|
||||
set_exception_handler(
|
||||
array('DarkConsoleErrorLogPluginAPI', 'handleException'));
|
||||
} catch (Exception $ex) {
|
||||
phabricator_fatal_config_error(
|
||||
"[Exception] ".$ex->getMessage());
|
||||
}
|
||||
|
||||
$tz = PhabricatorEnv::getEnvConfig('phabricator.timezone');
|
||||
if ($tz) {
|
||||
|
|
Loading…
Reference in a new issue