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


PHP CRM_Upgrade_Form::getRevisionPart方法代码示例

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


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

示例1: buildQueue

 /**
  * Fill the queue with upgrade tasks.
  *
  * @param string $currentVer
  *   the original revision.
  * @param string $latestVer
  *   the target (final) revision.
  * @param string $postUpgradeMessageFile
  *   path of a modifiable file which lists the post-upgrade messages.
  *
  * @return CRM_Queue_Service
  */
 public static function buildQueue($currentVer, $latestVer, $postUpgradeMessageFile)
 {
     $upgrade = new CRM_Upgrade_Form();
     // hack to make 4.0.x (D7,J1.6) codebase go through 3.4.x (d6, J1.5) upgrade files,
     // since schema wise they are same
     if (CRM_Upgrade_Form::getRevisionPart($currentVer) == '4.0') {
         $currentVer = str_replace('4.0.', '3.4.', $currentVer);
     }
     // Ensure that queue can be created
     if (!CRM_Queue_BAO_QueueItem::findCreateTable()) {
         CRM_Core_Error::fatal(ts('Failed to find or create queueing table'));
     }
     $queue = CRM_Queue_Service::singleton()->create(array('name' => self::QUEUE_NAME, 'type' => 'Sql', 'reset' => TRUE));
     $revisions = $upgrade->getRevisionSequence();
     foreach ($revisions as $rev) {
         // proceed only if $currentVer < $rev
         if (version_compare($currentVer, $rev) < 0) {
             $beginTask = new CRM_Queue_Task(array('CRM_Upgrade_Form', 'doIncrementalUpgradeStart'), array($rev), "Begin Upgrade to {$rev}");
             $queue->createItem($beginTask);
             $task = new CRM_Queue_Task(array('CRM_Upgrade_Form', 'doIncrementalUpgradeStep'), array($rev, $currentVer, $latestVer, $postUpgradeMessageFile), "Upgrade DB to {$rev}");
             $queue->createItem($task);
             $task = new CRM_Queue_Task(array('CRM_Upgrade_Form', 'doIncrementalUpgradeFinish'), array($rev, $currentVer, $latestVer, $postUpgradeMessageFile), "Finish Upgrade DB to {$rev}");
             $queue->createItem($task);
         }
     }
     return $queue;
 }
开发者ID:nganivet,项目名称:civicrm-core,代码行数:39,代码来源:Form.php


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