本文整理汇总了PHP中eZCache::clearByID方法的典型用法代码示例。如果您正苦于以下问题:PHP eZCache::clearByID方法的具体用法?PHP eZCache::clearByID怎么用?PHP eZCache::clearByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZCache
的用法示例。
在下文中一共展示了eZCache::clearByID方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clearActiveExtensionsCache
/**
* @todo Move to a common extension testing class
*/
private static function clearActiveExtensionsCache()
{
eZCache::clearByID('active_extensions');
// currently required so that cache will actually be considered expired
// this is a design issue in eZExpiryHandler we need to address soon as it deeply impacts testing any feature
// that relies on it, and also impacts runtime on high-trafic sites.
sleep(2);
}
示例2: generateJson
/**
* @param array $action
*/
function generateJson( $action )
{
$jsPath = "extension/{$action['identifier']}/design/oscar/javascript/";
if ( is_dir( $jsPath ) )
{
$convert = new ConvertTsToJSON( $jsPath . "com.lang.js", null, $action['param'] );
$convert->process();
eZCache::clearByID( array('ezjscore-packer'), 'template-block' );
}
}
示例3: initializePackage
//.........这里部分代码省略.........
foreach ($prefs as $prefEntry) {
if (!$prefEntry) {
continue;
}
$prefUserID = $prefEntry['user_id'];
foreach ($prefEntry['preferences'] as $pref) {
$prefName = $pref['name'];
$prefValue = $pref['value'];
if (!eZPreferences::setValue($prefName, $prefValue, $prefUserID)) {
$resultArray['errors'][] = array('code' => 'EZSW-070', 'text' => "Could not create ezpreference '{$prefValue}' for {$prefUserID}");
return false;
}
}
}
}
$publishAdmin = false;
$userAccount = eZUser::fetch(14);
if (!is_object($userAccount)) {
$resultArray['errors'][] = array('code' => 'EZSW-020', 'text' => "Could not fetch administrator user object");
return false;
}
$userObject = $userAccount->attribute('contentobject');
if (!is_object($userObject)) {
$resultArray['errors'][] = array('code' => 'EZSW-021', 'text' => "Could not fetch administrator content object");
return false;
}
$newUserObject = $userObject->createNewVersion(false, false);
if (!is_object($newUserObject)) {
$resultArray['errors'][] = array('code' => 'EZSW-022', 'text' => "Could not create new version of administrator content object");
return false;
}
$dataMap = $newUserObject->attribute('data_map');
$error = false;
if (trim($admin['email'])) {
if (!isset($dataMap['user_account'])) {
$resultArray['errors'][] = array('code' => 'EZSW-023', 'text' => "Administrator content object does not have a 'user_account' attribute");
return false;
}
$userAccount->setInformation(14, 'admin', $admin['email'], $admin['password'], $admin['password']);
$dataMap['user_account']->setContent($userAccount);
$dataMap['user_account']->store();
$publishAdmin = true;
$userAccount->store();
}
if (trim($admin['first_name']) or trim($admin['last_name'])) {
if (!isset($dataMap['first_name'])) {
$resultArray['errors'][] = array('code' => 'EZSW-023', 'text' => "Administrator content object does not have a 'first_name' field");
$error = true;
}
if (!isset($dataMap['last_name'])) {
$resultArray['errors'][] = array('code' => 'EZSW-024', 'text' => "Administrator content object does not have a 'last_name' field");
$error = true;
}
if ($error) {
return false;
}
$dataMap['first_name']->setAttribute('data_text', $admin['first_name']);
$dataMap['first_name']->store();
$dataMap['last_name']->setAttribute('data_text', $admin['last_name']);
$dataMap['last_name']->store();
$newUserObject->store();
$publishAdmin = true;
}
if ($publishAdmin) {
$operationResult = eZOperationHandler::execute('content', 'publish', array('object_id' => $newUserObject->attribute('contentobject_id'), 'version' => $newUserObject->attribute('version')));
if ($operationResult['status'] != eZModuleOperationInfo::STATUS_CONTINUE) {
$resultArray['errors'][] = array('code' => 'EZSW-025', 'text' => "Failed to properly publish the administrator object");
return false;
}
}
// Call user function for additional setup tasks.
if (function_exists('eZSitePostInstall')) {
eZSitePostInstall($parameters);
}
// get all siteaccesses. do it via 'RelatedSiteAccessesList' settings.
$adminSiteINI = eZINI::instance('site.ini' . '.append.php', "settings/siteaccess/{$adminSiteaccessName}");
$relatedSiteAccessList = $adminSiteINI->variable('SiteAccessSettings', 'RelatedSiteAccessList');
// Adding override for 'tiny_image' view for 'multi-option2' datatype
foreach ($relatedSiteAccessList as $siteAccess) {
$tmpOverrideINI = new eZINI('override.ini' . '.append.php', "settings/siteaccess/{$siteAccess}", null, null, null, true, true);
$tmpOverrideINI->setVariable('tiny_image', 'Source', 'content/view/tiny.tpl');
$tmpOverrideINI->setVariable('tiny_image', 'MatchFile', 'tiny_image.tpl');
$tmpOverrideINI->setVariable('tiny_image', 'Subdir', 'templates');
$tmpOverrideINI->setVariable('tiny_image', 'Match', array('class_identifier' => 'image'));
$tmpOverrideINI->save();
}
$accessMap = $parameters['access_map'];
// Call user function for some text which will be displayed at 'Finish' screen
if (function_exists('eZSiteFinalText')) {
$text = eZSiteFinalText($parameters);
if (!isset($this->PersistenceList['final_text'])) {
$this->PersistenceList['final_text'] = array();
}
$this->PersistenceList['final_text'][] = $text;
}
// ensure that evaluated policy wildcards in the user info cache
// will be up to date with the currently activated modules
eZCache::clearByID('user_info_cache');
return true;
}
示例4: generateSpriteForCluster
//.........这里部分代码省略.........
exec($cmd, $cmdOutput, $cmdStatus);
if ($cmdStatus != 0)
{
return array(
'errorCode' => $cmdStatus,
'generateSpriteCommand' => $cmd,
'error' => implode('\n', $cmdOutput),
);
}
$css = "
#app-catalog a.app-bar-access-app-library .poster{
background-image: none !important;
}
#app-catalog a .poster,
#hide-app a .poster,
.item-apps .batch .wrap > a .poster,
.item-related-app .batch .wrap > a .poster{
background-image:url(/esibuild/static/{$clusterIdentifier}/{$generatedSpriteName});
background-repeat: no-repeat;
}
";
$cssMobile = "
#app-catalog a.app-bar-access-app-library .poster{
background-image: none !important;
}
#app-catalog a .poster,
#hide-app a .poster,
.item-apps .batch .wrap > a .poster,
.item-related-app .batch .wrap > a .poster{
background-image:url(/esibuild/static/{$clusterIdentifier}/{$generatedSpriteName});
background-repeat: no-repeat;
background-size: {$mobileStep}px auto !important;
}
";
$offset = 0;
$offsetMobile = 0;
foreach( $cssList as $key => $cssStyle )
{
$css .= "
#app-catalog a .poster.$cssStyle,
#hide-app a .poster.$cssStyle,
.item-apps .batch .wrap > a .poster.$cssStyle,
.item-related-app .batch .wrap > a .poster.$cssStyle{
background-position: 0 -{$offset}px !important;
}
";
$cssMobile .= "
#app-catalog a .poster.$cssStyle,
#hide-app a .poster.$cssStyle,
.item-apps .batch .wrap > a .poster.$cssStyle{
background-position: 0 -{$offsetMobile}px !important;
}
";
$offset += $offsetStep;
$offsetMobile += $mobileStep;
$css .= "
#app-catalog a:hover .poster.$cssStyle,
#app-catalog a:active .poster.$cssStyle,
#app-catalog a.active .poster.$cssStyle,
#hide-app a:active .poster.$cssStyle,
#hide-app a.active .poster.$cssStyle,
.item-apps .batch:hover .wrap > a .poster.$cssStyle,
.item-related-app .batch:hover .wrap > a .poster.$cssStyle{
background-position: 0 -{$offset}px !important;
}
";
$cssMobile .= "
#app-catalog a:hover .poster.$cssStyle,
#app-catalog a:active .poster.$cssStyle,
#app-catalog a.active .poster.$cssStyle,
#hide-app a:active .poster.$cssStyle,
#hide-app a.active .poster.$cssStyle,
.item-apps .batch:hover .wrap > a .poster.$cssStyle,
.item-related-app .batch:hover .wrap > a .poster.$cssStyle{
background-position: 0 -{$offsetMobile}px !important;
}
";
$offset += $offsetStep;
$offsetMobile += $mobileStep;
}
if ( ! file_exists( $lessPath ) )
{
mkdir( $lessPath, 0755 );
}
if ( is_dir( $lessPath ) )
{
$lessFile = $lessPath."mod.icosprite.less";
file_put_contents( $lessFile, $css );
$lessFileMobile = $lessPath."mod.icosprite.mobile.less";
file_put_contents( $lessFileMobile, $cssMobile );
eZCache::clearByID( array('ezjscore-packer'), 'template-block' );
}
return array(
'errorCode' => 0,
'generateSpriteCommand' => $cmd
);
}
示例5: init
function init()
{
eZCache::clearByID( 'global_ini' );
return false; // Always show
}
示例6: backupTables
if ($column > 0) {
$cli->output();
}
backupTables('impwcard');
}
// $cli->output( "Removing urlalias data which have been imported" );
// $db = eZDB::instance();
// $db->query( "DELETE FROM ezurlalias WHERE is_imported = 1" ); // Removing all aliases which have been imported
$rows = $db->arrayQuery("SELECT count(*) AS count FROM ezurlalias WHERE is_imported = 0");
$remaining = $rows[0]['count'];
if ($remaining > 0) {
$cli->output("There are {$remaining} remaining URL aliases in the old ezurlalias table, manual cleanup is needed.");
}
if ($importOldAliasWildcard) {
$cli->output("Removing old wildcard caches");
eZCache::clearByID('urlalias');
}
$cli->output("Import completed");
$cli->output("Import time taken: " . $cli->stylize('emphasize', formatTime(microtime(true) - $globalStartTime)));
}
if ($updateNodeAlias) {
$nodeGlobalStartTime = microtime(true);
// Start updating nodes
$topLevelNodesArray = $db->arrayQuery('SELECT node_id FROM ezcontentobject_tree WHERE depth = 1 ORDER BY node_id');
foreach (array_keys($topLevelNodesArray) as $key) {
$topLevelNodeID = $topLevelNodesArray[$key]['node_id'];
$rootNode = eZContentObjectTreeNode::fetch($topLevelNodeID);
if ($rootNode->updateSubTreePath()) {
++$totalChangedNodes;
}
$done = false;
示例7: updateAutoload
// open settings/override/site.ini.append[.php] for writing
$writeSiteINI = eZINI::instance( 'site.ini.append', 'settings/override', null, null, false, true );
$writeSiteINI->setVariable( "ExtensionSettings", "ActiveExtensions", $toSave );
$writeSiteINI->save( 'site.ini.append', '.php', false, false );
eZCache::clearByTag( 'ini' );
eZSiteAccess::reInitialise();
$ini = eZINI::instance( 'module.ini' );
$currentModules = $ini->variable( 'ModuleSettings', 'ModuleList' );
if ( $currentModules != $oldModules )
{
// ensure that evaluated policy wildcards in the user info cache
// will be up to date with the currently activated modules
eZCache::clearByID( 'user_info_cache' );
}
updateAutoload( $tpl );
}
// open site.ini for reading (need to do it again to take into account the changes made to site.ini after clicking "Apply changes" button above
$siteINI = eZINI::instance();
$siteINI->load();
$selectedExtensionArray = $siteINI->variable( 'ExtensionSettings', "ActiveExtensions" );
$selectedAccessExtensionArray = $siteINI->variable( 'ExtensionSettings', "ActiveAccessExtensions" );
$selectedExtensions = array_merge( $selectedExtensionArray, $selectedAccessExtensionArray );
$selectedExtensions = array_unique( $selectedExtensions );
if ( $module->isCurrentAction( 'GenerateAutoloadArrays' ) )
{
示例8: array
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;
break;
}
}
}
$cacheCleared['list'] = $cacheItemList;
}
示例9: execute
//.........这里部分代码省略.........
}
else
{
if ( !is_readable( $fileName ) )
{
$this->writeMessage( "\tFile $fileNamePath is not readable. Skipping.", 'notice' );
continue;
}
if ( !is_writeable( $fileName ) )
{
$this->writeMessage( "\tFile $fileNamePath is not writeable. Skipping.", 'notice' );
continue;
}
}
$ini = eZINI::instance( $fileName, $location, null, null, null, true, true );
$settingsBlockList = $settingsFile->getElementsByTagName( 'SettingsBlock' );
foreach ( $settingsBlockList as $settingsBlock )
{
$blockName = $settingsBlock->getAttribute( 'name' );
$values = $settingsBlock->childNodes;
$settingValue = false;
foreach ( $values as $value )
{
$variableName = $value->nodeName;
if ( $value->nodeName == "#text" )
{
continue;
}
if ( get_class($value) == 'DOMElement' && $value->hasAttribute( 'value' ) )
{
$settingValue = $value->getAttribute( 'value' );
}
elseif ( get_class($value) == 'DOMElement' && $value->hasChildNodes() )
{
if ( $value->firstChild->nodeName == $value->lastChild->nodeName && $value->childNodes->length>1 )
{
$variableName = $value->tagName;
$vals = $value->getElementsByTagName( 'value' );
$settingValue = array();
foreach ( $vals as $val )
{
$key = $val->getAttribute( 'key' );
if ( $key )
{
$settingValue[$key] = $this->parseAndReplaceStringReferences( $val->textContent );
}
else
{
$settingValue[] = $this->parseAndReplaceStringReferences( $val->textContent );
}
}
}
else
{
$settingValue = $this->parseAndReplaceStringReferences( $value->nodeValue );
}
}
elseif ( $value->textContent )
{
$settingValue = $value->textContent;
}
else
{
$settingValue = $this->parseAndReplaceStringReferences( $value->textContent );
}
$existingVar = false;
if ( $ini->hasVariable( $blockName, $variableName ) )
{
$existingVar = $ini->variable( $blockName, $variableName );
}
if ( is_string( $existingVar ) && is_string( $settingValue ) )
{
$ini->setVariable( $blockName, $variableName, $settingValue );
}
elseif ( is_array( $existingVar ) && is_string( $settingValue ) )
{
$existingVar[] = $settingValue;
$ini->setVariable( $blockName, $variableName, $existingVar );
}
elseif ( is_array( $existingVar ) && is_array( $settingValue ) )
{
// an empty value in a list means a reset of the setting
if ( array_search( "", $settingValue, true ) !== false )
$mergedArray = $settingValue;
else
$mergedArray = array_merge( $existingVar, $settingValue );
$ini->setVariable( $blockName, $variableName, array_unique( $mergedArray ) );
}
else
{
$ini->setVariable( $blockName, $variableName, $settingValue );
}
}
}
$ini->save( false, ".append.php" );
unset( $ini );
}
eZCache::clearByID( array( 'ini', 'global_ini' ) );
}