$edit->newContent = $content;
$edit->oldContent = $this->getContent( Revision::RAW );
- // NOTE: B/C for hooks! don't use these fields!
- $edit->newText = $edit->newContent
- ? ContentHandler::getContentText( $edit->newContent )
- : '';
- $edit->oldText = $edit->oldContent
- ? ContentHandler::getContentText( $edit->oldContent )
- : '';
- $edit->pst = $edit->pstContent ? $edit->pstContent->serialize( $serialFormat ) : '';
-
if ( $edit->output ) {
$edit->output->setCacheTime( wfTimestampNow() );
}
$good = 0;
}
$edits = $options['changed'] ? 1 : 0;
- $total = $options['created'] ? 1 : 0;
+ $pages = $options['created'] ? 1 : 0;
- DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, $edits, $good, $total ) );
+ DeferredUpdates::addUpdate( SiteStatsUpdate::factory(
+ [ 'edits' => $edits, 'articles' => $good, 'pages' => $pages ]
+ ) );
DeferredUpdates::addUpdate( new SearchUpdate( $id, $title, $content ) );
// If this is another user's talk page, update newtalk.
$cascade = false;
if ( $limit['create'] != '' ) {
- $commentFields = CommentStore::newKey( 'pt_reason' )->insert( $dbw, $reason );
+ $commentFields = CommentStore::getStore()->insert( $dbw, 'pt_reason', $reason );
$dbw->replace( 'protected_titles',
[ [ 'pt_namespace', 'pt_title' ] ],
[
$content = null;
}
- $revCommentStore = new CommentStore( 'rev_comment' );
- $arCommentStore = new CommentStore( 'ar_comment' );
+ $commentStore = CommentStore::getStore();
$revQuery = Revision::getQueryInfo();
$bitfield = false;
$ipRevIds = [];
foreach ( $res as $row ) {
- $comment = $revCommentStore->getComment( $row );
+ $comment = $commentStore->getComment( 'rev_comment', $row );
$rowInsert = [
'ar_namespace' => $namespace,
'ar_title' => $dbKey,
'ar_page_id' => $id,
'ar_deleted' => $suppress ? $bitfield : $row->rev_deleted,
'ar_sha1' => $row->rev_sha1,
- ] + $arCommentStore->insert( $dbw, $comment );
+ ] + $commentStore->insert( $dbw, 'ar_comment', $comment );
if ( $wgContentHandlerUseDB ) {
$rowInsert['ar_content_model'] = $row->rev_content_model;
$rowInsert['ar_content_format'] = $row->rev_content_format;
}
// Update site status
- DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, 1, - (int)$countable, -1 ) );
+ DeferredUpdates::addUpdate( SiteStatsUpdate::factory(
+ [ 'edits' => 1, 'articles' => -$countable, 'pages' => -1 ]
+ ) );
// Delete pagelinks, update secondary indexes, etc
$updates = $this->getDeletionUpdates( $content );