mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 06:42: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,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) {
|
||||
|
|
Loading…
Reference in a new issue