From: Brion Vibber Date: Sat, 5 Nov 2005 10:38:46 +0000 (+0000) Subject: * (bug 2392) Fix Atom items content type, upgrade to Atom 1.0 X-Git-Tag: 1.6.0~1214 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=fb2064aed1478e80b773d611b90dd40af286eabc;p=lhc%2Fweb%2Fwiklou.git * (bug 2392) Fix Atom items content type, upgrade to Atom 1.0 * Allow $wgFeedCacheTimeout of 0 to disable feed caching Hooray for gratuitou s changes from atom 0.3 to 1.0! --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 524d002707..d569a51463 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -206,7 +206,8 @@ fully support the editing toolbar, but was found to be too confusing. subdir so you can render new math images and have them work * (bug 3797) Don't expand variables and sigs in comments * (bug 3666) Don't spew PHP warnings in prefs on unrecognized site language - +* (bug 2392) Fix Atom items content type, upgrade to Atom 1.0 +* Allow $wgFeedCacheTimeout of 0 to disable feed caching === Caveats === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 3e9eda6e7a..a95925b7d0 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1389,7 +1389,11 @@ $wgFeedLimit = 50; /** _Minimum_ timeout for cached Recentchanges feed, in seconds. * A cached version will continue to be served out even if changes - * are made, until this many seconds runs out since the last render. */ + * are made, until this many seconds runs out since the last render. + * + * If set to 0, feed caching is disabled. Use this for debugging only; + * feed generation can be pretty slow with diffs. + */ $wgFeedCacheTimeout = 60; /** When generating Recentchanges RSS/Atom feed, diffs will not be generated for diff --git a/includes/Feed.php b/includes/Feed.php index d47f33c4e7..0f5febd61a 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -240,16 +240,40 @@ class AtomFeed extends ChannelFeed { global $wgVersion, $wgOut; $this->outXmlHeader(); - ?> + ?> + getFeedId() ?> <?php print $this->getTitle() ?> + - formatTime( wfTimestampNow() ) ?>Z - getDescription() ?> + formatTime( wfTimestampNow() ) ?>Z + getDescription() ?> MediaWiki getFullRequestURL() ); + } + /** * @todo document */ @@ -257,16 +281,15 @@ class AtomFeed extends ChannelFeed { global $wgMimeType; ?> + getUrl() ?> <?php print $item->getTitle() ?> getDate() ) { ?> - formatTime( $item->getDate() ) ?>Z - formatTime( $item->getDate() ) ?> - formatTime( $item->getDate() ) ?>Z + formatTime( $item->getDate() ) ?>Z + - getDescription() ?> - getAuthor() ) { ?>getAuthor() ?> - foobar + getDescription() ?> + getAuthor() ) { ?>getAuthor() ?> get( $timekey ) ) { + if( ( $wgFeedCacheTimeout > 0 ) && ( $feedLastmod = $messageMemc->get( $timekey ) ) ) { /** * If the cached feed was rendered very recently, we may * go ahead and use it even if there have been edits made diff --git a/skins/common/feed.css b/skins/common/feed.css index 1e131fc9ce..94396639c8 100644 --- a/skins/common/feed.css +++ b/skins/common/feed.css @@ -12,7 +12,7 @@ Compatibility: */ /* RSS: */ rss, channel, title, link, description, language, generator, lastBuildDate, item, pubDate, author, comments, creator, -/* Atom: */ feed, modified, tagline, entry, issued, created, summary, comment { +/* Atom: */ feed, id, modified, tagline, entry, issued, created, updated, summary, comment { display: block; } @@ -67,6 +67,7 @@ pubDate:before { content: "Date: " } link:before { content: "Link: " } author:before, creator:before { content: "Author: " } description:before { content: "Description: " } +id:before { content: "Id: " } generator:before { content: "Generator: " } language:before { content: "Language: " } @@ -77,13 +78,14 @@ tagline:before { content: "Tagline: " } issued:before { content: "Issued: " } created:before { content: "Created: " } modified:before { content: "Modified: " } +updated:before { content: "Updated: " } summary:before { content: "Summary: " } comment:before { content: "Comment: " } pubDate:before, link:before, author:before, description:before, language:before, generator:before, lastBuildDate:before, comments:before, tagline:before, issued:before, created:before, modified:before, -summary:before, comment:before, creator:before { +summary:before, comment:before, creator:before, id:before, updated:before { color: #224; font-weight: bold; }