Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -283,7 +283,7 @@ |
284 | 284 | canonical language variant. |
285 | 285 | * Fixed "link" parameter in image links with "thumb" parameter. |
286 | 286 | * (bug 23936) Add "displaytitle" to query/info API |
287 | | -* (bug 24485) Make iwbacklinks a generator, display iwprefix and iwtitle optional |
| 287 | +* (bug 24485) Make iwbacklinks a generator, optionally display iwprefix and iwtitle |
288 | 288 | |
289 | 289 | === Languages updated in 1.17 === |
290 | 290 | |
Index: trunk/phase3/includes/api/ApiFormatBase.php |
— | — | @@ -120,7 +120,7 @@ |
121 | 121 | public function disable() { |
122 | 122 | $this->mDisabled = true; |
123 | 123 | } |
124 | | - |
| 124 | + |
125 | 125 | public function isDisabled() { |
126 | 126 | return $this->mDisabled; |
127 | 127 | } |
Index: trunk/phase3/includes/api/ApiPageSet.php |
— | — | @@ -80,7 +80,7 @@ |
81 | 81 | if ( $resolveRedirects ) { |
82 | 82 | $this->mPendingRedirectIDs = array(); |
83 | 83 | } |
84 | | - |
| 84 | + |
85 | 85 | $this->mConvertTitles = $convertTitles; |
86 | 86 | $this->mConvertedTitles = array(); |
87 | 87 | |
— | — | @@ -225,12 +225,12 @@ |
226 | 226 | public function getNormalizedTitles() { |
227 | 227 | return $this->mNormalizedTitles; |
228 | 228 | } |
229 | | - |
| 229 | + |
230 | 230 | /** |
231 | 231 | * Get a list of title conversions - maps a title to its converted |
232 | 232 | * version. |
233 | 233 | * @return array raw_prefixed_title (string) => prefixed_title (string) |
234 | | - */ |
| 234 | + */ |
235 | 235 | public function getConvertedTitles() { |
236 | 236 | return $this->mConvertedTitles; |
237 | 237 | } |
— | — | @@ -259,7 +259,7 @@ |
260 | 260 | public function getMissingRevisionIDs() { |
261 | 261 | return $this->mMissingRevIDs; |
262 | 262 | } |
263 | | - |
| 263 | + |
264 | 264 | /** |
265 | 265 | * Get the list of titles with negative namespace |
266 | 266 | * @return array Title |
— | — | @@ -667,7 +667,7 @@ |
668 | 668 | continue; // There's nothing else we can do |
669 | 669 | } |
670 | 670 | $unconvertedTitle = $titleObj->getPrefixedText(); |
671 | | - $titleWasConverted = false; |
| 671 | + $titleWasConverted = false; |
672 | 672 | $iw = $titleObj->getInterwiki(); |
673 | 673 | if ( strval( $iw ) !== '' ) { |
674 | 674 | // This title is an interwiki link. |
— | — | @@ -683,8 +683,8 @@ |
684 | 684 | $wgContLang->findVariantLink( $title, $titleObj ); |
685 | 685 | $titleWasConverted = $unconvertedTitle !== $titleObj->getPrefixedText(); |
686 | 686 | } |
687 | | - |
688 | | - |
| 687 | + |
| 688 | + |
689 | 689 | if ( $titleObj->getNamespace() < 0 ) { |
690 | 690 | // Handle Special and Media pages |
691 | 691 | $titleObj = $titleObj->fixSpecialName(); |
Index: trunk/phase3/includes/api/ApiQueryLogEvents.php |
— | — | @@ -204,7 +204,7 @@ |
205 | 205 | case 'block': |
206 | 206 | $vals2 = array(); |
207 | 207 | list( $vals2['duration'], $vals2['flags'] ) = $params; |
208 | | - |
| 208 | + |
209 | 209 | // Indefinite blocks have no expiry time |
210 | 210 | if ( Block::parseExpiryInput( $params[0] ) !== Block::infinity() ) { |
211 | 211 | $vals2['expiry'] = wfTimestamp( TS_ISO_8601, |
— | — | @@ -240,7 +240,7 @@ |
241 | 241 | ApiQueryBase::addTitleInfo( $vals, $title ); |
242 | 242 | } |
243 | 243 | } |
244 | | - |
| 244 | + |
245 | 245 | if ( $this->fld_type || $this->fld_action ) { |
246 | 246 | $vals['type'] = $row->log_type; |
247 | 247 | $vals['action'] = $row->log_action; |
Index: trunk/phase3/includes/api/ApiQueryBase.php |
— | — | @@ -47,10 +47,10 @@ |
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | | - * Get the cache mode for the data generated by this module. Override this |
| 51 | + * Get the cache mode for the data generated by this module. Override this |
52 | 52 | * in the module subclass. |
53 | 53 | * |
54 | | - * Public caching will only be allowed if *all* the modules that supply |
| 54 | + * Public caching will only be allowed if *all* the modules that supply |
55 | 55 | * data for a given request return a cache mode of public. |
56 | 56 | */ |
57 | 57 | public function getCacheMode( $params ) { |
Index: trunk/phase3/includes/api/ApiQueryCategories.php |
— | — | @@ -228,7 +228,7 @@ |
229 | 229 | public function getDescription() { |
230 | 230 | return 'List all categories the page(s) belong to'; |
231 | 231 | } |
232 | | - |
| 232 | + |
233 | 233 | public function getPossibleErrors() { |
234 | 234 | return array_merge( parent::getPossibleErrors(), array( |
235 | 235 | array( 'show' ), |
Index: trunk/phase3/includes/api/ApiQueryImageInfo.php |
— | — | @@ -222,7 +222,7 @@ |
223 | 223 | $vals['thumbwidth'] = intval( $file->getWidth() ); |
224 | 224 | $vals['thumbheight'] = intval( $file->getHeight() ); |
225 | 225 | } |
226 | | - |
| 226 | + |
227 | 227 | if ( isset( $prop['thumbmime'] ) ) { |
228 | 228 | $thumbFile = UnregisteredLocalFile::newFromPath( $mto->getPath(), false ); |
229 | 229 | $vals['thumbmime'] = $thumbFile->getMimeType(); |
Index: trunk/phase3/includes/api/ApiQueryWatchlist.php |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | $this->selectNamedDB( 'watchlist', DB_SLAVE, 'watchlist' ); |
58 | 58 | |
59 | 59 | $params = $this->extractRequestParams(); |
60 | | - |
| 60 | + |
61 | 61 | $user = $this->getWatchlistUser( $params ); |
62 | 62 | |
63 | 63 | if ( !is_null( $params['prop'] ) && is_null( $resultPageSet ) ) { |
Index: trunk/phase3/includes/api/ApiRollback.php |
— | — | @@ -136,7 +136,7 @@ |
137 | 137 | if ( !isset( $params['user'] ) ) { |
138 | 138 | $this->dieUsageMsg( array( 'missingparam', 'user' ) ); |
139 | 139 | } |
140 | | - |
| 140 | + |
141 | 141 | // We need to be able to revert IPs, but getCanonicalName rejects them |
142 | 142 | $this->mUser = User::isIP( $params['user'] ) |
143 | 143 | ? $params['user'] |
— | — | @@ -166,7 +166,7 @@ |
167 | 167 | if ( !$this->mTitleObj->exists() ) { |
168 | 168 | $this->dieUsageMsg( array( 'notanarticle' ) ); |
169 | 169 | } |
170 | | - |
| 170 | + |
171 | 171 | return $this->mTitleObj; |
172 | 172 | } |
173 | 173 | |
Index: trunk/phase3/includes/api/ApiQueryWatchlistRaw.php |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | |
52 | 52 | private function run( $resultPageSet = null ) { |
53 | 53 | $this->selectNamedDB( 'watchlist', DB_SLAVE, 'watchlist' ); |
54 | | - |
| 54 | + |
55 | 55 | $params = $this->extractRequestParams(); |
56 | 56 | |
57 | 57 | $user = $this->getWatchlistUser( $params ); |
Index: trunk/phase3/includes/api/ApiQuery.php |
— | — | @@ -174,7 +174,7 @@ |
175 | 175 | function getModules() { |
176 | 176 | return array_merge( $this->mQueryPropModules, $this->mQueryListModules, $this->mQueryMetaModules ); |
177 | 177 | } |
178 | | - |
| 178 | + |
179 | 179 | /** |
180 | 180 | * Get whether the specified module is a prop, list or a meta query module |
181 | 181 | * @param $moduleName string Name of the module to find type for |
— | — | @@ -184,15 +184,15 @@ |
185 | 185 | if ( array_key_exists ( $moduleName, $this->mQueryPropModules ) ) { |
186 | 186 | return 'prop'; |
187 | 187 | } |
188 | | - |
| 188 | + |
189 | 189 | if ( array_key_exists ( $moduleName, $this->mQueryListModules ) ) { |
190 | 190 | return 'list'; |
191 | 191 | } |
192 | | - |
| 192 | + |
193 | 193 | if ( array_key_exists ( $moduleName, $this->mQueryMetaModules ) ) { |
194 | 194 | return 'meta'; |
195 | 195 | } |
196 | | - |
| 196 | + |
197 | 197 | return null; |
198 | 198 | } |
199 | 199 | |
— | — | @@ -238,7 +238,7 @@ |
239 | 239 | if ( isset( $this->params['generator'] ) ) { |
240 | 240 | $generator = $this->newGenerator( $this->params['generator'] ); |
241 | 241 | $params = $generator->extractRequestParams(); |
242 | | - $cacheMode = $this->mergeCacheMode( $cacheMode, |
| 242 | + $cacheMode = $this->mergeCacheMode( $cacheMode, |
243 | 243 | $generator->getCacheMode( $params ) ); |
244 | 244 | $this->executeGeneratorModule( $generator, $modules ); |
245 | 245 | } else { |
— | — | @@ -253,7 +253,7 @@ |
254 | 254 | // Execute all requested modules. |
255 | 255 | foreach ( $modules as $module ) { |
256 | 256 | $params = $module->extractRequestParams(); |
257 | | - $cacheMode = $this->mergeCacheMode( |
| 257 | + $cacheMode = $this->mergeCacheMode( |
258 | 258 | $cacheMode, $module->getCacheMode( $params ) ); |
259 | 259 | $module->profileIn(); |
260 | 260 | $module->execute(); |
— | — | @@ -267,7 +267,7 @@ |
268 | 268 | |
269 | 269 | /** |
270 | 270 | * Update a cache mode string, applying the cache mode of a new module to it. |
271 | | - * The cache mode may increase in the level of privacy, but public modules |
| 271 | + * The cache mode may increase in the level of privacy, but public modules |
272 | 272 | * added to private data do not decrease the level of privacy. |
273 | 273 | */ |
274 | 274 | protected function mergeCacheMode( $cacheMode, $modCacheMode ) { |
— | — | @@ -338,7 +338,7 @@ |
339 | 339 | $result->setIndexedTagName( $normValues, 'n' ); |
340 | 340 | $result->addValue( 'query', 'normalized', $normValues ); |
341 | 341 | } |
342 | | - |
| 342 | + |
343 | 343 | // Title conversions |
344 | 344 | $convValues = array(); |
345 | 345 | foreach ( $pageSet->getConvertedTitles() as $rawTitleStr => $titleStr ) { |
— | — | @@ -351,7 +351,7 @@ |
352 | 352 | if ( count( $convValues ) ) { |
353 | 353 | $result->setIndexedTagName( $convValues, 'c' ); |
354 | 354 | $result->addValue( 'query', 'converted', $convValues ); |
355 | | - } |
| 355 | + } |
356 | 356 | |
357 | 357 | // Interwiki titles |
358 | 358 | $intrwValues = array(); |
— | — | @@ -424,9 +424,9 @@ |
425 | 425 | $vals = array(); |
426 | 426 | ApiQueryBase::addTitleInfo( $vals, $title ); |
427 | 427 | $vals['special'] = ''; |
428 | | - if ( $title->getNamespace() == NS_SPECIAL && |
| 428 | + if ( $title->getNamespace() == NS_SPECIAL && |
429 | 429 | !SpecialPage::exists( $title->getText() ) ) { |
430 | | - $vals['missing'] = ''; |
| 430 | + $vals['missing'] = ''; |
431 | 431 | } elseif ( $title->getNamespace() == NS_MEDIA && |
432 | 432 | !wfFindFile( $title ) ) { |
433 | 433 | $vals['missing'] = ''; |
Index: trunk/phase3/includes/api/ApiQueryRevisions.php |
— | — | @@ -387,7 +387,7 @@ |
388 | 388 | $vals['commenthidden'] = ''; |
389 | 389 | } else { |
390 | 390 | $comment = $revision->getComment(); |
391 | | - |
| 391 | + |
392 | 392 | if ( $this->fld_comment ) { |
393 | 393 | $vals['comment'] = $comment; |
394 | 394 | } |
— | — | @@ -490,7 +490,7 @@ |
491 | 491 | if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) { |
492 | 492 | // formatComment() calls wfMsg() among other things |
493 | 493 | return 'anon-public-user-private'; |
494 | | - } |
| 494 | + } |
495 | 495 | return 'public'; |
496 | 496 | } |
497 | 497 | |
Index: trunk/phase3/includes/api/ApiQueryFilearchive.php |
— | — | @@ -47,11 +47,11 @@ |
48 | 48 | if ( !$wgUser->isAllowed( 'deletedhistory' ) ) { |
49 | 49 | $this->dieUsage( 'You don\'t have permission to view deleted file information', 'permissiondenied' ); |
50 | 50 | } |
51 | | - |
| 51 | + |
52 | 52 | $db = $this->getDB(); |
53 | 53 | |
54 | 54 | $params = $this->extractRequestParams(); |
55 | | - |
| 55 | + |
56 | 56 | $prop = array_flip( $params['prop'] ); |
57 | 57 | $fld_sha1 = isset( $prop['sha1'] ); |
58 | 58 | $fld_timestamp = isset( $prop['timestamp'] ); |
— | — | @@ -62,9 +62,9 @@ |
63 | 63 | $fld_mime = isset( $prop['mime'] ); |
64 | 64 | $fld_metadata = isset( $prop['metadata'] ); |
65 | 65 | $fld_bitdepth = isset( $prop['bitdepth'] ); |
66 | | - |
| 66 | + |
67 | 67 | $this->addTables( 'filearchive' ); |
68 | | - |
| 68 | + |
69 | 69 | $this->addFields( 'fa_name' ); |
70 | 70 | $this->addFieldsIf( 'fa_storage_key', $fld_sha1 ); |
71 | 71 | $this->addFieldsIf( 'fa_timestamp', $fld_timestamp ); |
— | — | @@ -125,7 +125,7 @@ |
126 | 126 | $this->setContinueEnumParameter( 'from', $this->keyToTitle( $row->fa_name ) ); |
127 | 127 | break; |
128 | 128 | } |
129 | | - |
| 129 | + |
130 | 130 | $file = array(); |
131 | 131 | $file['name'] = $row->fa_name; |
132 | 132 | |
— | — | @@ -157,7 +157,7 @@ |
158 | 158 | if ( $fld_mime ) { |
159 | 159 | $file['mime'] = "$row->fa_major_mime/$row->fa_minor_mime"; |
160 | 160 | } |
161 | | - |
| 161 | + |
162 | 162 | $fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $file ); |
163 | 163 | if ( !$fit ) { |
164 | 164 | $this->setContinueEnumParameter( 'from', $this->keyToTitle( $row->fa_name ) ); |
Index: trunk/phase3/includes/api/ApiLogin.php |
— | — | @@ -87,7 +87,7 @@ |
88 | 88 | $result['cookieprefix'] = $wgCookiePrefix; |
89 | 89 | $result['sessionid'] = session_id(); |
90 | 90 | break; |
91 | | - |
| 91 | + |
92 | 92 | case LoginForm::NEED_TOKEN: |
93 | 93 | global $wgCookiePrefix; |
94 | 94 | $result['result'] = 'NeedToken'; |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | $result['cookieprefix'] = $wgCookiePrefix; |
97 | 97 | $result['sessionid'] = session_id(); |
98 | 98 | break; |
99 | | - |
| 99 | + |
100 | 100 | case LoginForm::WRONG_TOKEN: |
101 | 101 | $result['result'] = 'WrongToken'; |
102 | 102 | break; |
Index: trunk/phase3/includes/api/ApiQueryUserInfo.php |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | |
79 | 79 | if ( isset( $this->prop['groups'] ) ) { |
80 | 80 | $autolist = ApiQueryUsers::getAutoGroups( $wgUser ); |
81 | | - |
| 81 | + |
82 | 82 | $vals['groups'] = array_merge( $autolist, $wgUser->getGroups() ); |
83 | 83 | $result->setIndexedTagName( $vals['groups'], 'g' ); // even if empty |
84 | 84 | } |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | $vals['emailauthenticated'] = wfTimestamp( TS_ISO_8601, $auth ); |
125 | 125 | } |
126 | 126 | } |
127 | | - |
| 127 | + |
128 | 128 | if ( isset( $this->prop['acceptlang'] ) ) { |
129 | 129 | $langs = $wgRequest->getAcceptLang(); |
130 | 130 | $acceptLang = array(); |
Index: trunk/phase3/includes/api/ApiEditPage.php |
— | — | @@ -319,17 +319,17 @@ |
320 | 320 | $newArticle->getTimestamp() ); |
321 | 321 | } |
322 | 322 | break; |
323 | | - |
| 323 | + |
324 | 324 | case EditPage::AS_SUMMARY_NEEDED: |
325 | 325 | $this->dieUsageMsg( array( 'summaryrequired' ) ); |
326 | 326 | |
327 | 327 | case EditPage::AS_END: |
328 | 328 | // This usually means some kind of race condition |
329 | | - // or DB weirdness occurred. |
| 329 | + // or DB weirdness occurred. |
330 | 330 | if ( is_array( $result ) && count( $result ) > 0 ) { |
331 | 331 | $this->dieUsageMsg( array( 'unknownerror', $result[0][0] ) ); |
332 | 332 | } |
333 | | - |
| 333 | + |
334 | 334 | // Unknown error, but no specific error message |
335 | 335 | // Fall through |
336 | 336 | default: |
Index: trunk/phase3/includes/api/ApiUpload.php |
— | — | @@ -268,8 +268,8 @@ |
269 | 269 | |
270 | 270 | $warnings = $this->checkForWarnings(); |
271 | 271 | if ( isset( $warnings ) ) { |
272 | | - return $warnings; |
273 | | - } |
| 272 | + return $warnings; |
| 273 | + } |
274 | 274 | |
275 | 275 | // Use comment as initial page text by default |
276 | 276 | if ( is_null( $this->mParams['text'] ) ) { |
Index: trunk/phase3/includes/api/ApiQueryAllmessages.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | $params = $this->extractRequestParams(); |
45 | 45 | |
46 | 46 | global $wgLang; |
47 | | - |
| 47 | + |
48 | 48 | $oldLang = null; |
49 | 49 | if ( !is_null( $params['lang'] ) ) { |
50 | 50 | $oldLang = $wgLang; // Keep $wgLang for restore later |
— | — | @@ -122,7 +122,7 @@ |
123 | 123 | } |
124 | 124 | } |
125 | 125 | $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'message' ); |
126 | | - |
| 126 | + |
127 | 127 | if ( !is_null( $oldLang ) ) { |
128 | 128 | $wgLang = $oldLang; // Restore $oldLang |
129 | 129 | } |
Index: trunk/phase3/includes/api/ApiQueryUsers.php |
— | — | @@ -200,9 +200,9 @@ |
201 | 201 | } else { |
202 | 202 | if ( isset( $this->prop['groups'] ) && isset( $data[$u]['groups'] ) ) { |
203 | 203 | $autolist = ApiQueryUsers::getAutoGroups( User::newFromName( $u ) ); |
204 | | - |
| 204 | + |
205 | 205 | $data[$u]['groups'] = array_merge( $autolist, $data[$u]['groups'] ); |
206 | | - |
| 206 | + |
207 | 207 | $this->getResult()->setIndexedTagName( $data[$u]['groups'], 'g' ); |
208 | 208 | } |
209 | 209 | } |
— | — | @@ -217,7 +217,7 @@ |
218 | 218 | } |
219 | 219 | return $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'user' ); |
220 | 220 | } |
221 | | - |
| 221 | + |
222 | 222 | /** |
223 | 223 | * Gets all the groups that a user is automatically a member of |
224 | 224 | * @return array |
Index: trunk/phase3/includes/api/ApiQueryUserContributions.php |
— | — | @@ -217,7 +217,7 @@ |
218 | 218 | if ( !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() ) { |
219 | 219 | $this->dieUsage( 'You need the patrol right to request the patrolled flag', 'permissiondenied' ); |
220 | 220 | } |
221 | | - |
| 221 | + |
222 | 222 | // Use a redundant join condition on both |
223 | 223 | // timestamp and ID so we can use the timestamp |
224 | 224 | // index |
Index: trunk/phase3/includes/api/ApiBlock.php |
— | — | @@ -170,7 +170,7 @@ |
171 | 171 | public function getDescription() { |
172 | 172 | return 'Block a user'; |
173 | 173 | } |
174 | | - |
| 174 | + |
175 | 175 | public function getPossibleErrors() { |
176 | 176 | return array_merge( parent::getPossibleErrors(), array( |
177 | 177 | array( 'missingparam', 'user' ), |
— | — | @@ -181,7 +181,7 @@ |
182 | 182 | array( 'ipbnounblockself' ), |
183 | 183 | ) ); |
184 | 184 | } |
185 | | - |
| 185 | + |
186 | 186 | public function getTokenSalt() { |
187 | 187 | return ''; |
188 | 188 | } |
Index: trunk/phase3/includes/api/ApiQueryBlocks.php |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | 'ipb_auto' => 0 |
126 | 126 | ) ); |
127 | 127 | } |
128 | | - |
| 128 | + |
129 | 129 | if ( !$wgUser->isAllowed( 'hideuser' ) ) { |
130 | 130 | $this->addWhereFld( 'ipb_deleted', 0 ); |
131 | 131 | } |
Index: trunk/phase3/includes/api/ApiQueryLinks.php |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | $this->addTables( $this->table ); |
91 | 91 | $this->addWhereFld( $this->prefix . '_from', array_keys( $this->getPageSet()->getGoodTitles() ) ); |
92 | 92 | $this->addWhereFld( $this->prefix . '_namespace', $params['namespace'] ); |
93 | | - |
| 93 | + |
94 | 94 | if ( !is_null( $params[$this->titlesParam] ) ) { |
95 | 95 | $lb = new LinkBatch; |
96 | 96 | foreach ( $params[$this->titlesParam] as $t ) { |
Index: trunk/phase3/includes/api/ApiQueryInfo.php |
— | — | @@ -260,7 +260,7 @@ |
261 | 261 | if ( $this->fld_talkid || $this->fld_subjectid ) { |
262 | 262 | $this->getTSIDs(); |
263 | 263 | } |
264 | | - |
| 264 | + |
265 | 265 | if ( $this->fld_displaytitle ) { |
266 | 266 | $this->getDisplayTitle(); |
267 | 267 | } |
— | — | @@ -354,7 +354,7 @@ |
355 | 355 | $pageInfo['preload'] = $text; |
356 | 356 | } |
357 | 357 | } |
358 | | - |
| 358 | + |
359 | 359 | if ( $this->fld_displaytitle ) { |
360 | 360 | if ( isset( $this->displaytitles[$title->getArticleId()] ) ) { |
361 | 361 | $pageInfo['displaytitle'] = $this->displaytitles[$title->getArticleId()]; |
— | — | @@ -528,7 +528,7 @@ |
529 | 529 | if ( !count( $getTitles ) ) { |
530 | 530 | return; |
531 | 531 | } |
532 | | - |
| 532 | + |
533 | 533 | $db = $this->getDB(); |
534 | 534 | |
535 | 535 | // Construct a custom WHERE clause that matches |
— | — | @@ -549,12 +549,12 @@ |
550 | 550 | } |
551 | 551 | } |
552 | 552 | } |
553 | | - |
| 553 | + |
554 | 554 | private function getDisplayTitle() { |
555 | 555 | $this->displaytitles = array(); |
556 | | - |
| 556 | + |
557 | 557 | $pageIds = array_keys( $this->titles ); |
558 | | - |
| 558 | + |
559 | 559 | if ( !count( $pageIds ) ) { |
560 | 560 | return; |
561 | 561 | } |
— | — | @@ -565,7 +565,7 @@ |
566 | 566 | $this->addWhereFld( 'pp_page', $pageIds ); |
567 | 567 | $this->addWhereFld( 'pp_propname', 'displaytitle' ); |
568 | 568 | $res = $this->select( __METHOD__ ); |
569 | | - |
| 569 | + |
570 | 570 | foreach ( $res as $row ) { |
571 | 571 | $this->displaytitles[$row->pp_page] = $row->pp_value; |
572 | 572 | } |
— | — | @@ -639,7 +639,7 @@ |
640 | 640 | 'readable', # private |
641 | 641 | 'preload', |
642 | 642 | 'displaytitle', |
643 | | - // If you add more properties here, please consider whether they |
| 643 | + // If you add more properties here, please consider whether they |
644 | 644 | // need to be added to getCacheMode() |
645 | 645 | ) ), |
646 | 646 | 'token' => array( |
Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -200,7 +200,7 @@ |
201 | 201 | public function getModule() { |
202 | 202 | return $this->mModule; |
203 | 203 | } |
204 | | - |
| 204 | + |
205 | 205 | /** |
206 | 206 | * Get the result formatter object. Only works after setupExecuteAction() |
207 | 207 | */ |
— | — | @@ -222,30 +222,30 @@ |
223 | 223 | * Set the type of caching headers which will be sent. |
224 | 224 | * |
225 | 225 | * @param $mode One of: |
226 | | - * - 'public': Cache this object in public caches, if the maxage or smaxage |
| 226 | + * - 'public': Cache this object in public caches, if the maxage or smaxage |
227 | 227 | * parameter is set, or if setCacheMaxAge() was called. If a maximum age is |
228 | 228 | * not provided by any of these means, the object will be private. |
229 | 229 | * - 'private': Cache this object only in private client-side caches. |
230 | 230 | * - 'anon-public-user-private': Make this object cacheable for logged-out |
231 | | - * users, but private for logged-in users. IMPORTANT: If this is set, it must be |
232 | | - * set consistently for a given URL, it cannot be set differently depending on |
| 231 | + * users, but private for logged-in users. IMPORTANT: If this is set, it must be |
| 232 | + * set consistently for a given URL, it cannot be set differently depending on |
233 | 233 | * things like the contents of the database, or whether the user is logged in. |
234 | 234 | * |
235 | 235 | * If the wiki does not allow anonymous users to read it, the mode set here |
236 | | - * will be ignored, and private caching headers will always be sent. In other words, |
| 236 | + * will be ignored, and private caching headers will always be sent. In other words, |
237 | 237 | * the "public" mode is equivalent to saying that the data sent is as public as a page |
238 | 238 | * view. |
239 | 239 | * |
240 | | - * For user-dependent data, the private mode should generally be used. The |
241 | | - * anon-public-user-private mode should only be used where there is a particularly |
| 240 | + * For user-dependent data, the private mode should generally be used. The |
| 241 | + * anon-public-user-private mode should only be used where there is a particularly |
242 | 242 | * good performance reason for caching the anonymous response, but where the |
243 | | - * response to logged-in users may differ, or may contain private data. |
| 243 | + * response to logged-in users may differ, or may contain private data. |
244 | 244 | * |
245 | 245 | * If this function is never called, then the default will be the private mode. |
246 | 246 | */ |
247 | 247 | public function setCacheMode( $mode ) { |
248 | 248 | if ( !in_array( $mode, array( 'private', 'public', 'anon-public-user-private' ) ) ) { |
249 | | - wfDebug( __METHOD__.": unrecognised cache mode \"$mode\"\n" ); |
| 249 | + wfDebug( __METHOD__ . ": unrecognised cache mode \"$mode\"\n" ); |
250 | 250 | // Ignore for forwards-compatibility |
251 | 251 | return; |
252 | 252 | } |
— | — | @@ -253,18 +253,18 @@ |
254 | 254 | if ( !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) ) { |
255 | 255 | // Private wiki, only private headers |
256 | 256 | if ( $mode !== 'private' ) { |
257 | | - wfDebug( __METHOD__.": ignoring request for $mode cache mode, private wiki\n" ); |
| 257 | + wfDebug( __METHOD__ . ": ignoring request for $mode cache mode, private wiki\n" ); |
258 | 258 | return; |
259 | 259 | } |
260 | 260 | } |
261 | 261 | |
262 | | - wfDebug( __METHOD__.": setting cache mode $mode\n" ); |
| 262 | + wfDebug( __METHOD__ . ": setting cache mode $mode\n" ); |
263 | 263 | $this->mCacheMode = $mode; |
264 | 264 | } |
265 | | - |
| 265 | + |
266 | 266 | /** |
267 | | - * @deprecated Private caching is now the default, so there is usually no |
268 | | - * need to call this function. If there is a need, you can use |
| 267 | + * @deprecated Private caching is now the default, so there is usually no |
| 268 | + * need to call this function. If there is a need, you can use |
269 | 269 | * $this->setCacheMode('private') |
270 | 270 | */ |
271 | 271 | public function setCachePrivate() { |
— | — | @@ -276,13 +276,13 @@ |
277 | 277 | * Boolean values will be formatted as such, by including or omitting |
278 | 278 | * without an equals sign. |
279 | 279 | * |
280 | | - * Cache control values set here will only be used if the cache mode is not |
| 280 | + * Cache control values set here will only be used if the cache mode is not |
281 | 281 | * private, see setCacheMode(). |
282 | 282 | */ |
283 | 283 | public function setCacheControl( $directives ) { |
284 | 284 | $this->mCacheControl = $directives + $this->mCacheControl; |
285 | 285 | } |
286 | | - |
| 286 | + |
287 | 287 | /** |
288 | 288 | * Make sure Vary: Cookie and friends are set. Use this when the output of a request |
289 | 289 | * may be cached for anons but may not be cached for logged-in users. |
— | — | @@ -364,7 +364,7 @@ |
365 | 365 | $this->printResult( true ); |
366 | 366 | } |
367 | 367 | |
368 | | - // Send cache headers after any code which might generate an error, to |
| 368 | + // Send cache headers after any code which might generate an error, to |
369 | 369 | // avoid sending public cache headers for errors. |
370 | 370 | $this->sendCacheHeaders(); |
371 | 371 | |
— | — | @@ -402,7 +402,7 @@ |
403 | 403 | // Give a debugging message if the user object is unstubbed on a public request |
404 | 404 | global $wgUser; |
405 | 405 | if ( !( $wgUser instanceof StubUser ) ) { |
406 | | - wfDebug( __METHOD__." \$wgUser is unstubbed on a public request!\n" ); |
| 406 | + wfDebug( __METHOD__ . " \$wgUser is unstubbed on a public request!\n" ); |
407 | 407 | } |
408 | 408 | } |
409 | 409 | |
— | — | @@ -519,7 +519,7 @@ |
520 | 520 | $this->getResult()->addValue( null, 'requestid', $requestid ); |
521 | 521 | } |
522 | 522 | $servedby = $this->getParameter( 'servedby' ); |
523 | | - if( $servedby ) { |
| 523 | + if ( $servedby ) { |
524 | 524 | $this->getResult()->addValue( null, 'servedby', wfHostName() ); |
525 | 525 | } |
526 | 526 | |
Index: trunk/phase3/includes/api/ApiQueryIWBacklinks.php |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | public function __construct( $query, $moduleName ) { |
40 | 40 | parent::__construct( $query, $moduleName, 'iwbl' ); |
41 | 41 | } |
42 | | - |
| 42 | + |
43 | 43 | public function execute() { |
44 | 44 | $this->run(); |
45 | 45 | } |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | |
51 | 51 | public function run( $resultPageSet = null ) { |
52 | 52 | $params = $this->extractRequestParams(); |
53 | | - |
| 53 | + |
54 | 54 | if ( isset( $params['title'] ) && !isset( $params['prefix'] ) ) { |
55 | 55 | $this->dieUsageMsg( array( 'missingparam', 'prefix' ) ); |
56 | 56 | } |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | "iwl_from >= $from)))" |
74 | 74 | ); |
75 | 75 | } |
76 | | - |
| 76 | + |
77 | 77 | $prop = array_flip( $params['prop'] ); |
78 | 78 | $iwprefix = isset( $prop['iwprefix'] ); |
79 | 79 | $iwtitle = isset( $prop['iwtitle'] ); |
— | — | @@ -98,7 +98,7 @@ |
99 | 99 | $this->addOption( 'LIMIT', $params['limit'] + 1 ); |
100 | 100 | |
101 | 101 | $res = $this->select( __METHOD__ ); |
102 | | - |
| 102 | + |
103 | 103 | $pages = array(); |
104 | 104 | |
105 | 105 | $count = 0; |
— | — | @@ -110,24 +110,24 @@ |
111 | 111 | $this->setContinueEnumParameter( 'continue', "{$row->iwl_prefix}|{$row->iwl_title}|{$row->iwl_from}" ); |
112 | 112 | break; |
113 | 113 | } |
114 | | - |
| 114 | + |
115 | 115 | if ( !is_null( $resultPageSet ) ) { |
116 | 116 | $pages[] = Title::makeTitle( $row->page_namespace, $row->page_title )->getPrefixedText(); |
117 | 117 | } else { |
118 | 118 | $entry = array(); |
119 | | - |
| 119 | + |
120 | 120 | $entry['pageid'] = intval( $row->page_id ); |
121 | 121 | $entry['ns'] = $row->page_namespace; |
122 | 122 | $entry['title'] = $row->page_title; |
123 | | - |
| 123 | + |
124 | 124 | if ( $row->page_is_redirect ) { |
125 | 125 | $entry['redirect'] = ''; |
126 | 126 | } |
127 | | - |
| 127 | + |
128 | 128 | if ( $iwprefix ) { |
129 | 129 | $entry['iwprefix'] = $row->iwl_prefix; |
130 | 130 | } |
131 | | - |
| 131 | + |
132 | 132 | if ( $iwtitle ) { |
133 | 133 | $entry['iwtitle'] = $row->iwl_title; |
134 | 134 | } |
— | — | @@ -139,7 +139,7 @@ |
140 | 140 | } |
141 | 141 | } |
142 | 142 | } |
143 | | - |
| 143 | + |
144 | 144 | if ( is_null( $resultPageSet ) ) { |
145 | 145 | $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'iw' ); |
146 | 146 | } else { |
Index: trunk/phase3/includes/api/ApiHelp.php |
— | — | @@ -45,13 +45,13 @@ |
46 | 46 | public function execute() { |
47 | 47 | // Get parameters |
48 | 48 | $params = $this->extractRequestParams(); |
49 | | - |
| 49 | + |
50 | 50 | if ( !isset( $params['modules'] ) && !isset( $params['querymodules'] ) ) { |
51 | 51 | $this->dieUsage( '', 'help' ); |
52 | 52 | } |
53 | | - |
| 53 | + |
54 | 54 | $this->getMain()->setHelp(); |
55 | | - |
| 55 | + |
56 | 56 | $result = $this->getResult(); |
57 | 57 | $queryObj = new ApiQuery( $this->getMain(), 'query' ); |
58 | 58 | $r = array(); |
— | — | @@ -79,27 +79,27 @@ |
80 | 80 | } |
81 | 81 | $module = new $qmodArr[$qm]( $this, $qm ); |
82 | 82 | $type = $queryObj->getModuleType( $qm ); |
83 | | - |
| 83 | + |
84 | 84 | if ( $type === null ) { |
85 | 85 | $r[] = array( 'name' => $qm, 'missing' => '' ); |
86 | 86 | continue; |
87 | 87 | } |
88 | | - |
| 88 | + |
89 | 89 | $r[] = $this->buildModuleHelp( $module, $type ); |
90 | 90 | } |
91 | 91 | } |
92 | 92 | $result->setIndexedTagName( $r, 'module' ); |
93 | 93 | $result->addValue( null, $this->getModuleName(), $r ); |
94 | 94 | } |
95 | | - |
| 95 | + |
96 | 96 | private function buildModuleHelp( $module, $type ) { |
97 | 97 | $msg = ApiMain::makeHelpMsgHeader( $module, $type ); |
98 | | - |
| 98 | + |
99 | 99 | $msg2 = $module->makeHelpMsg(); |
100 | 100 | if ( $msg2 !== false ) { |
101 | 101 | $msg .= $msg2; |
102 | 102 | } |
103 | | - |
| 103 | + |
104 | 104 | return $msg; |
105 | 105 | } |
106 | 106 | |
— | — | @@ -110,7 +110,7 @@ |
111 | 111 | public function isReadMode() { |
112 | 112 | return false; |
113 | 113 | } |
114 | | - |
| 114 | + |
115 | 115 | public function getAllowedParams() { |
116 | 116 | return array( |
117 | 117 | 'modules' => array( |
— | — | @@ -132,7 +132,7 @@ |
133 | 133 | public function getDescription() { |
134 | 134 | return 'Display this help screen. Or the help screen for the specified module'; |
135 | 135 | } |
136 | | - |
| 136 | + |
137 | 137 | protected function getExamples() { |
138 | 138 | return array( |
139 | 139 | 'Whole help page:', |
Index: trunk/phase3/includes/api/ApiUserrights.php |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | $this->getResult()->setIndexedTagName( $r['removed'], 'group' ); |
56 | 56 | $this->getResult()->addValue( null, $this->getModuleName(), $r ); |
57 | 57 | } |
58 | | - |
| 58 | + |
59 | 59 | private function getUser() { |
60 | 60 | if ( $this->mUser !== null ) { |
61 | 61 | return $this->mUser; |
Index: trunk/phase3/includes/api/ApiFormatYaml_spyc.php |
— | — | @@ -192,7 +192,7 @@ |
193 | 193 | } else { |
194 | 194 | if ( $key == '*' ) // bug 21922 - Quote asterix used as keys |
195 | 195 | $key = "'*'"; |
196 | | - |
| 196 | + |
197 | 197 | // It's mapped |
198 | 198 | if ( $value !== '' && !is_null( $value ) ) |
199 | 199 | $string = $spaces . $key . ': ' . $value . "\n"; |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -546,7 +546,7 @@ |
547 | 547 | * Return true if we're to watch the page, false if not, null if no change. |
548 | 548 | * @param $watchlist String Valid values: 'watch', 'unwatch', 'preferences', 'nochange' |
549 | 549 | * @param $titleObj Title the page under consideration |
550 | | - * @param $userOption The user option to consider when $watchlist=preferences. |
| 550 | + * @param $userOption The user option to consider when $watchlist=preferences. |
551 | 551 | * If not set will magically default to either watchdefault or watchcreations |
552 | 552 | * @returns mixed |
553 | 553 | */ |
— | — | @@ -724,7 +724,7 @@ |
725 | 725 | } |
726 | 726 | $value[$key] = $title->getText(); |
727 | 727 | } |
728 | | - |
| 728 | + |
729 | 729 | if ( !$multi ) { |
730 | 730 | $value = $value[0]; |
731 | 731 | } |
— | — | @@ -1090,7 +1090,7 @@ |
1091 | 1091 | |
1092 | 1092 | /** |
1093 | 1093 | * Gets the user for whom to get the watchlist |
1094 | | - * |
| 1094 | + * |
1095 | 1095 | * @returns User |
1096 | 1096 | */ |
1097 | 1097 | public function getWatchlistUser( $params ) { |
Index: trunk/phase3/includes/api/ApiParse.php |
— | — | @@ -241,7 +241,7 @@ |
242 | 242 | $result_array['headhtml'] = array(); |
243 | 243 | $result->setContent( $result_array['headhtml'], $out->headElement( $userSkin ) ); |
244 | 244 | } |
245 | | - |
| 245 | + |
246 | 246 | if ( isset( $prop['iwlinks'] ) ) { |
247 | 247 | $result_array['iwlinks'] = $this->formatIWLinks( $p_result->getInterwikiLinks() ); |
248 | 248 | } |
— | — | @@ -324,12 +324,12 @@ |
325 | 325 | foreach ( $titles as $title => $id ) { |
326 | 326 | $entry = array(); |
327 | 327 | $entry['prefix'] = $prefix; |
328 | | - |
| 328 | + |
329 | 329 | $title = Title::newFromText( "{$prefix}:{$title}" ); |
330 | 330 | if ( $title ) { |
331 | 331 | $entry['url'] = $title->getFullURL(); |
332 | 332 | } |
333 | | - |
| 333 | + |
334 | 334 | $this->getResult()->setContent( $entry, $title->getFullText() ); |
335 | 335 | $result[] = $entry; |
336 | 336 | } |