r96362 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96361‎ | r96362 | r96363 >
Date:19:28, 6 September 2011
Author:reedy
Status:ok
Tags:
Comment:
Fix trailing whitespaces
Modified paths:
  • /trunk/phase3/includes/GlobalUsageQuery.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialGlobalFileUsage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalUsageQuery.php
@@ -1,7 +1,7 @@
22 <?php
33 /**
44 * A helper class to query the globalimagelinks table
5 - *
 5+ *
66 */
77 class GlobalUsageQuery {
88 private $limit = 50;
@@ -12,7 +12,7 @@
1313 private $continue;
1414 private $reversed = false;
1515 private $target = null;
16 -
 16+
1717 /**
1818 * @param $target mixed Title or db key, or array of db keys of target(s)
1919 */
@@ -25,7 +25,6 @@
2626 $this->target = $target;
2727 }
2828 $this->offset = array();
29 -
3029 }
3130
3231 /**
@@ -38,7 +37,7 @@
3938 if ( !is_null( $reversed ) ) {
4039 $this->reversed = $reversed;
4140 }
42 -
 41+
4342 if ( !is_array( $offset ) ) {
4443 $offset = explode( '|', $offset );
4544 }
@@ -60,18 +59,18 @@
6160 }
6261 /**
6362 * Is the result reversed
64 - *
 63+ *
6564 * @return bool
6665 */
6766 public function isReversed() {
6867 return $this->reversed;
6968 }
70 -
 69+
7170 /**
7271 * Returns the string used for continuation in a file search
73 - *
 72+ *
7473 * @return string
75 - *
 74+ *
7675 */
7776 public function getContinueFileString() {
7877 if ( $this->hasMore() ) {
@@ -80,7 +79,7 @@
8180 return '';
8281 }
8382 }
84 -
 83+
8584 /**
8685 * Returns the string used for continuation in a template search
8786 *
@@ -94,7 +93,7 @@
9594 return '';
9695 }
9796 }
98 -
 97+
9998 /**
10099 * Set the maximum amount of items to return. Capped at 500.
101100 *
@@ -228,7 +227,7 @@
229228 /* Construct a where clause */
230229 // Add target image(s)
231230 $where = array( 'gil_to' => $this->target );
232 -
 231+
233232 if ( $this->filterLocal ) {
234233 // Don't show local file usage
235234 $where[] = 'gil_wiki != ' . $this->db->addQuotes( wfWikiId() );
@@ -240,7 +239,7 @@
241240 $qTo = $this->db->addQuotes( $this->offset[0] );
242241 $qWiki = $this->db->addQuotes( $this->offset[1] );
243242 $qPage = intval( $this->offset[2] );
244 -
 243+
245244 // Check which limit we got in order to determine which way to traverse rows
246245 if ( $this->reversed ) {
247246 // Reversed traversal; do not include offset row
@@ -253,7 +252,7 @@
254253 $op2 = '>=';
255254 $order = 'ASC';
256255 }
257 -
 256+
258257 $where[] = "(gil_to $op1 $qTo) OR " .
259258 "(gil_to = $qTo AND gil_wiki $op1 $qWiki) OR " .
260259 "(gil_to = $qTo AND gil_wiki = $qWiki AND gil_page $op2 $qPage)";
@@ -287,7 +286,7 @@
288287 if ( $this->reversed ) {
289288 $rows = array_reverse( $rows );
290289 }
291 -
 290+
292291 // Build the result array
293292 $count = 0;
294293 $this->hasMore = false;
@@ -321,12 +320,12 @@
322321 /**
323322 * Returns the result set. The result is a 4 dimensional array
324323 * (file, wiki, page), whose items are arrays with keys:
325 - * - image or template: File name or template name
 324+ * - image or template: File name or template name
326325 * - id: Page id
327326 * - namespace: Page namespace text
328327 * - title: Unprefixed page title
329328 * - wiki: Wiki id
330 - *
 329+ *
331330 * @return array Result set
332331 */
333332 public function getResult() {
@@ -335,9 +334,9 @@
336335 /**
337336 * Returns a 3 dimensional array with the result of the first file. Useful
338337 * if only one resource was queried.
339 - *
 338+ *
340339 * For further information see documentation of getResult()
341 - *
 340+ *
342341 * @return array Result set
343342 */
344343 public function getSingleResult() {
@@ -359,7 +358,7 @@
360359
361360 /**
362361 * Returns the result length
363 - *
 362+ *
364363 * @return int
365364 */
366365 public function count() {
Index: trunk/phase3/includes/specials/SpecialGlobalFileUsage.php
@@ -24,7 +24,7 @@
2525
2626 $this->showForm();
2727
28 - if ( is_null( $this->target ) ) {
 28+ if ( is_null( $this->target ) ) {
2929 $wgOut->setPageTitle( wfMsg( 'globalfileusage' ) );
3030 return;
3131 }
@@ -129,6 +129,7 @@
130130 // Bottom navbar
131131 $wgOut->addHtml( $navbar );
132132 }
 133+
133134 /**
134135 * Helper to format a specific item
135136 */

Status & tagging log