本文整理汇总了PHP中XenForo_Template_Compiler::removeTemplateFromCache方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Template_Compiler::removeTemplateFromCache方法的具体用法?PHP XenForo_Template_Compiler::removeTemplateFromCache怎么用?PHP XenForo_Template_Compiler::removeTemplateFromCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Template_Compiler
的用法示例。
在下文中一共展示了XenForo_Template_Compiler::removeTemplateFromCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _postSave
/**
* Post-save handler.
*/
protected function _postSave()
{
$templateModel = $this->_getTemplateModel();
if ($this->isUpdate() && $this->isChanged('template')) {
$this->_db->insert('xf_template_history', array('title' => $this->get('title'), 'style_id' => $this->get('style_id'), 'template' => $this->getExisting('template'), 'edit_date' => $this->getExisting('last_edit_date'), 'log_date' => XenForo_Application::$time));
}
if (is_array($this->_modificationStatuses)) {
$this->_getModificationModel()->updateTemplateModificationLog($this->get('template_id'), $this->_modificationStatuses);
}
if ($this->getOption(self::OPTION_REBUILD_TEMPLATE_MAP)) {
if ($this->isChanged('title')) {
$templateModel->buildTemplateMap($this->get('title'));
if ($existingTitle = $this->getExisting('title')) {
if ($this->getOption(self::OPTION_FULL_COMPILE)) {
// need to recompile anything including this template
$mappedTemplates = $templateModel->getMappedTemplatesByTemplateId($this->get('template_id'));
$mappedTemplateIds = array();
foreach ($mappedTemplates as $mappedTemplate) {
$mappedTemplateIds[] = $mappedTemplate['template_map_id'];
}
$templateModel->buildTemplateMap($existingTitle);
$templateModel->compileMappedTemplatesInStyleTree($templateModel->getIncludingTemplateMapIds($mappedTemplateIds));
} else {
$templateModel->buildTemplateMap($existingTitle);
}
}
} else {
if ($this->isChanged('style_id')) {
$templateModel->buildTemplateMap($this->get('title'));
}
}
}
if ($this->getOption(self::OPTION_FULL_COMPILE)) {
XenForo_Template_Compiler::removeTemplateFromCache($this->get('title'));
XenForo_Template_Compiler::removeTemplateFromCache($this->getExisting('title'));
$this->_recompileTemplate();
$this->getModelFromCache('XenForo_Model_Style')->updateAllStylesLastModifiedDate();
$this->getModelFromCache('XenForo_Model_AdminTemplate')->updateAdminStyleLastModifiedDate();
}
if ($devDir = $this->_getDevOutputDir()) {
$this->_writeDevFileOutput($devDir);
}
}
示例2: _postSave
/**
* Post-save handler.
*/
protected function _postSave()
{
$templateModel = $this->_getTemplateModel();
if ($this->getOption(self::OPTION_REBUILD_TEMPLATE_MAP)) {
if ($this->isChanged('title')) {
$templateModel->buildTemplateMap($this->get('title'));
if ($existingTitle = $this->getExisting('title')) {
if ($this->getOption(self::OPTION_FULL_COMPILE)) {
// need to recompile anything including this template
$mappedTemplates = $templateModel->getMappedTemplatesByTemplateId($this->get('template_id'));
$mappedTemplateIds = array();
foreach ($mappedTemplates as $mappedTemplate) {
$mappedTemplateIds[] = $mappedTemplate['template_map_id'];
}
$templateModel->buildTemplateMap($existingTitle);
$templateModel->compileMappedTemplatesInStyleTree($templateModel->getIncludingTemplateMapIds($mappedTemplateIds));
} else {
$templateModel->buildTemplateMap($existingTitle);
}
}
} else {
if ($this->isChanged('style_id')) {
$templateModel->buildTemplateMap($this->get('title'));
}
}
}
if ($this->getOption(self::OPTION_FULL_COMPILE)) {
XenForo_Template_Compiler::removeTemplateFromCache($this->get('title'));
XenForo_Template_Compiler::removeTemplateFromCache($this->getExisting('title'));
$this->_recompileTemplate();
$this->getModelFromCache('XenForo_Model_Style')->updateAllStylesLastModifiedDate();
}
if ($devDir = $this->_getDevOutputDir()) {
$this->_writeDevFileOutput($devDir);
}
}