* @param string $app The application name.
* @param string $theme The theme name.
*
- * @return boolean True if cache entry existed.
+ * @return boolean True if cache entry existed and was deleted.
+ * @throws Horde_Exception
*/
public function expireCache($app, $theme)
{
$cache = $this->_injector->getInstance('Horde_Cache');
if ($cache->exists($sig, $GLOBALS['conf']['cachethemesparams']['lifetime'])) {
- $cache->expire($sig);
- unset($this->_instances[$sig]);
+ if (!$cache->expire($sig)) {
+ throw new Horde_Exception('Could not delete cache entry.');
+ }
+ unset($this->_instances[$sig]);
return true;
}
$tcache = $injector->getInstance('Horde_Core_Factory_ThemesCache');
$tlist = array_keys(Horde_Themes::themeList());
+ $cli->writeln();
+
foreach ($registry->listAllApps() as $app) {
foreach ($tlist as $theme) {
- if ($tcache->expireCache($app, $theme)) {
- $cli->message('Cache entry expired [APP: ' . $app . '; THEME: ' . $theme . ']');
+ try {
+ if ($tcache->expireCache($app, $theme)) {
+ $cli->message('Cache entry expired [APP: ' . $app . '; THEME: ' . $theme . ']');
+ }
+ } catch (Horde_Exception $e) {
+ $cli->message('Could not expire cache entry [APP: ' . $app . '; THEME: ' . $theme . ']', 'cli.warning');
}
}
}