Skip to content
Permalink
Browse files

Merge pull request #756 from joaoinacio/ezp-21510-deleteviewcache

Implement EZP-21510: Performance in ClearViewCacheSubtree content action
  • Loading branch information...
andrerom committed Sep 17, 2013
2 parents 1f86c9a + 48a0c39 commit 23b55d9d6cbde1de538bdff1f0dd9d656dd2f7ab
Showing with 1 addition and 26 deletions.
  1. +1 −26 kernel/content/action.php
@@ -1405,33 +1405,8 @@
{
return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
}
$limit = 50;
$offset = 0;
$params = array( 'AsObject' => false,
'Depth' => false,
'Limitation' => array() ); // Empty array means no permission checking
$subtreeCount = $node->subTreeCount( $params );
while ( $offset < $subtreeCount )
{
$params['Offset'] = $offset;
$params['Limit'] = $limit;
$subtree = $node->subTree( $params );
$offset += count( $subtree );
if ( count( $subtree ) == 0 )
{
break;
}
$objectIDList = array();
foreach ( $subtree as $subtreeNode )
{
$objectIDList[] = $subtreeNode['id'];
}
$objectIDList = array_unique( $objectIDList );
unset( $subtree );
foreach ( $objectIDList as $objectID )
eZContentCacheManager::clearContentCacheIfNeeded( $objectID );
}
eZContentObjectTreeNode::clearViewCacheForSubtree( $node );
}
if ( $module->hasActionParameter( 'CurrentURL' ) )

0 comments on commit 23b55d9

Please sign in to comment.
You can’t perform that action at this time.