1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 11:30:55 +01:00

Fix startup issue with access log

Summary: Fixes T2930. We may not have an access log here yet -- I got a little too overeager with D5533.

Test Plan:
Faked gpc quotes and got a nice error instead of a blank screen:

{F39821}

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2930

Differential Revision: https://secure.phabricator.com/D5630
This commit is contained in:
epriestley 2013-04-09 11:27:37 -07:00
parent 46c7b46516
commit 0ad05e911b

View file

@ -191,14 +191,19 @@ final class PhabricatorStartup {
self::endOutputCapture();
$access_log = self::getGlobal('log.access');
try {
$access_log->setData(
array(
'c' => 500,
));
$access_log->write();
} catch (Exception $ex) {
$message .= "\n(Moreover, unable to write to access log.)";
if ($access_log) {
// We may end up here before the access log is initialized, e.g. from
// verifyPHP().
try {
$access_log->setData(
array(
'c' => 500,
));
$access_log->write();
} catch (Exception $ex) {
$message .= "\n(Moreover, unable to write to access log.)";
}
}
header(