Permalink
Browse files

Added ability to easily put a site in maintenance mode by changing th…

…e name of maintenance_off.php to maintenance.php. Reasoning behind using this method is a bash script for updating Ushahidi can be set up to rename the file at the beginning and the end of the update to automatically put the site in maintenance mode and then take it out.
  • Loading branch information...
1 parent 528972f commit c24b6a70104921eaf3d7492516a5603a59394e31 @brianherbert brianherbert committed Sep 23, 2011
Showing with 12 additions and 0 deletions.
  1. +11 −0 index.php
  2. +1 −0 maintenance_off.php
View
11 index.php
@@ -8,6 +8,17 @@
*/
/**
+ * This checks to see if the site is in maintenance mode. Put your site
+ * in maintenance mode by putting a 'maintenance.php' file in the root
+ * directory of your site. (Same directory as this index.php file)
+ *
+ */
+if(file_exists('maintenance.php')){
+ header("Status: 503 Service Temporarily Unavailable");
+ die(file_get_contents('maintenance.php'));
+}
+
+/**
* Define the website environment status. When this flag is set to TRUE, some
* module demonstration controllers will result in 404 errors. For more information
* about this option, read the documentation about deploying Kohana.
View
1 maintenance_off.php
@@ -0,0 +1 @@
+This website is currently undergoing maintenance. Please try again later.

0 comments on commit c24b6a7

Please sign in to comment.