diff --git a/lib/setup.php b/lib/setup.php index a8300ce8eef..560e6b76441 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -88,6 +88,14 @@ global $THEME; $dbconnected = $db->Connect($CFG->dbhost,$CFG->dbuser,$CFG->dbpass,$CFG->dbname); } if (! $dbconnected) { + // In the name of protocol correctness, monitoring and performance + // profiling, set the appropriate error headers for machine comsumption + if (isset($_SERVER['SERVER_PROTOCOL'])) { + // Avoid it with cron.php. Note that we assume it's HTTP/1.x + header($_SERVER['SERVER_PROTOCOL'] . ' 503 Service Unavailable'); + } + // and then for human consumption... + echo '
'; echo '