MDL-55916 setup: Maintenance mode serves HTTP 503

This commit is contained in:
Brendan Heywood
2016-09-20 11:59:39 +10:00
parent 0344082208
commit f1c6d647bc
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -313,6 +313,9 @@ if (!defined('WS_SERVER')) {
// Detect CLI maintenance mode - this is useful when you need to mess with database, such as during upgrades
if (file_exists("$CFG->dataroot/climaintenance.html")) {
if (!CLI_SCRIPT) {
header($_SERVER['SERVER_PROTOCOL'] . ' 503 Moodle under maintenance');
header('Status: 503 Moodle under maintenance');
header('Retry-After: 300');
header('Content-type: text/html; charset=utf-8');
header('X-UA-Compatible: IE=edge');
/// Headers to make it not cacheable and json