}
/**
- * @param bool|string $wikiId The ID of the target wiki database. Use false for the local wiki.
+ * @param bool|string $wiki The ID of the target wiki database. Use false for the local wiki.
*
* @return SqlBlobStore
*/
}
}
- $rec = self::getRevisionStore()->newRevisionFromArchiveRow( $row, 0, null, $overrides );
+ $rec = self::getRevisionStore()->newRevisionFromArchiveRow( $row, 0, $title, $overrides );
return new Revision( $rec, self::READ_NORMAL, $title );
}
*
* MCR migration note: replaced by RevisionStore::newRevisionFromRow(). Note that
* newFromRow() also accepts arrays, while newRevisionFromRow() does not. Instead,
- * a MutableRevisionRecord should be constructed directly. RevisionStore::newRevisionFromArray()
- * can be used as a temporary replacement, but should be avoided.
+ * a MutableRevisionRecord should be constructed directly.
+ * RevisionStore::newMutableRevisionFromArray() can be used as a temporary replacement,
+ * but should be avoided.
*
* @param object|array $row
* @return Revision
* WARNING: Timestamps may in some circumstances not be unique,
* so this isn't the best key to use.
*
- * @deprecated since 1.31, use RevisionStore::loadRevisionFromTimestamp() instead.
+ * @deprecated since 1.31, use RevisionStore::getRevisionByTimestamp()
+ * or RevisionStore::loadRevisionFromTimestamp() instead.
*
* @param IDatabase $db
* @param Title $title
* @return Revision|null
*/
public static function loadFromTimestamp( $db, $title, $timestamp ) {
- // XXX: replace loadRevisionFromTimestamp by getRevisionByTimestamp?
$rec = self::getRevisionStore()->loadRevisionFromTimestamp( $db, $title, $timestamp );
return $rec === null ? null : new Revision( $rec );
}
/**
* Do a batched query to get the parent revision lengths
+ *
+ * @deprecated in 1.31, use RevisionStore::getRevisionSizes instead.
+ *
* @param IDatabase $db
* @param array $revIds
* @return array
if ( $row instanceof RevisionRecord ) {
$this->mRecord = $row;
} elseif ( is_array( $row ) ) {
+ // If no user is specified, fall back to using the global user object, to stay
+ // compatible with pre-1.31 behavior.
if ( !isset( $row['user'] ) && !isset( $row['user_text'] ) ) {
$row['user'] = $wgUser;
}
* @return int Rcid of the unpatrolled row, zero if there isn't one
*/
public function isUnpatrolled() {
- return self::getRevisionStore()->isUnpatrolled( $this->mRecord );
+ return self::getRevisionStore()->getRcIdIfUnpatrolled( $this->mRecord );
}
/**
? $pageIdOrTitle
: Title::newFromID( $pageIdOrTitle );
+ if ( !$title ) {
+ return false;
+ }
+
$record = self::getRevisionStore()->getKnownCurrentRevision( $title, $revId );
return $record ? new Revision( $record ) : false;
}