Index: trunk/phase3/includes/api/ApiEditPage.php |
— | — | @@ -190,15 +190,9 @@ |
191 | 191 | } |
192 | 192 | // Deprecated parameters |
193 | 193 | if ($params['watch']) |
194 | | - { |
195 | 194 | $watch = true; |
196 | | - $this->setWarning('The watch parameter has been deprecated.'); |
197 | | - } |
198 | 195 | elseif ($params['unwatch']) |
199 | | - { |
200 | 196 | $watch = false; |
201 | | - $this->setWarning('The unwatch parameter has been deprecated.'); |
202 | | - } |
203 | 197 | |
204 | 198 | if($watch) |
205 | 199 | $reqArr['wpWatchthis'] = ''; |
— | — | @@ -335,8 +329,14 @@ |
336 | 330 | 'nocreate' => false, |
337 | 331 | 'captchaword' => null, |
338 | 332 | 'captchaid' => null, |
339 | | - 'watch' => false, |
340 | | - 'unwatch' => false, |
| 333 | + 'watch' => array( |
| 334 | + ApiBase :: PARAM_DFLT => false, |
| 335 | + ApiBase :: PARAM_DEPRECATED => true, |
| 336 | + ), |
| 337 | + 'unwatch' => array( |
| 338 | + ApiBase :: PARAM_DFLT => false, |
| 339 | + ApiBase :: PARAM_DEPRECATED => true, |
| 340 | + ), |
341 | 341 | 'watchlist' => array( |
342 | 342 | ApiBase :: PARAM_DFLT => 'preferences', |
343 | 343 | ApiBase :: PARAM_TYPE => array( |
— | — | @@ -377,8 +377,8 @@ |
378 | 378 | 'recreate' => 'Override any errors about the article having been deleted in the meantime', |
379 | 379 | 'createonly' => 'Don\'t edit the page if it exists already', |
380 | 380 | 'nocreate' => 'Throw an error if the page doesn\'t exist', |
381 | | - 'watch' => 'DEPRECATED! Add the page to your watchlist', |
382 | | - 'unwatch' => 'DEPRECATED! Remove the page from your watchlist', |
| 381 | + 'watch' => 'Add the page to your watchlist', |
| 382 | + 'unwatch' => 'Remove the page from your watchlist', |
383 | 383 | 'watchlist' => 'Unconditionally add or remove the page from your watchlist, use preferences or do not change watch', |
384 | 384 | 'captchaid' => 'CAPTCHA ID from previous request', |
385 | 385 | 'captchaword' => 'Answer to the CAPTCHA', |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -49,6 +49,7 @@ |
50 | 50 | const PARAM_MAX2 = 4; // Max value allowed for a parameter for bots and sysops. Only applies if TYPE='integer' |
51 | 51 | const PARAM_MIN = 5; // Lowest value allowed for a parameter. Only applies if TYPE='integer' |
52 | 52 | const PARAM_ALLOW_DUPLICATES = 6; // Boolean, do we allow the same value to be set more than once when ISMULTI=true |
| 53 | + const PARAM_DEPRECATED = 7; // Boolean, is the parameter deprecated (will show a warning) |
53 | 54 | |
54 | 55 | const LIMIT_BIG1 = 500; // Fast query, std user limit |
55 | 56 | const LIMIT_BIG2 = 5000; // Fast query, bot/sysop limit |
— | — | @@ -282,6 +283,11 @@ |
283 | 284 | if (is_array($desc)) |
284 | 285 | $desc = implode($paramPrefix, $desc); |
285 | 286 | |
| 287 | + $deprecated = isset( $paramSettings[self :: PARAM_DEPRECATED] ) ? |
| 288 | + $paramSettings[self :: PARAM_DEPRECATED] : false; |
| 289 | + if( $deprecated ) |
| 290 | + $desc = "DEPRECATED! $desc"; |
| 291 | + |
286 | 292 | $type = isset($paramSettings[self :: PARAM_TYPE])? $paramSettings[self :: PARAM_TYPE] : null; |
287 | 293 | if (isset ($type)) { |
288 | 294 | if (isset ($paramSettings[self :: PARAM_ISMULTI])) |
— | — | @@ -528,6 +534,7 @@ |
529 | 535 | $multi = isset ($paramSettings[self :: PARAM_ISMULTI]) ? $paramSettings[self :: PARAM_ISMULTI] : false; |
530 | 536 | $type = isset ($paramSettings[self :: PARAM_TYPE]) ? $paramSettings[self :: PARAM_TYPE] : null; |
531 | 537 | $dupes = isset ($paramSettings[self:: PARAM_ALLOW_DUPLICATES]) ? $paramSettings[self :: PARAM_ALLOW_DUPLICATES] : false; |
| 538 | + $deprecated = isset ($paramSettings[self:: PARAM_DEPRECATED]) ? $paramSettings[self :: PARAM_DEPRECATED] : false; |
532 | 539 | |
533 | 540 | // When type is not given, and no choices, the type is the same as $default |
534 | 541 | if (!isset ($type)) { |
— | — | @@ -621,6 +628,11 @@ |
622 | 629 | // Throw out duplicates if requested |
623 | 630 | if (is_array($value) && !$dupes) |
624 | 631 | $value = array_unique($value); |
| 632 | + |
| 633 | + // Set a warning if a deprecated parameter has been passed |
| 634 | + if( $deprecated ) { |
| 635 | + $this->setWarning( "The $encParamName parameter has been deprecated." ); |
| 636 | + } |
625 | 637 | } |
626 | 638 | |
627 | 639 | return $value; |
Index: trunk/phase3/includes/api/ApiParamInfo.php |
— | — | @@ -114,6 +114,9 @@ |
115 | 115 | $a = array('name' => $n); |
116 | 116 | if(isset($paramDesc[$n])) |
117 | 117 | $a['description'] = implode("\n", (array)$paramDesc[$n]); |
| 118 | + if(isset($p[ApiBase::PARAM_DEPRECATED])) |
| 119 | + if($p[ApiBase::PARAM_DEPRECATED]) |
| 120 | + $a['deprecated'] = ''; |
118 | 121 | if(!is_array($p)) |
119 | 122 | { |
120 | 123 | if(is_bool($p)) |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -660,6 +660,7 @@ |
661 | 661 | * (bug 21105) list=usercontribs can now list contribs for User:0 |
662 | 662 | * (bug 21085) list=deletedrevs no longer returns only one revision when |
663 | 663 | drcontinue param is passed |
| 664 | +* (bug 21106) Deprecated parameters now tagged in action=paraminfo |
664 | 665 | |
665 | 666 | === Languages updated in 1.16 === |
666 | 667 | |