views-upgrade-error : helper method to detect upgrade mode. this is used in civicrm...
authorPratik Joshi <pratik.joshi@webaccess.co.in>
Wed, 14 May 2014 12:44:12 +0000 (18:14 +0530)
committerPratik Joshi <pratik.joshi@webaccess.co.in>
Wed, 14 May 2014 12:44:12 +0000 (18:14 +0530)
CRM/Utils/System.php

index 7573b034beae5b5ee15cfa53741627125ac42915..d42f699ac17cc2d828cc76ee18f50eebe99ca824 100644 (file)
@@ -1815,6 +1815,15 @@ class CRM_Utils_System {
     }
     return $cache;
   }
-}
-
 
+  static function isInUpgradeMode() {
+    $args = explode('/', $_GET['q']);
+    $upgradeInProcess = CRM_Core_Session::singleton()->get('isUpgradePending');
+    if ((isset($args[1]) && $args[1] == 'upgrade') || $upgradeInProcess) {
+      return TRUE;
+    }
+    else {
+      return FALSE;
+    }
+  }
+}
\ No newline at end of file