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


PHP eZCache::clearByTag方法代码示例

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


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

示例1: removeRelatedCache

function removeRelatedCache($siteAccess)
{
    // Delete compiled template
    $ini = eZINI::instance();
    $iniPath = eZSiteAccess::findPathToSiteAccess($siteAccess);
    $siteINI = eZINI::instance('site.ini.append', $iniPath);
    if ($siteINI->hasVariable('FileSettings', 'CacheDir')) {
        $cacheDir = $siteINI->variable('FileSettings', 'CacheDir');
        if ($cacheDir[0] == "/") {
            $cacheDir = eZDir::path(array($cacheDir));
        } else {
            if ($siteINI->hasVariable('FileSettings', 'VarDir')) {
                $varDir = $siteINI->variable('FileSettings', 'VarDir');
                $cacheDir = eZDir::path(array($varDir, $cacheDir));
            }
        }
    } else {
        if ($siteINI->hasVariable('FileSettings', 'VarDir')) {
            $varDir = $siteINI->variable('FileSettings', 'VarDir');
            $cacheDir = $ini->variable('FileSettings', 'CacheDir');
            $cacheDir = eZDir::path(array($varDir, $cacheDir));
        } else {
            $cacheDir = eZSys::cacheDirectory();
        }
    }
    $compiledTemplateDir = $cacheDir . "/template/compiled";
    eZDir::unlinkWildcard($compiledTemplateDir . "/", "*pagelayout*.*");
    eZCache::clearByTag('template-block');
    // Expire content view cache
    eZContentCacheManager::clearAllContentCache();
}
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:toolbar.php

示例2: array

if ( $module->isCurrentAction( 'ClearContentCache' ) )
{
    eZCache::clearByTag( 'content' );
    $cacheCleared['content'] = true;
}

if ( $module->isCurrentAction( 'ClearINICache' ) )
{
    eZCache::clearByTag( 'ini' );
    $cacheCleared['ini'] = true;
}

if ( $module->isCurrentAction( 'ClearTemplateCache' ) )
{
    eZCache::clearByTag( 'template' );
    $cacheCleared['template'] = true;
}

if ( $module->isCurrentAction( 'ClearCache' ) && $module->hasActionParameter( 'CacheList' ) && is_array( $module->actionParameter( 'CacheList' ) ) )
{
    $cacheClearList = $module->actionParameter( 'CacheList' );
    eZCache::clearByID( $cacheClearList );
    $cacheItemList = array();
    foreach ( $cacheClearList as $cacheClearItem )
    {
        foreach ( $cacheList as $cacheItem )
        {
            if ( $cacheItem['id'] == $cacheClearItem )
            {
                $cacheItemList[] = $cacheItem;
开发者ID:nottavi,项目名称:ezpublish,代码行数:30,代码来源:cache.php

示例3: elseif

    $nodeID = $module->actionParameter('NodeID');
}
if ($module->hasActionParameter('ObjectID')) {
    $objectID = $module->actionParameter('ObjectID');
}
if ($cacheType == 'All') {
    eZCache::clearAll();
} elseif ($cacheType == 'Template') {
    eZCache::clearByTag('template');
} elseif ($cacheType == 'Content') {
    eZCache::clearByTag('content');
} elseif ($cacheType == 'TemplateContent') {
    eZCache::clearByTag('template');
    eZCache::clearByTag('content');
} elseif ($cacheType == 'Ini') {
    eZCache::clearByTag('ini');
} elseif ($cacheType == 'Static') {
    // get staticCacheHandler instance
    $optionArray = array('iniFile' => 'site.ini', 'iniSection' => 'ContentSettings', 'iniVariable' => 'StaticCacheHandler');
    $options = new ezpExtensionOptions($optionArray);
    $staticCacheHandler = eZExtension::getHandlerClass($options);
    $staticCacheHandler->generateCache(true, true);
    $cacheCleared['static'] = true;
} elseif ($cacheType == 'ContentNode') {
    $contentModule = eZModule::exists('content');
    if ($contentModule instanceof eZModule) {
        $contentModule->setCurrentAction('ClearViewCache', 'action');
        $contentModule->setActionParameter('NodeID', $nodeID, 'action');
        $contentModule->setActionParameter('ObjectID', $objectID, 'action');
        $contentModule->run('action', array($nodeID, $objectID));
    }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:31,代码来源:cachetoolbar.php

示例4: array

/**
 * @package nxcMasterPassword
 * @author  Serhey Dolgushev <serhey.dolgushev@nxc.no>
 * @date    22 Sep 2011
 **/
require 'autoload.php';
$cli = eZCLI::instance();
$scriptSettings = array('description' => 'Creates transaltion files', 'use-session' => false, 'use-modules' => false, 'use-extensions' => true);
$script = eZScript::instance($scriptSettings);
$script->startup();
$script->initialize();
$options = $script->getOptions('', '[password]', array('password' => 'New password'));
if (count($options['arguments']) < 1 || strlen($options['arguments'][0]) === 0) {
    $cli->error('Specify new password');
    $script->shutdown(1);
}
$ini = eZINI::instance('nxcmasterpassword.ini');
$password = $options['arguments'][0];
$password = md5(md5($password) . $ini->variable('General', 'Seed'));
$ini->setVariable('General', 'MasterPassword', $password);
$file = 'nxcmasterpassword.ini.append.php';
$path = eZExtension::baseDirectory() . '/nxc_master_password/settings';
$result = $ini->save($file, false, false, false, $path, false, true);
if ($result === false) {
    $cli->error('Cannot update "' . $path . '/' . $file . '" settings file');
    $script->shutdown(1);
}
eZCache::clearByTag('Ini');
$cli->output('Password stored');
$script->shutdown(0);
开发者ID:nxc,项目名称:nxc_master_password,代码行数:30,代码来源:update_password.php


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