當前位置: 首頁>>代碼示例>>PHP>>正文


PHP History::append方法代碼示例

本文整理匯總了PHP中History::append方法的典型用法代碼示例。如果您正苦於以下問題:PHP History::append方法的具體用法?PHP History::append怎麽用?PHP History::append使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在History的用法示例。


在下文中一共展示了History::append方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testPositioning

 public function testPositioning()
 {
     $other_file = tempnam(sys_get_temp_dir() . 'tmp', 'history');
     $el1 = $this->_history->append($other_file);
     $el2 = $this->_history->append($other_file);
     $el3 = $this->_history->append($other_file);
     $this->assertEquals(3, $this->_history->getCount());
     $this->assertEquals($el3, $this->_history->getFirst());
     $this->assertEquals($el1, $this->_history->getLast());
     $this->assertEquals($el2, $this->_history->getNth(1));
     $this->assertEquals($el1, $this->_history->getNext());
     $this->assertFalse($this->_history->getNext());
     unlink($other_file);
 }
開發者ID:jgera,項目名稱:sugarcrm_dev,代碼行數:14,代碼來源:HistoryTest.php

示例2: createHistoryLog

 /**
  * Create a history copy of the custom file that will be merged so that it can be access through
  * studio if admins wish to revert at a later date.
  *
  * @param STRING $module - name of the module
  * @param STRING $file - name of the file
  * @param STRING $customFile - Path to the custom file that will be merged
  */
 protected function createHistoryLog($module, $customFile, $file)
 {
     $historyPath = 'custom/' . MB_HISTORYMETADATALOCATION . "/modules/{$module}/metadata/{$file}";
     $history = new History($historyPath);
     $timeStamp = $history->append($customFile);
     $GLOBALS['log']->debug("Created history file after merge with new file: " . $historyPath . '_' . $timeStamp);
 }
開發者ID:netconstructor,項目名稱:sugarcrm_dev,代碼行數:15,代碼來源:SugarMerge.php


注:本文中的History::append方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。