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


PHP vB_Cache::resetAllCache方法代碼示例

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


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

示例1: restorePage

 /**
  * Restores a page.
  *
  * Specifically, this restores the page, page template, and route
  * information so it reflects the values present at initial install. This is meant
  * to be used only on the vBulletin default pages.
  *
  * @param  string Page GUID
  * @param  bool   Print the Page title or not
  */
 public function restorePage($guid, $printMessage = true)
 {
     $xmlpage = $this->xml['page'][$guid];
     $xmlroute = $this->getXmlRouteByPageGuid($xmlpage['guid']);
     $xmlpagetemplate = $this->getXmlPageTemplateByPageGuid($xmlpage['guid']);
     $dbpage = $this->getMatchingPageFromDbByXmlGuid($xmlpage['guid']);
     $dbroute = $this->getDbRouteByRouteId($dbpage['routeid']);
     $dbpagetemplate = $this->getDbPageTemplateByPageTemplateId($dbpage['pagetemplateid']);
     if ($printMessage) {
         echo $xmlpage['title'];
     }
     // delete existing records
     $this->assertor->delete('page', array('guid' => $xmlpage['guid']));
     $this->assertor->delete('pagetemplate', array('guid' => $xmlpagetemplate['guid']));
     $this->assertor->delete('routenew', array('guid' => $xmlroute['guid']));
     // remove name from current db route so xml route can be restored w/o an index conflict
     if ($dbroute['guid'] != $xmlroute['guid']) {
         $this->assertor->update('routenew', array('name' => vB_dB_Query::VALUE_ISNULL), array('routeid' => $dbroute['routeid']));
     }
     // restore pagetemplate record
     $options = vB_Xml_Import::OPTION_OVERWRITE;
     $xml_importer = new vB_Xml_Import_PageTemplate('vbulletin', $options);
     $xml_importer->importFromFile("{$this->xmldir}/vbulletin-pagetemplates.xml", $xmlpagetemplate['guid']);
     $xml_importer->replacePhrasePlaceholdersInWidgetConfigs();
     // restore page record
     $options = vB_Xml_Import::OPTION_OVERWRITE;
     $xml_importer = new vB_Xml_Import_Page('vbulletin', $options);
     $xml_importer->importFromFile("{$this->xmldir}/vbulletin-pages.xml", $xmlpage['guid']);
     // restore route record
     $options = vB_Xml_Import::OPTION_OVERWRITE;
     $xml_importer = new vB_Xml_Import_Route('vbulletin', $options);
     $xml_importer->importFromFile("{$this->xmldir}/vbulletin-routes.xml", $xmlroute['guid']);
     // update page route
     $xml_importer = new vB_Xml_Import_Page('vbulletin', 0);
     $parsedXML = $xml_importer->parseFile("{$this->xmldir}/vbulletin-pages.xml");
     $xml_importer->updatePageRoutes($parsedXML);
     // get the new route
     $newRoute = $this->assertor->getRow('routenew', array('guid' => $xmlroute['guid']));
     // set previous db route to 301 redirect
     if ($dbroute['guid'] != $xmlroute['guid']) {
         $this->assertor->update('routenew', array('redirect301' => $newRoute['routeid']), array('routeid' => $dbroute['routeid']));
     }
     // update node routeid
     $this->assertor->update('vbForum:node', array('routeid' => $newRoute['routeid']), array('routeid' => $dbroute['routeid']));
     // clear cache
     vB_Cache::resetAllCache();
 }
開發者ID:cedwards-reisys,項目名稱:nexus-web,代碼行數:57,代碼來源:pagerestore.php


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