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 ===
/** _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
global $wgVersion, $wgOut;
$this->outXmlHeader();
- ?><feed version="0.3" xml:lang="<?php print $this->getLanguage() ?>">
+ ?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="<?php print $this->getLanguage() ?>">
+ <id><?php print $this->getFeedId() ?></id>
<title><?php print $this->getTitle() ?></title>
+ <link rel="self" type="application/atom+xml" href="<?php print $this->getSelfUrl() ?>"/>
<link rel="alternate" type="text/html" href="<?php print $this->getUrl() ?>"/>
- <modified><?php print $this->formatTime( wfTimestampNow() ) ?>Z</modified>
- <tagline><?php print $this->getDescription() ?></tagline>
+ <updated><?php print $this->formatTime( wfTimestampNow() ) ?>Z</updated>
+ <subtitle><?php print $this->getDescription() ?></subtitle>
<generator>MediaWiki <?php print $wgVersion ?></generator>
<?php
}
+ /**
+ * Atom 1.0 requires a unique, opaque IRI as a unique indentifier
+ * for every feed we create.
+ * @return string
+ * @access private
+ */
+ function getFeedId() {
+ global $wgServer, $wgScript;
+ return htmlspecialchars( "$wgServer$wgScript?atom-feed-id/" .
+ wfTimestamp( TS_MW ) . "/" . wfRandom() );
+ }
+
+ /**
+ * Atom 1.0 requests a self-reference to the feed.
+ * @return string
+ * @access private
+ */
+ function getSelfUrl() {
+ global $wgRequest;
+ return htmlspecialchars( $wgRequest->getFullRequestURL() );
+ }
+
/**
* @todo document
*/
global $wgMimeType;
?>
<entry>
+ <id><?php print $item->getUrl() ?></id>
<title><?php print $item->getTitle() ?></title>
<link rel="alternate" type="<?php print $wgMimeType ?>" href="<?php print $item->getUrl() ?>"/>
<?php if( $item->getDate() ) { ?>
- <modified><?php print $this->formatTime( $item->getDate() ) ?>Z</modified>
- <issued><?php print $this->formatTime( $item->getDate() ) ?></issued>
- <created><?php print $this->formatTime( $item->getDate() ) ?>Z</created><?php } ?>
+ <updated><?php print $this->formatTime( $item->getDate() ) ?>Z</updated>
+ <?php } ?>
- <summary type="text/plain"><?php print $item->getDescription() ?></summary>
- <?php if( $item->getAuthor() ) { ?><author><name><?php print $item->getAuthor() ?></name><!-- <url></url><email></email> --></author><?php }?>
- <comment>foobar</comment>
+ <summary type="html"><?php print $item->getDescription() ?></summary>
+ <?php if( $item->getAuthor() ) { ?><author><name><?php print $item->getAuthor() ?></name></author><?php }?>
</entry>
<?php /* FIXME need to add comments
* gets it quick too.
*/
$cachedFeed = false;
- if( $feedLastmod = $messageMemc->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
*/
/* 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;
}
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: " }
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;
}