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


PHP CacheControl::flushTag方法代码示例

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


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

示例1: flushItemsByPlugin

 function flushItemsByPlugin($pluginName)
 {
     global $databases;
     $xmls = new XMLStruct();
     $manifest = @file_get_contents(ROOT . "/plugins/{$pluginName}/index.xml");
     if ($manifest && $xmls->open($manifest)) {
         if ($xmls->doesExist('/plugin/binding/listener')) {
             //event listener가 있는 경우
             foreach ($xmls->selectNodes('/plugin/binding/listener') as $listener) {
                 if (!empty($listener['.attributes']['event']) && !empty($listener['.value'])) {
                     // Event가 있는 경우
                     if (strpos(strtolower($listener['.attributes']['event']), 'view') !== false) {
                         CacheControl::flushCategory();
                     }
                 }
             }
             unset($listener);
         }
         if ($xmls->doesExist('/plugin/binding/tag')) {
             foreach ($xmls->selectNodes('/plugin/binding/tag') as $tag) {
                 if (!empty($tag['.attributes']['name']) && !empty($tag['.attributes']['handler'])) {
                     CacheControl::flushCategory();
                     CacheControl::flushTag();
                 }
             }
             unset($tag);
         }
         //			if ($xmls->doesExist('/plugin/binding/sidebar')) {
         //			TODO:	사이드바 캐시때 처리하도록 하지요.
         //			}
         if ($xmls->doesExist('/plugin/binding/formatter[lang()]')) {
             CacheControl::flushCategory();
         }
     }
 }
开发者ID:hinablue,项目名称:TextCube,代码行数:35,代码来源:Needlworks.Cache.PageCache.Legacy.php

示例2: deleteTagsWithEntryId

 function deleteTagsWithEntryId($blogid, $entry)
 {
     global $database;
     $taglist = POD::queryColumn("SELECT tag FROM {$database['prefix']}TagRelations WHERE blogid = {$blogid} AND entry = {$entry}");
     if (!is_null($taglist)) {
         $tagliststr = implode(',', $taglist);
         foreach ($taglist as $tagid) {
             CacheControl::flushTag($tagid);
         }
         POD::execute("DELETE FROM {$database['prefix']}TagRelations\n\t\t\t\tWHERE blogid = {$blogid} AND entry = {$entry}");
         $nottargets = POD::queryColumn("SELECT DISTINCT tag FROM {$database['prefix']}TagRelations WHERE tag in ( {$tagliststr} )");
         if (count($nottargets) > 0) {
             $nottargetstr = implode(', ', $nottargets);
             POD::execute("DELETE FROM {$database['prefix']}Tags WHERE id IN ( {$tagliststr} ) AND id NOT IN ( {$nottargetstr} )");
         } else {
             POD::execute("DELETE FROM {$database['prefix']}Tags WHERE id IN ( {$tagliststr} )");
         }
     }
 }
开发者ID:Avantians,项目名称:Textcube,代码行数:19,代码来源:Textcube.Data.Tag.php

示例3: useBlogSlogan

function useBlogSlogan($blogid, $useSloganOnPost, $useSloganOnCategory, $useSloganOnTag)
{
    $ctx = Model_Context::getInstance();
    $useSloganOnPost = $useSloganOnPost ? 1 : 0;
    $useSloganOnCategory = $useSloganOnCategory ? 1 : 0;
    $useSloganOnTag = $useSloganOnTag ? 1 : 0;
    if ($useSloganOnPost == $ctx->getProperty('blog.useSloganOnPost') && $useSloganOnCategory == $ctx->getProperty('blog.useSloganOnCategory') && $useSloganOnTag == $ctx->getProperty('blog.useSloganOnTag')) {
        return true;
    }
    /*	if(Setting::setBlogSettingGlobal('useSloganOnPost',$useSlogan) === false
    	|| Setting::setBlogSettingGlobal('useSloganOnCategory',$useSlogan) === false
    	|| Setting::setBlogSettingGlobal('useSloganOnTag',$useSlogan) === false
    		) {
    		return false;
    	}*/
    Setting::setBlogSettingGlobal('useSloganOnPost', $useSloganOnPost);
    Setting::setBlogSettingGlobal('useSloganOnCategory', $useSloganOnCategory);
    Setting::setBlogSettingGlobal('useSloganOnTag', $useSloganOnTag);
    $ctx->setProperty('blog.useSloganOnPost', $useSloganOnPost);
    $ctx->setProperty('blog.useSloganOnCategory', $useSloganOnCategory);
    $ctx->setProperty('blog.useSloganOnTag', $useSloganOnTag);
    requireModel('blog.feed');
    CacheControl::flushCategory();
    CacheControl::flushEntry();
    CacheControl::flushTag();
    fireEvent('ToggleBlogSlogan', null, $useSloganOnPost);
    clearFeed();
    return true;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:29,代码来源:blog.blogSetting.php

示例4: setSkinSetting

function setSkinSetting($blogid, $setting)
{
    global $skinSetting;
    // Legacy global support. TODO: DELETE THIS LINE AFTER CHECK EVERY REFERENCES IN WHOLE SOURCE
    importlib('blogskin');
    $blogid = getBlogId();
    if (strncmp($context->getProperty('skin.skin'), 'customize/', 10) == 0) {
        if (strcmp($context->getProperty('skin.skin'), "customize/{$blogid}") != 0) {
            return false;
        }
    } else {
        $skinSetting['skin'] = Path::getBaseName($context->getProperty('skin.skin'));
        // Legacy global support. TODO: DELETE THIS LINE AFTER CHECK EVERY REFERENCES IN WHOLE SOURCE
        $context->setProperty('skin.skin', $skinSetting['skin']);
        if ($context->getProperty('skin.skin') === '.' || $context->getProperty('skin.skin') === '..') {
            return _t('실패 했습니다');
        }
    }
    $skinpath = getSkinPath($context->getProperty('skin.skin'));
    if (!is_dir($skinpath)) {
        return _t('실패 했습니다');
    }
    foreach ($setting as $key => $value) {
        Setting::setSkinSetting($key, $value, $blogid);
    }
    Setting::setSkinSetting('skin', $context->getProperty('skin.skin'), $blogid);
    Setting::setBlogSetting('useMicroformat', $setting['useMicroformat'], true);
    Setting::setBlogSetting('useAjaxComment', $setting['useAjaxComment'], true);
    Setting::setBlogSetting('useFOAF', $setting['useFOAF'] == 1 ? 1 : 0, true);
    Setting::setBlogSetting('entriesOnPage', $setting['entriesOnPage'], true);
    Setting::setBlogSetting('entriesOnList', $setting['entriesOnList'], true);
    CacheControl::flushCategory();
    CacheControl::flushTag();
    CacheControl::flushSkin();
    Setting::getSkinSettings($blogid, true);
    // refresh skin cache
    return true;
}
开发者ID:ni5am,项目名称:Textcube,代码行数:38,代码来源:skin.php

示例5: useBlogSlogan

function useBlogSlogan($blogid, $useSloganOnPost, $useSloganOnCategory, $useSloganOnTag)
{
    global $blog;
    requireModel('blog.feed');
    $useSloganOnPost = $useSloganOnPost ? 1 : 0;
    $useSloganOnCategory = $useSloganOnCategory ? 1 : 0;
    $useSloganOnTag = $useSloganOnTag ? 1 : 0;
    if ($useSloganOnPost == $blog['useSloganOnPost'] && $useSloganOnCategory == $blog['useSloganOnCategory'] && $useSloganOnTag == $blog['useSloganOnTag']) {
        return true;
    }
    /*	if(Setting::setBlogSettingGlobal('useSloganOnPost',$useSlogan) === false
    	|| Setting::setBlogSettingGlobal('useSloganOnCategory',$useSlogan) === false
    	|| Setting::setBlogSettingGlobal('useSloganOnTag',$useSlogan) === false
    		) {
    		return false;
    	}*/
    Setting::setBlogSettingGlobal('useSloganOnPost', $useSloganOnPost);
    Setting::setBlogSettingGlobal('useSloganOnCategory', $useSloganOnCategory);
    Setting::setBlogSettingGlobal('useSloganOnTag', $useSloganOnTag);
    $blog['useSloganOnPost'] = $useSloganOnPost;
    $blog['useSloganOnCategory'] = $useSloganOnCategory;
    $blog['useSloganOnTag'] = $useSloganOnTag;
    CacheControl::flushCategory();
    CacheControl::flushEntry();
    CacheControl::flushTag();
    fireEvent('ToggleBlogSlogan', null, $blog['useSloganOnPost']);
    clearFeed();
    return true;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:29,代码来源:blog.blogSetting.php

示例6: setSkinSetting

function setSkinSetting($blogid, $setting)
{
    global $database;
    global $skinSetting;
    requireLibrary('blog.skin');
    $blogid = getBlogId();
    if (strncmp($skinSetting['skin'], 'customize/', 10) == 0) {
        if (strcmp($skinSetting['skin'], "customize/{$blogid}") != 0) {
            return false;
        }
    } else {
        $skinSetting['skin'] = Path::getBaseName($skinSetting['skin']);
        if ($skinSetting['skin'] === '.' || $skinSetting['skin'] === '..') {
            return _t('실패 했습니다');
        }
    }
    $skinpath = ROOT . '/skin/blog/' . $skinSetting['skin'];
    if (!is_dir($skinpath)) {
        return _t('실패 했습니다');
    }
    foreach ($setting as $key => $value) {
        Setting::setSkinSetting($key, $value, $blogid);
    }
    Setting::setSkinSetting('skin', $skinSetting['skin'], $blogid);
    Setting::setBlogSetting('useMicroformat', $setting['useMicroformat'], true);
    Setting::setBlogSetting('useAjaxComment', $setting['useAjaxComment'], true);
    Setting::setBlogSetting('useFOAF', $setting['useFOAF'] == 1 ? 1 : 0, true);
    Setting::setBlogSetting('entriesOnPage', $setting['entriesOnPage'], true);
    Setting::setBlogSetting('entriesOnList', $setting['entriesOnList'], true);
    CacheControl::flushCategory();
    CacheControl::flushTag();
    CacheControl::flushSkin();
    Setting::getSkinSettings($blogid, true);
    // refresh skin cache
    return true;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:36,代码来源:blog.skin.php


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