Index: trunk/phase3/includes/api/ApiQueryAllLinks.php |
— | — | @@ -92,6 +92,9 @@ |
93 | 93 | if ( !is_null( $params['from'] ) ) { |
94 | 94 | $this->addWhere( 'pl_title>=' . $db->addQuotes( $this->titlePartToKey( $params['from'] ) ) ); |
95 | 95 | } |
| 96 | + if ( !is_null( $params['to'] ) ) { |
| 97 | + $this->addWhere( 'pl_title<=' . $db->addQuotes( $this->titlePartToKey( $params['to'] ) ) ); |
| 98 | + } |
96 | 99 | if ( isset( $params['prefix'] ) ) { |
97 | 100 | $this->addWhere( 'pl_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) ); |
98 | 101 | } |
— | — | @@ -161,6 +164,7 @@ |
162 | 165 | return array( |
163 | 166 | 'continue' => null, |
164 | 167 | 'from' => null, |
| 168 | + 'to' => null, |
165 | 169 | 'prefix' => null, |
166 | 170 | 'unique' => false, |
167 | 171 | 'prop' => array( |
— | — | @@ -189,6 +193,7 @@ |
190 | 194 | $p = $this->getModulePrefix(); |
191 | 195 | return array( |
192 | 196 | 'from' => 'The page title to start enumerating from', |
| 197 | + 'to' => 'The page title to stop enumerating at', |
193 | 198 | 'prefix' => 'Search for all page titles that begin with this value', |
194 | 199 | 'unique' => "Only show unique links. Cannot be used with generator or {$p}prop=ids", |
195 | 200 | 'prop' => array( |
Index: trunk/phase3/includes/api/ApiQueryAllCategories.php |
— | — | @@ -59,9 +59,13 @@ |
60 | 60 | $this->addTables( 'category' ); |
61 | 61 | $this->addFields( 'cat_title' ); |
62 | 62 | |
63 | | - $dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
| 63 | + $fromdir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
| 64 | + $todir = ( $params['dir'] != 'descending' ? 'older' : 'newer' ); |
64 | 65 | $from = ( is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) ); |
65 | | - $this->addWhereRange( 'cat_title', $dir, $from, null ); |
| 66 | + $to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) ); |
| 67 | + $this->addWhereRange( 'cat_title', $fromdir, $from, null ); |
| 68 | + $this->addWhereRange( 'cat_title', $todir, $to, null ); |
| 69 | + |
66 | 70 | if ( isset( $params['prefix'] ) ) { |
67 | 71 | $this->addWhere( 'cat_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) ); |
68 | 72 | } |
— | — | @@ -132,6 +136,7 @@ |
133 | 137 | public function getAllowedParams() { |
134 | 138 | return array( |
135 | 139 | 'from' => null, |
| 140 | + 'to' => null, |
136 | 141 | 'prefix' => null, |
137 | 142 | 'dir' => array( |
138 | 143 | ApiBase::PARAM_DFLT => 'ascending', |
— | — | @@ -158,6 +163,7 @@ |
159 | 164 | public function getParamDescription() { |
160 | 165 | return array( |
161 | 166 | 'from' => 'The category to start enumerating from', |
| 167 | + 'to' => 'The category to stop enumerating at', |
162 | 168 | 'prefix' => 'Search for all category titles that begin with this value', |
163 | 169 | 'dir' => 'Direction to sort in', |
164 | 170 | 'limit' => 'How many categories to return', |
Index: trunk/phase3/includes/api/ApiQueryAllpages.php |
— | — | @@ -70,9 +70,12 @@ |
71 | 71 | } |
72 | 72 | |
73 | 73 | $this->addWhereFld( 'page_namespace', $params['namespace'] ); |
74 | | - $dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
| 74 | + $fromdir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
| 75 | + $todir = ( $params['dir'] != 'descending' ? 'older' : 'newer' ); |
75 | 76 | $from = ( is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) ); |
76 | | - $this->addWhereRange( 'page_title', $dir, $from, null ); |
| 77 | + $to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) ); |
| 78 | + $this->addWhereRange( 'page_title', $fromdir, $from, null ); |
| 79 | + $this->addWhereRange( 'page_title', $todir, $to, null ); |
77 | 80 | |
78 | 81 | if ( isset( $params['prefix'] ) ) { |
79 | 82 | $this->addWhere( 'page_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) ); |
— | — | @@ -189,6 +192,7 @@ |
190 | 193 | |
191 | 194 | return array( |
192 | 195 | 'from' => null, |
| 196 | + 'to' => null, |
193 | 197 | 'prefix' => null, |
194 | 198 | 'namespace' => array( |
195 | 199 | ApiBase::PARAM_DFLT => 0, |
— | — | @@ -253,6 +257,7 @@ |
254 | 258 | $p = $this->getModulePrefix(); |
255 | 259 | return array( |
256 | 260 | 'from' => 'The page title to start enumerating from', |
| 261 | + 'to' => 'The page title to stop enumerating at', |
257 | 262 | 'prefix' => 'Search for all page titles that begin with this value', |
258 | 263 | 'namespace' => 'The namespace to enumerate', |
259 | 264 | 'filterredir' => 'Which pages to list', |
Index: trunk/phase3/includes/api/ApiQueryAllimages.php |
— | — | @@ -78,9 +78,13 @@ |
79 | 79 | $params = $this->extractRequestParams(); |
80 | 80 | |
81 | 81 | // Image filters |
82 | | - $dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
| 82 | + $fromdir = ( $params['dir'] == 'descending' ? 'older' : 'newer' ); |
| 83 | + $todir = ( $params['dir'] != 'descending' ? 'older' : 'newer' ); |
83 | 84 | $from = ( is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) ); |
84 | | - $this->addWhereRange( 'img_name', $dir, $from, null ); |
| 85 | + $to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) ); |
| 86 | + $this->addWhereRange( 'img_name', $fromdir, $from, null ); |
| 87 | + $this->addWhereRange( 'img_name', $todir, $to, null ); |
| 88 | + |
85 | 89 | if ( isset( $params['prefix'] ) ) |
86 | 90 | $this->addWhere( 'img_name' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) ); |
87 | 91 | |
— | — | @@ -149,6 +153,7 @@ |
150 | 154 | public function getAllowedParams() { |
151 | 155 | return array ( |
152 | 156 | 'from' => null, |
| 157 | + 'to' => null, |
153 | 158 | 'prefix' => null, |
154 | 159 | 'minsize' => array( |
155 | 160 | ApiBase::PARAM_TYPE => 'integer', |
— | — | @@ -183,6 +188,7 @@ |
184 | 189 | public function getParamDescription() { |
185 | 190 | return array( |
186 | 191 | 'from' => 'The image title to start enumerating from', |
| 192 | + 'to' => 'The image title to stop enumerating at', |
187 | 193 | 'prefix' => 'Search for all image titles that begin with this value', |
188 | 194 | 'dir' => 'The direction in which to list', |
189 | 195 | 'minsize' => 'Limit to images with at least this many bytes', |
Index: trunk/phase3/includes/api/ApiQueryAllmessages.php |
— | — | @@ -76,12 +76,17 @@ |
77 | 77 | |
78 | 78 | // Get all requested messages and print the result |
79 | 79 | $skip = !is_null( $params['from'] ); |
| 80 | + $useto = !is_null( $params['to'] ); |
80 | 81 | $result = $this->getResult(); |
81 | 82 | foreach ( $messages_target as $message ) { |
82 | 83 | // Skip all messages up to $params['from'] |
83 | 84 | if ( $skip && $message === $params['from'] ) { |
84 | 85 | $skip = false; |
85 | 86 | } |
| 87 | + |
| 88 | + if( $useto && $message > $params['to'] ) { |
| 89 | + break; |
| 90 | + } |
86 | 91 | |
87 | 92 | if ( !$skip ) { |
88 | 93 | $a = array( 'name' => $message ); |
— | — | @@ -160,6 +165,7 @@ |
161 | 166 | 'filter' => array(), |
162 | 167 | 'lang' => null, |
163 | 168 | 'from' => null, |
| 169 | + 'to' => null, |
164 | 170 | ); |
165 | 171 | } |
166 | 172 | |
— | — | @@ -173,6 +179,7 @@ |
174 | 180 | 'filter' => 'Return only messages that contain this string', |
175 | 181 | 'lang' => 'Return messages in this language', |
176 | 182 | 'from' => 'Return messages starting at this message', |
| 183 | + 'to' => 'Return messages ending at this message', |
177 | 184 | ); |
178 | 185 | } |
179 | 186 | |
Index: trunk/phase3/includes/api/ApiQueryAllUsers.php |
— | — | @@ -61,6 +61,9 @@ |
62 | 62 | if ( !is_null( $params['from'] ) ) { |
63 | 63 | $this->addWhere( 'u1.user_name >= ' . $db->addQuotes( $this->keyToTitle( $params['from'] ) ) ); |
64 | 64 | } |
| 65 | + if ( !is_null( $params['to'] ) ) { |
| 66 | + $this->addWhere( 'u1.user_name <= ' . $db->addQuotes( $this->keyToTitle( $params['to'] ) ) ); |
| 67 | + } |
65 | 68 | |
66 | 69 | if ( !is_null( $params['prefix'] ) ) { |
67 | 70 | $this->addWhere( 'u1.user_name' . $db->buildLike( $this->keyToTitle( $params['prefix'] ), $db->anyString() ) ); |
— | — | @@ -191,6 +194,7 @@ |
192 | 195 | public function getAllowedParams() { |
193 | 196 | return array( |
194 | 197 | 'from' => null, |
| 198 | + 'to' => null, |
195 | 199 | 'prefix' => null, |
196 | 200 | 'group' => array( |
197 | 201 | ApiBase::PARAM_TYPE => User::getAllGroups() |
— | — | @@ -218,6 +222,7 @@ |
219 | 223 | public function getParamDescription() { |
220 | 224 | return array( |
221 | 225 | 'from' => 'The user name to start enumerating from', |
| 226 | + 'to' => 'The user name to stop enumerating at', |
222 | 227 | 'prefix' => 'Search for all page titles that begin with this value', |
223 | 228 | 'group' => 'Limit users to a given group name', |
224 | 229 | 'prop' => array( |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -326,6 +326,8 @@ |
327 | 327 | the parameter, the API will automatically throw an error. |
328 | 328 | * (bug 24665) When starttimestamp is not specified, fake it by setting it to NOW, not to |
329 | 329 | the timestamp of the last edit |
| 330 | +* (bug 24677) axto= parameters added to allcategories, allimages, alllinks, allmessages, |
| 331 | + allpages, and allusers |
330 | 332 | |
331 | 333 | === Languages updated in 1.17 === |
332 | 334 | |