Added comments to missing table civicrm_mailing_abtest in 4.6.alpha1.mysql.tpl
[civicrm-core.git] / CRM / Upgrade / Headless.php
index 7c0f96ef702a6516c4f1ff41f38c63f3e0e7389e..a63c15ba7ff14cc27673947affea6796c2f5a527 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  * Perform an upgrade without using the web-frontend
@@ -33,11 +33,13 @@ class CRM_Upgrade_Headless {
   /**
    * Perform an upgrade without using the web-frontend
    *
+   * @param bool $enablePrint
+   *
+   * @throws Exception
    * @return array, with keys:
    *   - message: string, HTML-ish blob
-   * @throws Exception
    */
-  function run($enablePrint = TRUE) {
+  public function run($enablePrint = TRUE) {
     // lets get around the time limit issue if possible for upgrades
     if (!ini_get('safe_mode')) {
       set_time_limit(0);
@@ -59,16 +61,16 @@ class CRM_Upgrade_Headless {
 
     $postUpgradeMessageFile = CRM_Utils_File::tempnam('civicrm-post-upgrade');
     $queueRunner = new CRM_Queue_Runner(array(
-        'title' => ts('CiviCRM Upgrade Tasks'),
-        'queue' => CRM_Upgrade_Form::buildQueue($currentVer, $latestVer, $postUpgradeMessageFile),
-      ));
+      'title' => ts('CiviCRM Upgrade Tasks'),
+      'queue' => CRM_Upgrade_Form::buildQueue($currentVer, $latestVer, $postUpgradeMessageFile),
+    ));
     $queueResult = $queueRunner->runAll();
     if ($queueResult !== TRUE) {
       $errorMessage = CRM_Core_Error::formatTextException($queueResult['exception']);
       CRM_Core_Error::debug_log_message($errorMessage);
       if ($enablePrint) {
-        print($errorMessage);
-    }
+        print ($errorMessage);
+      }
       throw $queueResult['exception']; // FIXME test
     }
 
@@ -79,5 +81,5 @@ class CRM_Upgrade_Headless {
       'message' => file_get_contents($postUpgradeMessageFile),
     );
   }
-}
 
+}