r32541 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32540‎ | r32541 | r32542 >
Date:13:27, 28 March 2008
Author:catrope
Status:old
Tags:
Comment:
(bug 13544) Added prop=revid to action=parse
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiParse.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiParse.php
@@ -46,6 +46,7 @@
4747 if(!is_null($page) && (!is_null($text) || $title != "API"))
4848 $this->dieUsage("The page parameter cannot be used together with the text and title parameters", 'params');
4949 $prop = array_flip($params['prop']);
 50+ $revid = false;
5051
5152 global $wgParser, $wgUser;
5253 if(!is_null($page)) {
@@ -55,6 +56,8 @@
5657
5758 // Try the parser cache first
5859 $articleObj = new Article($titleObj);
 60+ if(isset($prop['revid']))
 61+ $revid = $articleObj->getRevIdFetched();
5962 $pcache =& ParserCache::singleton();
6063 $p_result = $pcache->get($articleObj, $wgUser);
6164 if(!$p_result) {
@@ -91,6 +94,8 @@
9295 $result_array['externallinks'] = array_keys($p_result->getExternalLinks());
9396 if(isset($prop['sections']))
9497 $result_array['sections'] = $p_result->getSections();
 98+ if($revid !== false)
 99+ $result_array['revid'] = $revid;
95100
96101 $result_mapping = array(
97102 'langlinks' => 'll',
@@ -158,7 +163,7 @@
159164 'text' => null,
160165 'page' => null,
161166 'prop' => array(
162 - ApiBase :: PARAM_DFLT => 'text|langlinks|categories|links|templates|images|externallinks|sections',
 167+ ApiBase :: PARAM_DFLT => 'text|langlinks|categories|links|templates|images|externallinks|sections|revid',
163168 ApiBase :: PARAM_ISMULTI => true,
164169 ApiBase :: PARAM_TYPE => array(
165170 'text',
@@ -168,7 +173,8 @@
169174 'templates',
170175 'images',
171176 'externallinks',
172 - 'sections'
 177+ 'sections',
 178+ 'revid'
173179 )
174180 )
175181 );
Index: trunk/phase3/RELEASE-NOTES
@@ -173,6 +173,7 @@
174174 * (bug 11719) Remove trailing blanks in YAML output.
175175 * (bug 13541) Added siprop=specialpagealiases to meta=siteinfo
176176 * Added fallback8bitEncoding field to meta=siteinfo&siprop=general output
 177+* (bug 13544) Added prop=revid to action=parse
177178
178179 === Languages updated in 1.13 ===
179180

Follow-up revisions

RevisionCommit summaryAuthorDate
r33069(bug 13544) Added oldid parameter to action=parse to allow for parsing of old...catrope10:51, 10 April 2008

Status & tagging log