From 42f3bb17e193a6aa1b59f6b6431ff93c1eea5eec Mon Sep 17 00:00:00 2001 From: drigato Date: Thu, 24 Apr 2014 16:23:57 -0400 Subject: [PATCH] CC-5814: 'Down for maintenance' page during upgrades --- airtime_mvc/application/controllers/UpgradeController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/airtime_mvc/application/controllers/UpgradeController.php b/airtime_mvc/application/controllers/UpgradeController.php index c09d58953..ae7ad3e7e 100644 --- a/airtime_mvc/application/controllers/UpgradeController.php +++ b/airtime_mvc/application/controllers/UpgradeController.php @@ -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)