本文整理汇总了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();
}