Skip to content

Commit c24b6a7

Browse files
committed
Added ability to easily put a site in maintenance mode by changing the 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.
1 parent 528972f commit c24b6a7

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

index.php

+11
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@
77
* @see http://kohanaphp.com
88
*/
99

10+
/**
11+
* This checks to see if the site is in maintenance mode. Put your site
12+
* in maintenance mode by putting a 'maintenance.php' file in the root
13+
* directory of your site. (Same directory as this index.php file)
14+
*
15+
*/
16+
if(file_exists('maintenance.php')){
17+
header("Status: 503 Service Temporarily Unavailable");
18+
die(file_get_contents('maintenance.php'));
19+
}
20+
1021
/**
1122
* Define the website environment status. When this flag is set to TRUE, some
1223
* module demonstration controllers will result in 404 errors. For more information

maintenance_off.php

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This website is currently undergoing maintenance. Please try again later.

0 commit comments

Comments
 (0)