Index: trunk/phase3/includes/api/ApiMove.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | class ApiMove extends ApiBase {
|
36 | 36 |
|
37 | 37 | public function __construct($main, $action) {
|
38 | | - parent :: __construct($main, $action);
|
| 38 | + parent :: __construct($main, $action);
|
39 | 39 | }
|
40 | 40 |
|
41 | 41 | public function execute() {
|
— | — | @@ -42,100 +42,100 @@ |
43 | 43 | $this->getMain()->requestWriteMode();
|
44 | 44 | $params = $this->extractRequestParams();
|
45 | 45 | if(is_null($params['reason']))
|
46 | | - $params['reason'] = '';
|
47 | | -
|
| 46 | + $params['reason'] = '';
|
| 47 | +
|
48 | 48 | $titleObj = NULL;
|
49 | 49 | if(!isset($params['from']))
|
50 | | - $this->dieUsage('The from parameter must be set', 'nofrom');
|
| 50 | + $this->dieUsage('The from parameter must be set', 'nofrom');
|
51 | 51 | if(!isset($params['to']))
|
52 | | - $this->dieUsage('The to parameter must be set', 'noto');
|
| 52 | + $this->dieUsage('The to parameter must be set', 'noto');
|
53 | 53 | if(!isset($params['token']))
|
54 | | - $this->dieUsage('The token parameter must be set', 'notoken');
|
| 54 | + $this->dieUsage('The token parameter must be set', 'notoken');
|
55 | 55 | if(!$wgUser->matchEditToken($params['token']))
|
56 | | - $this->dieUsage('Invalid token', 'badtoken');
|
| 56 | + $this->dieUsage('Invalid token', 'badtoken');
|
57 | 57 |
|
58 | 58 | if($wgUser->isBlocked())
|
59 | | - $this->dieUsage('You have been blocked from editing', 'blocked');
|
| 59 | + $this->dieUsage('You have been blocked from editing', 'blocked');
|
60 | 60 | if(wfReadOnly())
|
61 | | - $this->dieUsage('The wiki is in read-only mode', 'readonly');
|
| 61 | + $this->dieUsage('The wiki is in read-only mode', 'readonly');
|
62 | 62 | if($params['noredirect'] && !$wgUser->isAllowed('suppressredirect'))
|
63 | | - $this->dieUsage("You don't have permission to suppress redirect creation", 'nosuppress');
|
| 63 | + $this->dieUsage("You don't have permission to suppress redirect creation", 'nosuppress');
|
64 | 64 |
|
65 | 65 | $fromTitle = Title::newFromText($params['from']);
|
66 | 66 | if(!$fromTitle)
|
67 | | - $this->dieUsage("Bad title ``{$params['from']}''", 'invalidtitle');
|
| 67 | + $this->dieUsage("Bad title ``{$params['from']}''", 'invalidtitle');
|
68 | 68 | if(!$fromTitle->exists())
|
69 | | - $this->dieUsage("``{$params['from']}'' doesn't exist", 'missingtitle');
|
| 69 | + $this->dieUsage("``{$params['from']}'' doesn't exist", 'missingtitle');
|
70 | 70 | $fromTalk = $fromTitle->getTalkPage();
|
71 | 71 |
|
72 | | -
|
| 72 | +
|
73 | 73 | $toTitle = Title::newFromText($params['to']);
|
74 | 74 | if(!$toTitle)
|
75 | | - $this->dieUsage("Bad title ``{$params['to']}''", 'invalidtitle');
|
| 75 | + $this->dieUsage("Bad title ``{$params['to']}''", 'invalidtitle');
|
76 | 76 | $toTalk = $toTitle->getTalkPage();
|
77 | 77 |
|
78 | 78 | $dbw = wfGetDB(DB_MASTER);
|
79 | | - $dbw->begin();
|
| 79 | + $dbw->begin();
|
80 | 80 | $retval = $fromTitle->moveTo($toTitle, true, $params['reason'], !$params['noredirect']);
|
81 | 81 | if($retval !== true)
|
82 | | - switch($retval)
|
83 | | - {
|
84 | | - // case 'badtitletext': Can't happen
|
85 | | - // case 'badarticleerror': Can't happen
|
86 | | - case 'selfmove':
|
87 | | - $this->dieUsage("Can't move ``{$params['from']}'' to itself", 'selfmove');
|
88 | | - case 'immobile_namespace':
|
89 | | - if($fromTitle->isMovable())
|
90 | | - $this->dieUsage("Pages in the ``{$fromTitle->getNsText()}'' namespace can't be moved", 'immobilenamespace-from');
|
91 | | - $this->dieUsage("Pages in the ``{$toTitle->getNsText()}'' namespace can't be moved", 'immobilenamespace-to');
|
92 | | - case 'articleexists':
|
93 | | - $this->dieUsage("``{$toTitle->getPrefixedText()}'' already exists and is not a redirect to ``{$fromTitle->getPrefixedText()}''", 'targetexists');
|
94 | | - case 'protectedpage':
|
95 | | - $this->dieUsage("You don't have permission to move ``{$fromTitle->getPrefixedText()}'' to ``{$toTitle->getPrefixedText()}''", 'permissiondenied');
|
96 | | - default:
|
97 | | - throw new MWException( "Title::moveTo: Unknown return value ``{$retval}''" );
|
98 | | - }
|
| 82 | + switch($retval)
|
| 83 | + {
|
| 84 | + // case 'badtitletext': Can't happen
|
| 85 | + // case 'badarticleerror': Can't happen
|
| 86 | + case 'selfmove':
|
| 87 | + $this->dieUsage("Can't move ``{$params['from']}'' to itself", 'selfmove');
|
| 88 | + case 'immobile_namespace':
|
| 89 | + if($fromTitle->isMovable())
|
| 90 | + $this->dieUsage("Pages in the ``{$fromTitle->getNsText()}'' namespace can't be moved", 'immobilenamespace-from');
|
| 91 | + $this->dieUsage("Pages in the ``{$toTitle->getNsText()}'' namespace can't be moved", 'immobilenamespace-to');
|
| 92 | + case 'articleexists':
|
| 93 | + $this->dieUsage("``{$toTitle->getPrefixedText()}'' already exists and is not a redirect to ``{$fromTitle->getPrefixedText()}''", 'targetexists');
|
| 94 | + case 'protectedpage':
|
| 95 | + $this->dieUsage("You don't have permission to move ``{$fromTitle->getPrefixedText()}'' to ``{$toTitle->getPrefixedText()}''", 'permissiondenied');
|
| 96 | + default:
|
| 97 | + throw new MWException( "Title::moveTo: Unknown return value ``{$retval}''" );
|
| 98 | + }
|
99 | 99 | $r = array('from' => $fromTitle->getPrefixedText(), 'to' => $toTitle->getPrefixedText(), 'reason' => $params['reason']);
|
100 | 100 | if(!$params['noredirect'])
|
101 | | - $r['redirectcreated'] = '';
|
102 | | -
|
| 101 | + $r['redirectcreated'] = '';
|
| 102 | +
|
103 | 103 | if($params['movetalk'] && $fromTalk->exists() && !$fromTitle->isTalkPage())
|
104 | 104 | {
|
105 | | - // We need to move the talk page as well
|
106 | | - $toTalk = $toTitle->getTalkPage();
|
107 | | - $retval = $fromTalk->moveTo($toTalk, true, $params['reason'], !$params['noredirect']);
|
108 | | - if($retval === true)
|
| 105 | + // We need to move the talk page as well
|
| 106 | + $toTalk = $toTitle->getTalkPage();
|
| 107 | + $retval = $fromTalk->moveTo($toTalk, true, $params['reason'], !$params['noredirect']);
|
| 108 | + if($retval === true)
|
| 109 | + {
|
| 110 | + $r['talkfrom'] = $fromTalk->getPrefixedText();
|
| 111 | + $r['talkto'] = $toTalk->getPrefixedText();
|
| 112 | + }
|
| 113 | + // We're not gonna dieUsage() on failure, since we already changed something
|
| 114 | + else
|
| 115 | + switch($retval)
|
109 | 116 | {
|
110 | | - $r['talkfrom'] = $fromTalk->getPrefixedText();
|
111 | | - $r['talkto'] = $toTalk->getPrefixedText();
|
112 | | - }
|
113 | | - // We're not gonna dieUsage() on failure, since we already changed something
|
114 | | - else
|
115 | | - switch($retval)
|
| 117 | + case 'immobile_namespace':
|
| 118 | + if($fromTalk->isMovable())
|
116 | 119 | {
|
117 | | - case 'immobile_namespace':
|
118 | | - if($fromTalk->isMovable())
|
119 | | - {
|
120 | | - $r['talkmove-error-code'] = 'immobilenamespace-from';
|
121 | | - $r['talkmove-error-info'] = "Pages in the ``{$fromTalk->getNsText()}'' namespace can't be moved";
|
122 | | - }
|
123 | | - else
|
124 | | - {
|
125 | | - $r['talkmove-error-code'] = 'immobilenamespace-to';
|
126 | | - $r['talkmove-error-info'] = "Pages in the ``{$toTalk->getNsText()}'' namespace can't be moved";
|
127 | | - }
|
128 | | - break;
|
129 | | - case 'articleexists':
|
130 | | - $r['talkmove-error-code'] = 'targetexists';
|
131 | | - $r['talkmove-error-info'] = "``{$toTalk->getPrefixedText()}'' already exists and is not a redirect to ``{$fromTalk->getPrefixedText()}''";
|
132 | | - break;
|
133 | | - case 'protectedpage':
|
134 | | - $r['talkmove-error-code'] = 'permissiondenied';
|
135 | | - $r['talkmove-error-info'] = "You don't have permission to move ``{$fromTalk->getPrefixedText()}'' to ``{$toTalk->getPrefixedText()}''";
|
136 | | - default:
|
137 | | - $r['talkmove-error-code'] = 'unknownerror';
|
138 | | - $r['talkmove-error-info'] = "Unknown error ``$retval''";
|
139 | | - }
|
| 120 | + $r['talkmove-error-code'] = 'immobilenamespace-from';
|
| 121 | + $r['talkmove-error-info'] = "Pages in the ``{$fromTalk->getNsText()}'' namespace can't be moved";
|
| 122 | + }
|
| 123 | + else
|
| 124 | + {
|
| 125 | + $r['talkmove-error-code'] = 'immobilenamespace-to';
|
| 126 | + $r['talkmove-error-info'] = "Pages in the ``{$toTalk->getNsText()}'' namespace can't be moved";
|
| 127 | + }
|
| 128 | + break;
|
| 129 | + case 'articleexists':
|
| 130 | + $r['talkmove-error-code'] = 'targetexists';
|
| 131 | + $r['talkmove-error-info'] = "``{$toTalk->getPrefixedText()}'' already exists and is not a redirect to ``{$fromTalk->getPrefixedText()}''";
|
| 132 | + break;
|
| 133 | + case 'protectedpage':
|
| 134 | + $r['talkmove-error-code'] = 'permissiondenied';
|
| 135 | + $r['talkmove-error-info'] = "You don't have permission to move ``{$fromTalk->getPrefixedText()}'' to ``{$toTalk->getPrefixedText()}''";
|
| 136 | + default:
|
| 137 | + $r['talkmove-error-code'] = 'unknownerror';
|
| 138 | + $r['talkmove-error-info'] = "Unknown error ``$retval''";
|
| 139 | + }
|
140 | 140 | }
|
141 | 141 | $dbw->commit(); // Make sure all changes are really written to the DB
|
142 | 142 | $this->getResult()->addValue(null, $this->getModuleName(), $r);
|
— | — | @@ -179,4 +179,3 @@ |
180 | 180 | return __CLASS__ . ': $Id$';
|
181 | 181 | }
|
182 | 182 | }
|
183 | | -
|
Index: trunk/phase3/includes/api/ApiChangeRights.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | $this->getMain()->requestWriteMode();
|
43 | 43 |
|
44 | 44 | if(wfReadOnly())
|
45 | | - $this->dieUsage('The wiki is in read-only mode', 'readonly');
|
| 45 | + $this->dieUsage('The wiki is in read-only mode', 'readonly');
|
46 | 46 | $params = $this->extractRequestParams();
|
47 | 47 |
|
48 | 48 | $ur = new UserrightsForm($wgRequest);
|
Index: trunk/phase3/includes/api/ApiQueryDeletedrevs.php |
— | — | @@ -48,190 +48,185 @@ |
49 | 49 | global $wgUser;
|
50 | 50 | // Before doing anything at all, let's check permissions
|
51 | 51 | if(!$wgUser->isAllowed('deletedhistory'))
|
52 | | - $this->dieUsage('You don\'t have permission to view deleted revisions information', 'permissiondenied');
|
| 52 | + $this->dieUsage('You don\'t have permission to view deleted revisions', 'permissiondenied');
|
53 | 53 |
|
54 | | - $db = $this->getDB();
|
55 | | - $params = $this->extractRequestParams();
|
56 | | - $prop = array_flip($params['prop']);
|
57 | | - $fld_revid = isset($prop['revid']);
|
58 | | - $fld_user = isset($prop['user']);
|
59 | | - $fld_comment = isset($prop['comment']);
|
60 | | - $fld_minor = isset($prop['minor']);
|
61 | | - $fld_len = isset($prop['len']);
|
62 | | - $fld_content = isset($prop['content']);
|
63 | | - $fld_token = isset($prop['token']);
|
| 54 | + $db = $this->getDB();
|
| 55 | + $params = $this->extractRequestParams();
|
| 56 | + $prop = array_flip($params['prop']);
|
| 57 | + $fld_revid = isset($prop['revid']);
|
| 58 | + $fld_user = isset($prop['user']);
|
| 59 | + $fld_comment = isset($prop['comment']);
|
| 60 | + $fld_minor = isset($prop['minor']);
|
| 61 | + $fld_len = isset($prop['len']);
|
| 62 | + $fld_content = isset($prop['content']);
|
| 63 | + $fld_token = isset($prop['token']);
|
64 | 64 |
|
65 | | - $result = $this->getResult();
|
66 | | - $pageSet = $this->getPageSet();
|
67 | | - $titles = $pageSet->getTitles();
|
68 | | - $data = array();
|
| 65 | + $result = $this->getResult();
|
| 66 | + $pageSet = $this->getPageSet();
|
| 67 | + $titles = $pageSet->getTitles();
|
| 68 | + $data = array();
|
69 | 69 |
|
70 | | - $this->addTables('archive');
|
71 | | - $this->addFields(array('ar_title', 'ar_namespace', 'ar_timestamp'));
|
| 70 | + $this->addTables('archive');
|
| 71 | + $this->addFields(array('ar_title', 'ar_namespace', 'ar_timestamp'));
|
| 72 | + if($fld_revid)
|
| 73 | + $this->addFields('ar_rev_id');
|
| 74 | + if($fld_user)
|
| 75 | + $this->addFields('ar_user_text');
|
| 76 | + if($fld_comment)
|
| 77 | + $this->addFields('ar_comment');
|
| 78 | + if($fld_minor)
|
| 79 | + $this->addFields('ar_minor_edit');
|
| 80 | + if($fld_len)
|
| 81 | + $this->addFields('ar_len');
|
| 82 | + if($fld_content)
|
| 83 | + {
|
| 84 | + $this->addTables('text');
|
| 85 | + $this->addFields(array('ar_text', 'ar_text_id', 'old_text', 'old_flags'));
|
| 86 | + $this->addWhere('ar_text_id = old_id');
|
| 87 | +
|
| 88 | + // This also means stricter limits
|
| 89 | + $userMax = 50;
|
| 90 | + $botMax = 200;
|
| 91 | + $this->validateLimit('limit', $params['limit'], 1, $userMax, $botMax);
|
| 92 | + }
|
| 93 | + if($fld_token)
|
| 94 | + // Undelete tokens are identical for all pages, so we cache one here
|
| 95 | + $token = $wgUser->editToken();
|
| 96 | +
|
| 97 | + // We need a custom WHERE clause that matches all titles.
|
| 98 | + if(count($titles) > 0)
|
| 99 | + {
|
| 100 | + $lb = new LinkBatch($titles);
|
| 101 | + $where = $lb->constructSet('ar', $db);
|
| 102 | + $this->addWhere($where);
|
| 103 | + }
|
| 104 | +
|
| 105 | + $this->addOption('LIMIT', $params['limit'] + 1);
|
| 106 | + $this->addWhereRange('ar_timestamp', $params['dir'], $params['start'], $params['end']);
|
| 107 | + if(isset($params['namespace']))
|
| 108 | + $this->addWhereFld('ar_namespace', $params['namespace']);
|
| 109 | + $res = $this->select(__METHOD__);
|
| 110 | + $pages = array();
|
| 111 | + $count = 0;
|
| 112 | + // First populate the $pages array
|
| 113 | + while($row = $db->fetchObject($res))
|
| 114 | + {
|
| 115 | + if($count++ == $params['limit'])
|
| 116 | + {
|
| 117 | + // We've had enough
|
| 118 | + $this->setContinueEnumParameter('start', wfTimestamp(TS_ISO_8601, $row->ar_timestamp));
|
| 119 | + break;
|
| 120 | + }
|
| 121 | +
|
| 122 | + $rev = array();
|
| 123 | + $rev['timestamp'] = wfTimestamp(TS_ISO_8601, $row->ar_timestamp);
|
72 | 124 | if($fld_revid)
|
73 | | - $this->addFields('ar_rev_id');
|
| 125 | + $rev['revid'] = $row->ar_rev_id;
|
74 | 126 | if($fld_user)
|
75 | | - $this->addFields('ar_user_text');
|
| 127 | + $rev['user'] = $row->ar_user_text;
|
76 | 128 | if($fld_comment)
|
77 | | - $this->addFields('ar_comment');
|
| 129 | + $rev['comment'] = $row->ar_comment;
|
78 | 130 | if($fld_minor)
|
79 | | - $this->addFields('ar_minor_edit');
|
| 131 | + if($row->ar_minor_edit == 1)
|
| 132 | + $rev['minor'] = '';
|
80 | 133 | if($fld_len)
|
81 | | - $this->addFields('ar_len');
|
| 134 | + $rev['len'] = $row->ar_len;
|
82 | 135 | if($fld_content)
|
83 | | - {
|
84 | | - $this->addTables('text');
|
85 | | - $this->addFields(array('ar_text', 'ar_text_id', 'old_text', 'old_flags'));
|
86 | | - $this->addWhere('ar_text_id = old_id');
|
| 136 | + ApiResult::setContent($rev, Revision::getRevisionText($row));
|
87 | 137 |
|
88 | | - // This also means stricter limits
|
89 | | - $userMax = 50;
|
90 | | - $botMax = 200;
|
91 | | - $this->validateLimit('limit', $params['limit'], 1, $userMax, $botMax);
|
92 | | -
|
93 | | - // And also stricter restrictions
|
94 | | - if(!$wgUser->isAllowed('delete')) {
|
95 | | - $this->dieUsage('You don\'t have permission to view deleted revisions content', 'permissiondeniedcontent');
|
96 | | - }
|
97 | | - }
|
98 | | - if($fld_token)
|
99 | | - // Undelete tokens are identical for all pages, so we cache one here
|
100 | | - $token = $wgUser->editToken();
|
101 | | -
|
102 | | - // We need a custom WHERE clause that matches all titles.
|
103 | | - if(count($titles) > 0)
|
| 138 | + $t = Title::makeTitle($row->ar_namespace, $row->ar_title);
|
| 139 | + if(!isset($pages[$t->getPrefixedText()]))
|
104 | 140 | {
|
105 | | - $lb = new LinkBatch($titles);
|
106 | | - $where = $lb->constructSet('ar', $db);
|
107 | | - $this->addWhere($where);
|
| 141 | + $pages[$t->getPrefixedText()] = array(
|
| 142 | + 'title' => $t->getPrefixedText(),
|
| 143 | + 'ns' => intval($row->ar_namespace),
|
| 144 | + 'revisions' => array($rev)
|
| 145 | + );
|
| 146 | + if($fld_token)
|
| 147 | + $pages[$t->getPrefixedText()]['token'] = $token;
|
108 | 148 | }
|
| 149 | + else
|
| 150 | + $pages[$t->getPrefixedText()]['revisions'][] = $rev;
|
| 151 | + }
|
| 152 | + $db->freeResult($res);
|
109 | 153 |
|
110 | | - $this->addOption('LIMIT', $params['limit'] + 1);
|
111 | | - $this->addWhereRange('ar_timestamp', $params['dir'], $params['start'], $params['end']);
|
112 | | - if(isset($params['namespace']))
|
113 | | - $this->addWhereFld('ar_namespace', $params['namespace']);
|
114 | | - $res = $this->select(__METHOD__);
|
115 | | - $pages = array();
|
116 | | - $count = 0;
|
117 | | - // First populate the $pages array
|
118 | | - while($row = $db->fetchObject($res))
|
119 | | - {
|
120 | | - if($count++ == $params['limit'])
|
121 | | - {
|
122 | | - // We've had enough
|
123 | | - $this->setContinueEnumParameter('start', wfTimestamp(TS_ISO_8601, $row->ar_timestamp));
|
124 | | - break;
|
125 | | - }
|
126 | | -
|
127 | | - $rev = array();
|
128 | | - $rev['timestamp'] = wfTimestamp(TS_ISO_8601, $row->ar_timestamp);
|
129 | | - if($fld_revid)
|
130 | | - $rev['revid'] = $row->ar_rev_id;
|
131 | | - if($fld_user)
|
132 | | - $rev['user'] = $row->ar_user_text;
|
133 | | - if($fld_comment)
|
134 | | - $rev['comment'] = $row->ar_comment;
|
135 | | - if($fld_minor)
|
136 | | - if($row->ar_minor_edit == 1)
|
137 | | - $rev['minor'] = '';
|
138 | | - if($fld_len)
|
139 | | - $rev['len'] = $row->ar_len;
|
140 | | - if($fld_content)
|
141 | | - ApiResult::setContent($rev, Revision::getRevisionText($row));
|
142 | | -
|
143 | | - $t = Title::makeTitle($row->ar_namespace, $row->ar_title);
|
144 | | - if(!isset($pages[$t->getPrefixedText()]))
|
145 | | - {
|
146 | | - $pages[$t->getPrefixedText()] = array(
|
147 | | - 'title' => $t->getPrefixedText(),
|
148 | | - 'ns' => intval($row->ar_namespace),
|
149 | | - 'revisions' => array($rev)
|
150 | | - );
|
151 | | - if($fld_token)
|
152 | | - $pages[$t->getPrefixedText()]['token'] = $token;
|
153 | | - }
|
154 | | - else
|
155 | | - $pages[$t->getPrefixedText()]['revisions'][] = $rev;
|
156 | | - }
|
157 | | - $db->freeResult($res);
|
158 | | -
|
159 | | - // We don't want entire pagenames as keys, so let's make this array indexed
|
160 | | - foreach($pages as $page)
|
161 | | - {
|
162 | | - $result->setIndexedTagName($page['revisions'], 'rev');
|
163 | | - $data[] = $page;
|
164 | | - }
|
165 | | - $result->setIndexedTagName($data, 'page');
|
166 | | - $result->addValue('query', $this->getModuleName(), $data);
|
| 154 | + // We don't want entire pagenames as keys, so let's make this array indexed
|
| 155 | + foreach($pages as $page)
|
| 156 | + {
|
| 157 | + $result->setIndexedTagName($page['revisions'], 'rev');
|
| 158 | + $data[] = $page;
|
167 | 159 | }
|
| 160 | + $result->setIndexedTagName($data, 'page');
|
| 161 | + $result->addValue('query', $this->getModuleName(), $data);
|
| 162 | + }
|
168 | 163 |
|
169 | 164 | protected function getAllowedParams() {
|
170 | | - return array (
|
171 | | - 'start' => array(
|
172 | | - ApiBase :: PARAM_TYPE => 'timestamp'
|
| 165 | + return array (
|
| 166 | + 'start' => array(
|
| 167 | + ApiBase :: PARAM_TYPE => 'timestamp'
|
| 168 | + ),
|
| 169 | + 'end' => array(
|
| 170 | + ApiBase :: PARAM_TYPE => 'timestamp',
|
| 171 | + ),
|
| 172 | + 'dir' => array(
|
| 173 | + ApiBase :: PARAM_TYPE => array(
|
| 174 | + 'newer',
|
| 175 | + 'older'
|
| 176 | + ),
|
| 177 | + ApiBase :: PARAM_DFLT => 'older'
|
| 178 | + ),
|
| 179 | + 'namespace' => array(
|
| 180 | + ApiBase :: PARAM_ISMULTI => true,
|
| 181 | + ApiBase :: PARAM_TYPE => 'namespace'
|
| 182 | + ),
|
| 183 | + 'limit' => array(
|
| 184 | + ApiBase :: PARAM_DFLT => 10,
|
| 185 | + ApiBase :: PARAM_TYPE => 'limit',
|
| 186 | + ApiBase :: PARAM_MIN => 1,
|
| 187 | + ApiBase :: PARAM_MAX => ApiBase :: LIMIT_BIG1,
|
| 188 | + ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2
|
| 189 | + ),
|
| 190 | + 'prop' => array(
|
| 191 | + ApiBase :: PARAM_DFLT => 'user|comment',
|
| 192 | + ApiBase :: PARAM_TYPE => array(
|
| 193 | + 'revid',
|
| 194 | + 'user',
|
| 195 | + 'comment',
|
| 196 | + 'minor',
|
| 197 | + 'len',
|
| 198 | + 'content',
|
| 199 | + 'token'
|
173 | 200 | ),
|
174 | | - 'end' => array(
|
175 | | - ApiBase :: PARAM_TYPE => 'timestamp',
|
176 | | - ),
|
177 | | - 'dir' => array(
|
178 | | - ApiBase :: PARAM_TYPE => array(
|
179 | | - 'newer',
|
180 | | - 'older'
|
181 | | - ),
|
182 | | - ApiBase :: PARAM_DFLT => 'older'
|
183 | | - ),
|
184 | | - 'namespace' => array(
|
185 | | - ApiBase :: PARAM_ISMULTI => true,
|
186 | | - ApiBase :: PARAM_TYPE => 'namespace'
|
187 | | - ),
|
188 | | - 'limit' => array(
|
189 | | - ApiBase :: PARAM_DFLT => 10,
|
190 | | - ApiBase :: PARAM_TYPE => 'limit',
|
191 | | - ApiBase :: PARAM_MIN => 1,
|
192 | | - ApiBase :: PARAM_MAX => ApiBase :: LIMIT_BIG1,
|
193 | | - ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2
|
194 | | - ),
|
195 | | - 'prop' => array(
|
196 | | - ApiBase :: PARAM_DFLT => 'user|comment',
|
197 | | - ApiBase :: PARAM_TYPE => array(
|
198 | | - 'revid',
|
199 | | - 'user',
|
200 | | - 'comment',
|
201 | | - 'minor',
|
202 | | - 'len',
|
203 | | - 'content',
|
204 | | - 'token'
|
205 | | - ),
|
206 | | - ApiBase :: PARAM_ISMULTI => true
|
207 | | - )
|
208 | | - );
|
| 201 | + ApiBase :: PARAM_ISMULTI => true
|
| 202 | + )
|
| 203 | + );
|
209 | 204 | }
|
210 | 205 |
|
211 | 206 | protected function getParamDescription() {
|
212 | | - return array (
|
213 | | - 'start' => 'The timestamp to start enumerating from',
|
214 | | - 'end' => 'The timestamp to stop enumerating at',
|
215 | | - 'dir' => 'The direction in which to enumerate',
|
216 | | - 'namespace' => 'The namespaces to search in',
|
217 | | - 'limit' => 'The maximum amount of revisions to list',
|
218 | | - 'prop' => 'Which properties to get'
|
219 | | - );
|
| 207 | + return array (
|
| 208 | + 'start' => 'The timestamp to start enumerating from',
|
| 209 | + 'end' => 'The timestamp to stop enumerating at',
|
| 210 | + 'dir' => 'The direction in which to enumerate',
|
| 211 | + 'namespace' => 'The namespaces to search in',
|
| 212 | + 'limit' => 'The maximum amount of revisions to list',
|
| 213 | + 'prop' => 'Which properties to get'
|
| 214 | + );
|
220 | 215 | }
|
221 | 216 |
|
222 | 217 | protected function getDescription() {
|
223 | | - return 'List deleted revisions.';
|
| 218 | + return 'List deleted revisions.';
|
224 | 219 | }
|
225 | 220 |
|
226 | 221 | protected function getExamples() {
|
227 | | - return array (
|
228 | | - 'List the first 50 deleted revisions in the Category and Category talk namespaces',
|
229 | | - ' api.php?action=query&list=deletedrevs&drdir=newer&drlimit=50&drnamespace=14|15',
|
230 | | - 'List the last deleted revisions of Main Page and Talk:Main Page, with content:',
|
231 | | - ' api.php?action=query&list=deletedrevs&titles=Main%20Page|Talk:Main%20Page&drprop=user|comment|content'
|
232 | | - );
|
| 222 | + return array (
|
| 223 | + 'List the first 50 deleted revisions in the Category and Category talk namespaces',
|
| 224 | + ' api.php?action=query&list=deletedrevs&drdir=newer&drlimit=50&drnamespace=14|15',
|
| 225 | + 'List the last deleted revisions of Main Page and Talk:Main Page, with content:',
|
| 226 | + ' api.php?action=query&list=deletedrevs&titles=Main%20Page|Talk:Main%20Page&drprop=user|comment|content'
|
| 227 | + );
|
233 | 228 | }
|
234 | 229 |
|
235 | 230 | public function getVersion() {
|
236 | | - return __CLASS__ . ': $Id: ApiQueryDeletedrevs.php 23531 2007-06-30 01:19:14Z simetrical $';
|
| 231 | + return __CLASS__ . ': $Id: ApiQueryDeletedrevs.php 23531 2007-06-30 01:19:14Z simetrical $';
|
237 | 232 | }
|
238 | 233 | }
|