Index: branches/petrb/phase3/includes/Defines.php |
— | — | @@ -250,3 +250,8 @@ |
251 | 251 | define( 'PROTO_CURRENT', null ); |
252 | 252 | define( 'PROTO_CANONICAL', 1 ); |
253 | 253 | define( 'PROTO_INTERNAL', 2 ); |
| 254 | + |
| 255 | +/** |
| 256 | + * Common example strings for api examples |
| 257 | + */ |
| 258 | +define( 'EXAMPLE_TOKEN', 'abcdef123456789ab12ab12cd45ef78' ); //in case that way how token looks change it would save us a lot of work rewriting all examples |
Index: branches/petrb/phase3/includes/api/ApiMove.php |
— | — | @@ -256,7 +256,7 @@ |
257 | 257 | |
258 | 258 | public function getExamples() { |
259 | 259 | return array( |
260 | | - 'api.php?action=move&from=Exampel&to=Example&token=123ABC&reason=Misspelled%20title&movetalk=&noredirect=' |
| 260 | + 'api.php?action=move&from=Exampel&to=Example&token=' . EXAMPLE_TOKEN . '&reason=Misspelled%20title&movetalk=&noredirect=' |
261 | 261 | ); |
262 | 262 | } |
263 | 263 | |
Index: branches/petrb/phase3/includes/api/ApiProtect.php |
— | — | @@ -219,8 +219,8 @@ |
220 | 220 | |
221 | 221 | public function getExamples() { |
222 | 222 | return array( |
223 | | - 'api.php?action=protect&title=Main%20Page&token=123ABC&protections=edit=sysop|move=sysop&cascade=&expiry=20070901163000|never', |
224 | | - 'api.php?action=protect&title=Main%20Page&token=123ABC&protections=edit=all|move=all&reason=Lifting%20restrictions' |
| 223 | + 'api.php?action=protect&title=Main%20Page&token=' . EXAMPLE_TOKEN . '&protections=edit=sysop|move=sysop&cascade=&expiry=20070901163000|never', |
| 224 | + 'api.php?action=protect&title=Main%20Page&token=' . EXAMPLE_TOKEN . '&protections=edit=all|move=all&reason=Lifting%20restrictions' |
225 | 225 | ); |
226 | 226 | } |
227 | 227 | |
Index: branches/petrb/phase3/includes/api/ApiRollback.php |
— | — | @@ -186,8 +186,8 @@ |
187 | 187 | |
188 | 188 | public function getExamples() { |
189 | 189 | return array( |
190 | | - 'api.php?action=rollback&title=Main%20Page&user=Catrope&token=123ABC', |
191 | | - 'api.php?action=rollback&title=Main%20Page&user=217.121.114.116&token=123ABC&summary=Reverting%20vandalism&markbot=1' |
| 190 | + 'api.php?action=rollback&title=Main%20Page&user=Catrope&token=' . EXAMPLE_TOKEN, |
| 191 | + 'api.php?action=rollback&title=Main%20Page&user=217.121.114.116&token=' . EXAMPLE_TOKEN . '&summary=Reverting%20vandalism&markbot=1' |
192 | 192 | ); |
193 | 193 | } |
194 | 194 | |
Index: branches/petrb/phase3/includes/api/ApiDelete.php |
— | — | @@ -271,8 +271,8 @@ |
272 | 272 | |
273 | 273 | public function getExamples() { |
274 | 274 | return array( |
275 | | - 'api.php?action=delete&title=Main%20Page&token=123ABC', |
276 | | - 'api.php?action=delete&title=Main%20Page&token=123ABC&reason=Preparing%20for%20move' |
| 275 | + 'api.php?action=delete&title=Main%20Page&token=' . EXAMPLE_TOKEN, |
| 276 | + 'api.php?action=delete&title=Main%20Page&token' . EXAMPLE_TOKEN . '&reason=Preparing%20for%20move' |
277 | 277 | ); |
278 | 278 | } |
279 | 279 | |
Index: branches/petrb/phase3/includes/api/ApiImport.php |
— | — | @@ -161,7 +161,7 @@ |
162 | 162 | public function getExamples() { |
163 | 163 | return array( |
164 | 164 | 'Import [[meta:Help:Parserfunctions]] to namespace 100 with full history:', |
165 | | - ' api.php?action=import&interwikisource=meta&interwikipage=Help:ParserFunctions&namespace=100&fullhistory=&token=123ABC', |
| 165 | + ' api.php?action=import&interwikisource=meta&interwikipage=Help:ParserFunctions&namespace=100&fullhistory=&token=' . EXAMPLE_TOKEN, |
166 | 166 | ); |
167 | 167 | } |
168 | 168 | |
Index: branches/petrb/phase3/includes/api/ApiPatrol.php |
— | — | @@ -106,7 +106,7 @@ |
107 | 107 | |
108 | 108 | public function getExamples() { |
109 | 109 | return array( |
110 | | - 'api.php?action=patrol&token=123abc&rcid=230672766' |
| 110 | + 'api.php?action=patrol&token=' . EXAMPLE_TOKEN . '&rcid=230672766' |
111 | 111 | ); |
112 | 112 | } |
113 | 113 | |
Index: branches/petrb/phase3/includes/api/ApiUndelete.php |
— | — | @@ -154,8 +154,8 @@ |
155 | 155 | |
156 | 156 | public function getExamples() { |
157 | 157 | return array( |
158 | | - 'api.php?action=undelete&title=Main%20Page&token=123ABC&reason=Restoring%20main%20page', |
159 | | - 'api.php?action=undelete&title=Main%20Page&token=123ABC×tamps=20070703220045|20070702194856' |
| 158 | + 'api.php?action=undelete&title=Main%20Page&token=' . EXAMPLE_TOKEN . '&reason=Restoring%20main%20page', |
| 159 | + 'api.php?action=undelete&title=Main%20Page&token=token=' . EXAMPLE_TOKEN . '×tamps=20070703220045|20070702194856' |
160 | 160 | ); |
161 | 161 | } |
162 | 162 | |