if ( $this->buffer == WikiExporter::STREAM ) {
$prev = $this->db->bufferResults( false );
}
- $wrapper = null; // Assuring $wrapper is not undefined, if exception occurs early
+ $result = null; // Assuring $result is not undefined, if exception occurs early
try {
$result = $this->db->select( array( 'logging', 'user' ),
array( "{$logging}.*", 'user_name' ), // grab the user name
__METHOD__,
array( 'ORDER BY' => 'log_id', 'USE INDEX' => array( 'logging' => 'PRIMARY' ) )
);
- $wrapper = $this->db->resultObject( $result );
- $this->outputLogStream( $wrapper );
+ $this->outputLogStream( $result );
if ( $this->buffer == WikiExporter::STREAM ) {
$this->db->bufferResults( $prev );
}
// Freeing result
try {
- if ( $wrapper ) {
- $wrapper->free();
+ if ( $result ) {
+ $result->free();
}
} catch ( Exception $e2 ) {
// Already in panic mode -> ignoring $e2 as $e has
$prev = $this->db->bufferResults( false );
}
- $wrapper = null; // Assuring $wrapper is not undefined, if exception occurs early
+ $result = null; // Assuring $result is not undefined, if exception occurs early
try {
wfRunHooks( 'ModifyExportQuery',
array( $this->db, &$tables, &$cond, &$opts, &$join ) );
# Do the query!
$result = $this->db->select( $tables, '*', $cond, __METHOD__, $opts, $join );
- $wrapper = $this->db->resultObject( $result );
# Output dump results
- $this->outputPageStream( $wrapper );
+ $this->outputPageStream( $result );
if ( $this->buffer == WikiExporter::STREAM ) {
$this->db->bufferResults( $prev );
// Freeing result
try {
- if ( $wrapper ) {
- $wrapper->free();
+ if ( $result ) {
+ $result->free();
}
} catch ( Exception $e2 ) {
// Already in panic mode -> ignoring $e2 as $e has
}
/**
- * @param array $resultset
+ * @param ResultWrapper $resultset
*/
protected function outputLogStream( $resultset ) {
foreach ( $resultset as $row ) {
* @access public
*/
function searchText( $term ) {
- $resultSet = $this->db->resultObject(
- $this->db->query( $this->getQuery( $this->filter( $term ), true ) )
- );
-
+ $resultSet = $this->db->query( $this->getQuery( $this->filter( $term ), true ) );
return new SqlSearchResultSet( $resultSet, $this->searchTerms );
}
* @access public
*/
function searchTitle( $term ) {
- $resultSet = $this->db->resultObject(
- $this->db->query( $this->getQuery( $this->filter( $term ), false ) )
- );
-
+ $resultSet = $this->db->query( $this->getQuery( $this->filter( $term ), false ) );
return new SqlSearchResultSet( $resultSet, $this->searchTerms );
}
return new SqlSearchResultSet( false, '' );
}
- $resultSet = $this->db->resultObject(
- $this->db->query( $this->getQuery( $this->filter( $term ), true ) )
- );
-
+ $resultSet = $this->db->query( $this->getQuery( $this->filter( $term ), true ) );
return new SqlSearchResultSet( $resultSet, $this->searchTerms );
}
return new SqlSearchResultSet( false, '' );
}
- $resultSet = $this->db->resultObject(
- $this->db->query( $this->getQuery( $this->filter( $term ), false ) )
- );
-
+ $resultSet = $this->db->query( $this->getQuery( $this->filter( $term ), false ) );
return new SqlSearchResultSet( $resultSet, $this->searchTerms );
}
function searchTitle( $term ) {
$q = $this->searchQuery( $term, 'titlevector', 'page_title' );
$olderror = error_reporting( E_ERROR );
- $resultSet = $this->db->resultObject( $this->db->query( $q, 'SearchPostgres', true ) );
+ $resultSet = $this->db->query( $q, 'SearchPostgres', true );
error_reporting( $olderror );
return new SqlSearchResultSet( $resultSet, $this->searchTerms );
}
function searchText( $term ) {
$q = $this->searchQuery( $term, 'textvector', 'old_text' );
$olderror = error_reporting( E_ERROR );
- $resultSet = $this->db->resultObject( $this->db->query( $q, 'SearchPostgres', true ) );
+ $resultSet = $this->db->query( $q, 'SearchPostgres', true );
error_reporting( $olderror );
return new SqlSearchResultSet( $resultSet, $this->searchTerms );
}
$res = $dbr->query( $sql, $fname );
}
- return $dbr->resultObject( $res );
+ return $res;
}
/**
* @return bool|ResultWrapper
*/
protected static function listPages( $dbr, $condition ) {
- return $dbr->resultObject( $dbr->select(
+ return $dbr->select(
array( 'archive' ),
array(
'ar_namespace',
'ORDER BY' => array( 'ar_namespace', 'ar_title' ),
'LIMIT' => 100,
)
- ) );
+ );
}
/**
$options
);
- $res = $dbr->select( $tables,
+ return $dbr->select( $tables,
$fields,
$conds,
__METHOD__,
$options,
$join_conds
);
-
- return $dbr->resultObject( $res );
}
/**
}
$dbr = wfGetDB( DB_SLAVE );
- $res = $dbr->select(
+ return $dbr->select(
'filearchive',
ArchivedFile::selectFields(),
array( 'fa_name' => $this->title->getDBkey() ),
__METHOD__,
array( 'ORDER BY' => 'fa_timestamp DESC' )
);
-
- return $dbr->resultObject( $res );
}
/**
__METHOD__,
/* options */ array( 'ORDER BY' => 'ar_timestamp' )
);
- $ret = $dbw->resultObject( $result );
- $rev_count = $dbw->numRows( $result );
+ $rev_count = $result->numRows();
if ( !$rev_count ) {
wfDebug( __METHOD__ . ": no revisions to restore\n" );
return $status;
}
- $ret->seek( $rev_count - 1 ); // move to last
- $row = $ret->fetchObject(); // get newest archived rev
+ $result->seek( $rev_count - 1 ); // move to last
+ $row = $result->fetchObject(); // get newest archived rev
$oldPageId = (int)$row->ar_page_id; // pass this to ArticleUndelete hook
- $ret->seek( 0 ); // move back
+ $result->seek( 0 ); // move back
// grab the content to check consistency with global state before restoring the page.
$revision = Revision::newFromArchiveRow( $row,
$revision = null;
$restored = 0;
- foreach ( $ret as $row ) {
+ foreach ( $result as $row ) {
// Check for key dupes due to shitty archive integrity.
if ( $row->ar_rev_id ) {
$exists = $dbw->selectField( 'revision', '1',