CC-5814: 'Down for maintenance' page during upgrades

This commit is contained in:
drigato 2014-04-24 16:23:57 -04:00
parent f536a7b1b4
commit 42f3bb17e1
1 changed files with 5 additions and 0 deletions

View File

@ -19,6 +19,8 @@ class UpgradeController extends Zend_Controller_Action
//Disable Airtime UI
//create a temporary maintenance notification file
//when this file is on the server, zend framework redirects all
//requests to the maintenance page and sets a 503 response code
$maintenanceFile = '/tmp/maintenance.txt';
$file = fopen($maintenanceFile, 'w');
fclose($file);
@ -81,7 +83,10 @@ class UpgradeController extends Zend_Controller_Action
$file = new SplFileObject($iniFile, "w");
$file->fwrite($beginning."\n".$newLines.$end);
//delete maintenance.txt to give users access back to Airtime
unlink($maintenanceFile);
//TODO: clear out the cache
$this->getResponse()
->setHttpResponseCode(200)