X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=blobdiff_plain;f=includes%2FFeedUtils.php;h=b058975b736f0e898380087277f2329c81bcbe0c;hb=a36c567fa636af4a7c96cdeff521b64d6f291f22;hp=a01d64208c528d75bf41d65b546885aa88873c21;hpb=d1adda0be9bb4de5ca9a19f6905fea3c9bb0f35b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/FeedUtils.php b/includes/FeedUtils.php index a01d64208c..b058975b73 100644 --- a/includes/FeedUtils.php +++ b/includes/FeedUtils.php @@ -30,18 +30,19 @@ class FeedUtils { /** * Check whether feed's cache should be cleared; for changes feeds - * If the feed should be purged; $timekey and $key will be removed from - * $messageMemc + * If the feed should be purged; $timekey and $key will be removed from cache * * @param string $timekey Cache key of the timestamp of the last item * @param string $key Cache key of feed's content */ public static function checkPurge( $timekey, $key ) { - global $wgRequest, $wgUser, $messageMemc; + global $wgRequest, $wgUser; + $purge = $wgRequest->getVal( 'action' ) === 'purge'; if ( $purge && $wgUser->isAllowed( 'purge' ) ) { - $messageMemc->delete( $timekey ); - $messageMemc->delete( $key ); + $cache = ObjectCache::getMainWANInstance(); + $cache->delete( $timekey, 1 ); + $cache->delete( $key, 1 ); } } @@ -128,11 +129,11 @@ class FeedUtils { if ( $oldid ) { - #$diffText = $de->getDiff( wfMessage( 'revisionasof', - # $wgLang->timeanddate( $timestamp ), - # $wgLang->date( $timestamp ), - # $wgLang->time( $timestamp ) )->text(), - # wfMessage( 'currentrev' )->text() ); + # $diffText = $de->getDiff( wfMessage( 'revisionasof', + # $wgLang->timeanddate( $timestamp ), + # $wgLang->date( $timestamp ), + # $wgLang->time( $timestamp ) )->text(), + # wfMessage( 'currentrev' )->text() ); $diffText = ''; // Don't bother generating the diff if we won't be able to show it @@ -185,10 +186,10 @@ class FeedUtils { $html = nl2br( htmlspecialchars( $text ) ); } } else { - //XXX: we could get an HTML representation of the content via getParserOutput, but that may + // XXX: we could get an HTML representation of the content via getParserOutput, but that may // contain JS magic and generally may not be suitable for inclusion in a feed. // Perhaps Content should have a getDescriptiveHtml method and/or a getSourceText method. - //Compare also ApiFeedContributions::feedItemDesc + // Compare also ApiFeedContributions::feedItemDesc $html = null; }