Ok got it working now !
Fixed it by using sfContext::switchTo() and adding the host parameter
that was missing because my backend and frontend apps are on two
separate virtual hosts.
Maybe the documentation needs to be updated...
in backendConfiguration.class.php:
public function clearFrontendCache($uri, $host)
{
sfContext::switchTo('frontend'); //switch to the environment you
wish to clear
$cache = sfContext::getInstance()->getViewCacheManager();
if(is_array($uri))
{
foreach ($uri as $value)
{
$result = $cache->remove($value, $host);
}
}
else if(is_string($uri))
{
$result = $cache->remove($uri, $host);
}
sfContext::switchTo('backend'); //switch back to the environment you
started from
return $result;
}
And in the action:
$result = sfProjectConfiguration::getActive()->clearFrontendCache
('news/index?sf_culture=*', 'frontend.localhost');
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---