MDL-24755 fixed double define in configonly scripts, credit goes to Aparup Banerjee
authorPetr Skoda <skodak@moodle.org>
Tue, 19 Oct 2010 07:36:22 +0000 (07:36 +0000)
committerPetr Skoda <skodak@moodle.org>
Tue, 19 Oct 2010 07:36:22 +0000 (07:36 +0000)
lib/setup.php

index c955616..1c91ae3 100644 (file)
@@ -165,10 +165,14 @@ if (file_exists("$CFG->dataroot/climaintenance.html")) {
         readfile("$CFG->dataroot/climaintenance.html");
         die;
     } else {
-        define('CLI_MAINTENANCE', true);
+        if (!defined('CLI_MAINTENANCE')) {
+            define('CLI_MAINTENANCE', true);
+        }
     }
 } else {
-    define('CLI_MAINTENANCE', false);
+    if (!defined('CLI_MAINTENANCE')) {
+        define('CLI_MAINTENANCE', false);
+    }
 }
 
 // Detect ajax scripts - they are similar to CLI because we can not redirect, output html, etc.