r107628 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107627‎ | r107628 | r107629 >
Date:09:49, 30 December 2011
Author:adamw
Status:deferred
Tags:
Comment:
wrap empty result in a ResultObject
Modified paths:
  • /trunk/extensions/Offline/DatabaseBz2.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Offline/DatabaseBz2.php
@@ -29,7 +29,7 @@
3030 function select( $table, $fields, $conds='', $fname = 'Database::select', $options = array() ) {
3131 require_once(dirname(__FILE__).'/DumpReader.php');
3232 require_once(dirname(__FILE__).'/CachedStorage.php');
33 - $row = null;
 33+ $row = array();
3434 $title = false;
3535 if (isset($conds['page_title'])) {
3636 $title = $conds['page_title'];
@@ -55,7 +55,7 @@
5656 }
5757
5858 if (!isset($textid))
59 - return false;
 59+ return $this->resultObject(array());
6060
6161 if ($table == 'page') {
6262 // Given a page_title, get the id of text content. For efficiency,
@@ -75,23 +75,13 @@
7676 }
7777 else { print_r($table); print_r($conds); }
7878
79 - if (!$row)
80 - return false;
8179 return $this->resultObject($row);
8280 }
8381
8482
8583 ////////////////////////////////////////////////BOILERPLATE FOLLOWS
8684
87 - static $instance;
8885
89 - static function getInstance() {
90 - if ( !isset( self::$instance ) ) {
91 - self::$instance = new self();
92 - }
93 - return self::$instance;
94 - }
95 -
9686 #------------------------------------------------------------------------------
9787 # Accessors
9888 #------------------------------------------------------------------------------

Status & tagging log