* @file
*/
+use MediaWiki\Edit\PreparedEdit;
use \MediaWiki\Logger\LoggerFactory;
use \MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\FakeResultWrapper;
* @return bool
*/
public function updateIfNewerOn( $dbw, $revision ) {
-
$row = $dbw->selectRow(
[ 'revision', 'page' ],
[ 'rev_id', 'rev_timestamp', 'page_is_redirect' ],
public function replaceSectionContent(
$sectionId, Content $sectionContent, $sectionTitle = '', $edittime = null
) {
-
$baseRevId = null;
if ( $edittime && $sectionId !== 'new' ) {
$dbr = wfGetDB( DB_REPLICA );
public function replaceSectionAtRev( $sectionId, Content $sectionContent,
$sectionTitle = '', $baseRevId = null
) {
-
if ( strval( $sectionId ) === '' ) {
// Whole-page edit; let the whole text through
$newContent = $sectionContent;
* @param string|null $serialFormat
* @param bool $useCache Check shared prepared edit cache
*
- * @return object
+ * @return PreparedEdit
*
* @since 1.21
*/
$popts = ParserOptions::newFromUserAndLang( $user, $wgContLang );
Hooks::run( 'ArticlePrepareTextForEdit', [ $this, $popts ] );
- $edit = (object)[];
+ $edit = new PreparedEdit();
if ( $cachedEdit ) {
$edit->timestamp = $cachedEdit->timestamp;
} else {
}
// Clear caches
- WikiPage::onArticleDelete( $this->mTitle );
+ self::onArticleDelete( $this->mTitle );
ResourceLoaderWikiModule::invalidateModuleCache(
$this->mTitle, $revision, null, wfWikiID()
);
HTMLFileCache::clearFileCache( $title );
$revid = $revision ? $revision->getId() : null;
- DeferredUpdates::addCallableUpdate( function() use ( $title, $revid ) {
+ DeferredUpdates::addCallableUpdate( function () use ( $title, $revid ) {
InfoAction::invalidateCache( $title, $revid );
} );
}