$matchId = 'page_latest';
}
return self::loadFromConds( $db,
- array( "rev_id=$matchId",
- 'page_namespace' => $title->getNamespace(),
- 'page_title' => $title->getDBkey() )
+ array(
+ "rev_id=$matchId",
+ 'page_namespace' => $title->getNamespace(),
+ 'page_title' => $title->getDBkey()
+ )
);
}
*/
public static function loadFromTimestamp( $db, $title, $timestamp ) {
return self::loadFromConds( $db,
- array( 'rev_timestamp' => $db->timestamp( $timestamp ),
- 'page_namespace' => $title->getNamespace(),
- 'page_title' => $title->getDBkey() )
+ array(
+ 'rev_timestamp' => $db->timestamp( $timestamp ),
+ 'page_namespace' => $title->getNamespace(),
+ 'page_title' => $title->getDBkey()
+ )
);
}
public static function fetchRevision( $title ) {
return self::fetchFromConds(
wfGetDB( DB_SLAVE ),
- array( 'rev_id=page_latest',
- 'page_namespace' => $title->getNamespace(),
- 'page_title' => $title->getDBkey() )
+ array(
+ 'rev_id=page_latest',
+ 'page_namespace' => $title->getNamespace(),
+ 'page_title' => $title->getDBkey()
+ )
);
}
if ( !isset( $row->rev_parent_id ) ) {
$this->mParentId = null;
} else {
- $this->mParentId = intval( $row->rev_parent_id );
+ $this->mParentId = intval( $row->rev_parent_id );
}
if ( !isset( $row->rev_len ) ) {
}
// Lazy extraction...
- $this->mText = null;
+ $this->mText = null;
if( isset( $row->old_text ) ) {
$this->mTextRow = $row;
} else {
// Build a new revision to be saved...
global $wgUser; // ugh
-
# if we have a content object, use it to set the model and type
if ( !empty( $row['content'] ) ) {
//@todo: when is that set? test with external store setup! check out insertOn() [dk]
if ( !empty( $row['text_id'] ) ) {
- throw new MWException( "Text already stored in external store (id {$row['text_id']}), "
- . "can't serialize content object" );
+ throw new MWException( "Text already stored in external store (id {$row['text_id']}), " .
+ "can't serialize content object" );
}
$row['content_model'] = $row['content']->getModel();
} elseif ( $this->mTitle->getArticleID() !== $this->mPage ) {
// Got different page IDs. This may be legit (e.g. during undeletion),
// but it seems worth mentioning it in the log.
- wfDebug( "Page ID " . $this->mPage . " mismatches the ID "
- . $this->mTitle->getArticleID() . " provided by the Title object." );
+ wfDebug( "Page ID " . $this->mPage . " mismatches the ID " .
+ $this->mTitle->getArticleID() . " provided by the Title object." );
}
}
- $this->mCurrent = false;
+ $this->mCurrent = false;
// If we still have no length, see it we have the text to figure it out
if ( !$this->mSize ) {
array( 'page', 'revision' ),
self::selectPageFields(),
array( 'page_id=rev_page',
- 'rev_id' => $this->mId ),
+ 'rev_id' => $this->mId ),
__METHOD__ );
if ( $row ) {
$this->mTitle = Title::newFromRow( $row );
/**
* Get previous revision for this title
*
- * @return Revision or null
+ * @return Revision|null
*/
public function getPrevious() {
if( $this->getTitle() ) {
if ( $wgContentHandlerUseDB ) {
//NOTE: Store null for the default model and format, to save space.
- //XXX: Makes the DB sensitive to changed defaults. Make this behaviour optional? Only in miser mode?
+ //XXX: Makes the DB sensitive to changed defaults. Make this behavior optional? Only in miser mode?
$model = $this->getContentModel();
$format = $this->getContentFormat();
*/
static function getTimestampFromId( $title, $id ) {
$dbr = wfGetDB( DB_SLAVE );
- // Casting fix for DB2
+ // Casting fix for databases that can't take '' for rev_id
if ( $id == '' ) {
$id = 0;
}