-/*
- # Save to history
- $dbw->insertSelect( 'old', 'cur',
- array(
- 'old_namespace' => 'cur_namespace',
- 'old_title' => 'cur_title',
- 'old_text' => 'cur_text',
- 'old_comment' => 'cur_comment',
- 'old_user' => 'cur_user',
- 'old_user_text' => 'cur_user_text',
- 'old_timestamp' => 'cur_timestamp',
- 'inverse_timestamp' => '99999999999999-cur_timestamp',
- ), array(
- 'cur_namespace' => $ns,
- 'cur_title' => $dbkey,
- ), $fname
- );
-
- # Use the affected row count to determine if the article is new
- $numRows = $dbw->affectedRows();
-
- # Make an array of fields to be inserted
- $fields = array(
- 'cur_text' => $text,
- 'cur_timestamp' => $timestamp,
- 'cur_user' => $wgUser->getID(),
- 'cur_user_text' => $wgUser->getName(),
- 'inverse_timestamp' => wfInvertTimestamp( $timestamp ),
- 'cur_comment' => $comment,
- 'cur_is_redirect' => $this->isRedirect( $text ) ? 1 : 0,
- 'cur_minor_edit' => intval($minor),
- 'cur_touched' => $dbw->timestamp($timestamp),
- );
-
- if ( $numRows ) {
- # Update article
- $fields['cur_is_new'] = 0;
- $dbw->update( 'cur', $fields, array( 'cur_namespace' => $ns, 'cur_title' => $dbkey ), $fname );
- } else {
- # Insert new article
- $fields['cur_is_new'] = 1;
- $fields['cur_namespace'] = $ns;
- $fields['cur_title'] = $dbkey;
- $fields['cur_random'] = $rand = wfRandom();
- $dbw->insert( 'cur', $fields, $fname );
- }
-*/