Forums / Developer / when and how to clear caches from php

when and how to clear caches from php

Author Message

*- pike

Saturday 20 June 2009 2:53:36 pm

Hi

I'm using PHP to publish objects and new versions of objects.

Sometimes, this goes fine.
Sometimes, the changes dont show up in the admin until I clear the cache.

The changes are there - f.e. I can see 5 versions of an object in the version history, but just looking at the node in the admin shows me the first version.

In the code, after

$operationResult = eZOperationHandler::execute( 'content','publish',array( 
	'object_id' => $version->attribute( 'contentobject_id' ),
	'version' => $version->attribute( 'version' ) 
));

I call

eZContentCacheManager::clearContentCacheIfNeeded( 
	$version->attribute('contentobject_id'),
	$version->attribute('version') 
);

Apparently, that's not enough. What other caches must I clear (and how?)

thanks,
*-pike

---------------
The class eZContentObjectTreeNode does.

Heath

Monday 22 June 2009 2:46:00 pm

Great Topic *- pike,

Sad no one else posted before me.

Agreed! ez.no/doc should also include more documentation on what caches existing and how and when they are or should be cleared.

In general I think that ez.no/doc should offer more documentation on how and when to use the php api than is available currently.

Cheers,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org