Index: trunk/phase3/maintenance/importImages.inc |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | /** |
56 | 56 | * Split a filename into filename and extension |
57 | 57 | * |
58 | | - * @param $filename Filename |
| 58 | + * @param $filename string Filename |
59 | 59 | * @return array |
60 | 60 | */ |
61 | 61 | function splitFilename( $filename ) { |
Index: trunk/phase3/includes/ProxyTools.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | $apacheHeaders = function_exists( 'apache_request_headers' ) ? apache_request_headers() : null; |
17 | 17 | if( is_array( $apacheHeaders ) ) { |
18 | 18 | // More reliable than $_SERVER due to case and -/_ folding |
19 | | - $set = array (); |
| 19 | + $set = array(); |
20 | 20 | foreach ( $apacheHeaders as $tempName => $tempValue ) { |
21 | 21 | $set[ strtoupper( $tempName ) ] = $tempValue; |
22 | 22 | } |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | function wfGetAgent() { |
48 | 48 | if( function_exists( 'apache_request_headers' ) ) { |
49 | 49 | // More reliable than $_SERVER due to case and -/_ folding |
50 | | - $set = array (); |
| 50 | + $set = array(); |
51 | 51 | foreach ( apache_request_headers() as $tempName => $tempValue ) { |
52 | 52 | $set[ strtoupper( $tempName ) ] = $tempValue; |
53 | 53 | } |
— | — | @@ -134,13 +134,8 @@ |
135 | 135 | function wfIsTrustedProxy( $ip ) { |
136 | 136 | global $wgSquidServers, $wgSquidServersNoPurge; |
137 | 137 | |
138 | | - if ( in_array( $ip, $wgSquidServers ) || |
139 | | - in_array( $ip, $wgSquidServersNoPurge ) |
140 | | - ) { |
141 | | - $trusted = true; |
142 | | - } else { |
143 | | - $trusted = false; |
144 | | - } |
| 138 | + $trusted = in_array( $ip, $wgSquidServers ) || |
| 139 | + in_array( $ip, $wgSquidServersNoPurge ); |
145 | 140 | wfRunHooks( 'IsTrustedProxy', array( &$ip, &$trusted ) ); |
146 | 141 | return $trusted; |
147 | 142 | } |
Index: trunk/phase3/includes/TitleArray.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | * @param $res result A MySQL result including at least page_namespace and |
16 | 16 | * page_title -- also can have page_id, page_len, page_is_redirect, |
17 | 17 | * page_latest (if those will be used). See Title::newFromRow. |
18 | | - * @return TitleArray |
| 18 | + * @return TitleArrayFromResult |
19 | 19 | */ |
20 | 20 | static function newFromResult( $res ) { |
21 | 21 | $array = null; |
— | — | @@ -27,6 +27,10 @@ |
28 | 28 | return $array; |
29 | 29 | } |
30 | 30 | |
| 31 | + /** |
| 32 | + * @param $res |
| 33 | + * @return TitleArrayFromResult |
| 34 | + */ |
31 | 35 | protected static function newFromResult_internal( $res ) { |
32 | 36 | $array = new TitleArrayFromResult( $res ); |
33 | 37 | return $array; |
Index: trunk/phase3/includes/BacklinkCache.php |
— | — | @@ -114,7 +114,7 @@ |
115 | 115 | * @param $table String |
116 | 116 | * @param $startId Integer or false |
117 | 117 | * @param $endId Integer or false |
118 | | - * @return TitleArray |
| 118 | + * @return TitleArrayFromResult |
119 | 119 | */ |
120 | 120 | public function getLinks( $table, $startId = false, $endId = false ) { |
121 | 121 | wfProfileIn( __METHOD__ ); |
— | — | @@ -272,7 +272,6 @@ |
273 | 273 | $this->partitionCache[$table][$batchSize] = false; |
274 | 274 | $cacheEntry =& $this->partitionCache[$table][$batchSize]; |
275 | 275 | |
276 | | - |
277 | 276 | // 2) try full result cache |
278 | 277 | |
279 | 278 | if ( isset( $this->fullResultCache[$table] ) ) { |
— | — | @@ -282,7 +281,6 @@ |
283 | 282 | return $cacheEntry['batches']; |
284 | 283 | } |
285 | 284 | |
286 | | - |
287 | 285 | // 3) ... fallback to memcached ... |
288 | 286 | |
289 | 287 | global $wgMemc; |
— | — | @@ -317,7 +315,7 @@ |
318 | 316 | |
319 | 317 | /** |
320 | 318 | * Partition a DB result with backlinks in it into batches |
321 | | - * @param $res database result |
| 319 | + * @param $res ResultWrapper database result |
322 | 320 | * @param $batchSize integer |
323 | 321 | * @return array @see |
324 | 322 | */ |
Index: trunk/phase3/includes/HTMLFileCache.php |
— | — | @@ -69,7 +69,9 @@ |
70 | 70 | } |
71 | 71 | |
72 | 72 | public function isFileCached() { |
73 | | - if( $this->mType === false ) return false; |
| 73 | + if( $this->mType === false ) { |
| 74 | + return false; |
| 75 | + } |
74 | 76 | return file_exists( $this->fileCacheName() ); |
75 | 77 | } |
76 | 78 | |
— | — | @@ -83,20 +85,28 @@ |
84 | 86 | */ |
85 | 87 | public static function useFileCache() { |
86 | 88 | global $wgUser, $wgUseFileCache, $wgShowIPinHeader, $wgRequest, $wgLang, $wgContLang; |
87 | | - if( !$wgUseFileCache ) return false; |
| 89 | + if( !$wgUseFileCache ) { |
| 90 | + return false; |
| 91 | + } |
88 | 92 | // Get all query values |
89 | 93 | $queryVals = $wgRequest->getValues(); |
90 | 94 | foreach( $queryVals as $query => $val ) { |
91 | | - if( $query == 'title' || $query == 'curid' ) continue; |
| 95 | + if( $query == 'title' || $query == 'curid' ) { |
| 96 | + continue; |
| 97 | + } |
92 | 98 | // Normal page view in query form can have action=view. |
93 | 99 | // Raw hits for pages also stored, like .css pages for example. |
94 | | - else if( $query == 'action' && ($val == 'view' || $val == 'raw') ) continue; |
95 | | - else if( $query == 'usemsgcache' && $val == 'yes' ) continue; |
| 100 | + else if( $query == 'action' && ($val == 'view' || $val == 'raw') ) { |
| 101 | + continue; |
| 102 | + } else if( $query == 'usemsgcache' && $val == 'yes' ) { |
| 103 | + continue; |
| 104 | + } |
96 | 105 | // Below are header setting params |
97 | | - else if( $query == 'maxage' || $query == 'smaxage' || $query == 'ctype' || $query == 'gen' ) |
| 106 | + else if( $query == 'maxage' || $query == 'smaxage' || $query == 'ctype' || $query == 'gen' ) { |
98 | 107 | continue; |
99 | | - else |
| 108 | + } else { |
100 | 109 | return false; |
| 110 | + } |
101 | 111 | } |
102 | 112 | // Check for non-standard user language; this covers uselang, |
103 | 113 | // and extensions for auto-detecting user language. |
— | — | @@ -113,7 +123,9 @@ |
114 | 124 | public function isFileCacheGood( $timestamp = '' ) { |
115 | 125 | global $wgCacheEpoch; |
116 | 126 | |
117 | | - if( !$this->isFileCached() ) return false; |
| 127 | + if( !$this->isFileCached() ) { |
| 128 | + return false; |
| 129 | + } |
118 | 130 | |
119 | 131 | $cachetime = $this->fileCacheTime(); |
120 | 132 | $good = $timestamp <= $cachetime && $wgCacheEpoch <= $cachetime; |
Index: trunk/phase3/includes/GenderCache.php |
— | — | @@ -91,7 +91,9 @@ |
92 | 92 | * @param $caller String: the calling method |
93 | 93 | */ |
94 | 94 | public function doQuery( $users, $caller = '' ) { |
95 | | - if ( count( $users ) === 0 ) return false; |
| 95 | + if ( count( $users ) === 0 ) { |
| 96 | + return false; |
| 97 | + } |
96 | 98 | |
97 | 99 | foreach ( (array) $users as $index => $value ) { |
98 | 100 | $users[$index] = strtr( $value, '_', ' ' ); |