1
0
Fork 0
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:
epriestley 2011-04-05 10:48:36 -07:00
parent bb79418615
commit c72d9980d5
2 changed files with 18 additions and 11 deletions

View file

@ -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}'.");
}

View file

@ -45,20 +45,27 @@ if (!isset($_REQUEST['__path__'])) {
require_once dirname(dirname(__FILE__)).'/conf/__init_conf__.php';
$conf = phabricator_read_config_file($env);
$conf['phabricator.env'] = $env;
try {
$conf = phabricator_read_config_file($env);
$conf['phabricator.env'] = $env;
setup_aphront_basics();
setup_aphront_basics();
phutil_require_module('phabricator', 'infrastructure/env');
PhabricatorEnv::setEnvConfig($conf);
phutil_require_module('phabricator', 'infrastructure/env');
PhabricatorEnv::setEnvConfig($conf);
phutil_require_module('phabricator', 'aphront/console/plugin/xhprof/api');
DarkConsoleXHProfPluginAPI::hookProfiler();
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'));
phutil_require_module('phabricator', 'aphront/console/plugin/errorlog/api');
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) {