From 42806b1cbfe501c77d9fc3ccf665cb3e5ee2715e Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 28 Apr 2014 09:43:21 -0400 Subject: [PATCH] CC-5802: Upgrade application.ini file --- airtime_mvc/application/controllers/UpgradeController.php | 2 +- airtime_mvc/application/controllers/plugins/Maintenance.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/controllers/UpgradeController.php b/airtime_mvc/application/controllers/UpgradeController.php index 3e383cb0a..ecab01910 100644 --- a/airtime_mvc/application/controllers/UpgradeController.php +++ b/airtime_mvc/application/controllers/UpgradeController.php @@ -24,7 +24,7 @@ class UpgradeController extends Zend_Controller_Action //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'; + $maintenanceFile = isset($_SERVER['AIRTIME_BASE']) ? $_SERVER['AIRTIME_BASE']."maintenance.txt" : "/tmp/maintenance.txt"; $file = fopen($maintenanceFile, 'w'); fclose($file); diff --git a/airtime_mvc/application/controllers/plugins/Maintenance.php b/airtime_mvc/application/controllers/plugins/Maintenance.php index 46937f582..f6baf6201 100644 --- a/airtime_mvc/application/controllers/plugins/Maintenance.php +++ b/airtime_mvc/application/controllers/plugins/Maintenance.php @@ -2,10 +2,10 @@ class Zend_Controller_Plugin_Maintenance extends Zend_Controller_Plugin_Abstract { - protected $maintenanceFile = '/tmp/maintenance.txt'; - public function preDispatch(Zend_Controller_Request_Abstract $request) { - if (file_exists($this->maintenanceFile)) { + $maintenanceFile = isset($_SERVER['AIRTIME_BASE']) ? $_SERVER['AIRTIME_BASE']."maintenance.txt" : "/tmp/maintenance.txt"; + + if (file_exists($maintenanceFile)) { $request->setModuleName('default') ->setControllerName('index') ->setActionName('maintenance')