当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Upgrade_Form::setPreUpgradeMessage方法代码示例

本文整理汇总了PHP中CRM_Upgrade_Form::setPreUpgradeMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Upgrade_Form::setPreUpgradeMessage方法的具体用法?PHP CRM_Upgrade_Form::setPreUpgradeMessage怎么用?PHP CRM_Upgrade_Form::setPreUpgradeMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Upgrade_Form的用法示例。


在下文中一共展示了CRM_Upgrade_Form::setPreUpgradeMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: runIntro

 /**
  * Display an introductory screen with any pre-upgrade messages
  */
 public function runIntro()
 {
     $upgrade = new CRM_Upgrade_Form();
     $template = CRM_Core_Smarty::singleton();
     list($currentVer, $latestVer) = $upgrade->getUpgradeVersions();
     if ($error = $upgrade->checkUpgradeableVersion($currentVer, $latestVer)) {
         CRM_Core_Error::fatal($error);
     }
     $config = CRM_Core_Config::singleton();
     // All cached content needs to be cleared because the civi codebase was just replaced
     CRM_Core_Resources::singleton()->flushStrings()->resetCacheCode();
     CRM_Core_Menu::store();
     // cleanup only the templates_c directory
     $config->cleanup(1, FALSE);
     $preUpgradeMessage = NULL;
     $upgrade->setPreUpgradeMessage($preUpgradeMessage, $currentVer, $latestVer);
     $template->assign('currentVersion', $currentVer);
     $template->assign('newVersion', $latestVer);
     $template->assign('upgradeTitle', ts('Upgrade CiviCRM from v %1 To v %2', array(1 => $currentVer, 2 => $latestVer)));
     $template->assign('upgraded', FALSE);
     // Render page header
     if (!defined('CIVICRM_UF_HEAD') && ($region = CRM_Core_Region::instance('html-header', FALSE))) {
         CRM_Utils_System::addHTMLHead($region->render(''));
     }
     $template->assign('preUpgradeMessage', $preUpgradeMessage);
     $content = $template->fetch('CRM/common/success.tpl');
     echo CRM_Utils_System::theme($content, $this->_print, TRUE);
 }
开发者ID:rameshrr99,项目名称:civicrm-core,代码行数:31,代码来源:Upgrade.php

示例2: run

 /**
  * Perform an upgrade without using the web-frontend
  *
  * @param bool $enablePrint
  *
  * @throws Exception
  * @return array, with keys:
  *   - message: string, HTML-ish blob
  */
 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);
     }
     $upgrade = new CRM_Upgrade_Form();
     list($currentVer, $latestVer) = $upgrade->getUpgradeVersions();
     if ($error = $upgrade->checkUpgradeableVersion($currentVer, $latestVer)) {
         throw new Exception($error);
     }
     // Disable our SQL triggers
     CRM_Core_DAO::dropTriggers();
     // CRM-11156
     $preUpgradeMessage = NULL;
     $upgrade->setPreUpgradeMessage($preUpgradeMessage, $currentVer, $latestVer);
     $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)));
     $queueResult = $queueRunner->runAll();
     if ($queueResult !== TRUE) {
         $errorMessage = CRM_Core_Error::formatTextException($queueResult['exception']);
         CRM_Core_Error::debug_log_message($errorMessage);
         if ($enablePrint) {
             print $errorMessage;
         }
         throw $queueResult['exception'];
         // FIXME test
     }
     CRM_Upgrade_Form::doFinish();
     $message = file_get_contents($postUpgradeMessageFile);
     return array('latestVer' => $latestVer, 'message' => $message, 'text' => CRM_Utils_String::htmlToText($message));
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:41,代码来源:Headless.php

示例3: runIntro

 /**
  * Display an introductory screen with any pre-upgrade messages
  */
 function runIntro()
 {
     $upgrade = new CRM_Upgrade_Form();
     $template = CRM_Core_Smarty::singleton();
     list($currentVer, $latestVer) = $upgrade->getUpgradeVersions();
     if ($error = $upgrade->checkUpgradeableVersion($currentVer, $latestVer)) {
         CRM_Core_Error::fatal($error);
     }
     // This could be removed in later rev
     if ($currentVer == '2.1.6') {
         $config = CRM_Core_Config::singleton();
         // also cleanup the templates_c directory
         $config->cleanupCaches();
     } else {
         $config = CRM_Core_Config::singleton();
         // cleanup only the templates_c directory
         $config->cleanup(1, FALSE);
     }
     // end of hack
     $preUpgradeMessage = NULL;
     $upgrade->setPreUpgradeMessage($preUpgradeMessage, $currentVer, $latestVer);
     $template->assign('currentVersion', $currentVer);
     $template->assign('newVersion', $latestVer);
     $template->assign('upgradeTitle', ts('Upgrade CiviCRM from v %1 To v %2', array(1 => $currentVer, 2 => $latestVer)));
     $template->assign('upgraded', FALSE);
     // Render page header
     if (!defined('CIVICRM_UF_HEAD') && ($region = CRM_Core_Region::instance('html-header', FALSE))) {
         CRM_Utils_System::addHTMLHead($region->render(''));
     }
     $template->assign('preUpgradeMessage', $preUpgradeMessage);
     // $template->assign( 'message', $postUpgradeMessage );
     $content = $template->fetch('CRM/common/success.tpl');
     echo CRM_Utils_System::theme($content, $this->_print, TRUE);
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:37,代码来源:Upgrade.php


注:本文中的CRM_Upgrade_Form::setPreUpgradeMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。