aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--autoload.php7
-rw-r--r--includes/CommentFormatter/RowCommentFormatter.php2
-rw-r--r--includes/CommentFormatter/RowCommentIterator.php2
-rw-r--r--includes/CommentStore/CommentStore.php87
-rw-r--r--includes/CommentStore/CommentStoreBase.php (renamed from includes/CommentStore.php)84
-rw-r--r--includes/CommentStore/CommentStoreComment.php (renamed from includes/CommentStoreComment.php)6
-rw-r--r--includes/EditPage.php2
-rw-r--r--includes/Feed/FeedUtils.php2
-rw-r--r--includes/MediaWikiServices.php2
-rw-r--r--includes/MergeHistory.php1
-rw-r--r--includes/MovePage.php1
-rw-r--r--includes/Permissions/RestrictionStore.php2
-rw-r--r--includes/ProtectionForm.php1
-rw-r--r--includes/ResourceLoader/ResourceLoader.php2
-rw-r--r--includes/Revision/MutableRevisionRecord.php2
-rw-r--r--includes/Revision/RevisionArchiveRecord.php2
-rw-r--r--includes/Revision/RevisionRecord.php2
-rw-r--r--includes/Revision/RevisionStore.php4
-rw-r--r--includes/Revision/RevisionStoreCacheRecord.php2
-rw-r--r--includes/Revision/RevisionStoreFactory.php2
-rw-r--r--includes/Revision/RevisionStoreRecord.php2
-rw-r--r--includes/ServiceWiring.php1
-rw-r--r--includes/Storage/Hook/BeforeRevertedTagUpdateHook.php2
-rw-r--r--includes/Storage/Hook/MultiContentSaveHook.php2
-rw-r--r--includes/Storage/Hook/PageContentSaveHook.php2
-rw-r--r--includes/Storage/PageUpdater.php2
-rw-r--r--includes/actions/DeleteAction.php1
-rw-r--r--includes/actions/McrUndoAction.php2
-rw-r--r--includes/api/ApiQueryBlocks.php1
-rw-r--r--includes/api/ApiQueryDeletedrevs.php1
-rw-r--r--includes/api/ApiQueryFilearchive.php1
-rw-r--r--includes/api/ApiQueryLogEvents.php1
-rw-r--r--includes/api/ApiQueryProtectedTitles.php1
-rw-r--r--includes/api/ApiQueryRecentChanges.php1
-rw-r--r--includes/api/ApiQueryUserContribs.php1
-rw-r--r--includes/api/ApiQueryWatchlist.php1
-rw-r--r--includes/block/AbstractBlock.php2
-rw-r--r--includes/block/Block.php2
-rw-r--r--includes/block/BlockErrorFormatter.php2
-rw-r--r--includes/block/DatabaseBlock.php2
-rw-r--r--includes/block/DatabaseBlockStore.php2
-rw-r--r--includes/changes/RecentChange.php1
-rw-r--r--includes/content/ContentHandler.php1
-rw-r--r--includes/export/WikiExporter.php1
-rw-r--r--includes/export/XmlDumpWriter.php1
-rw-r--r--includes/filerepo/file/LocalFile.php1
-rw-r--r--includes/import/ImportableOldRevisionImporter.php1
-rw-r--r--includes/import/WikiRevision.php2
-rw-r--r--includes/logging/DatabaseLogEntry.php1
-rw-r--r--includes/logging/ManualLogEntry.php1
-rw-r--r--includes/logging/RCDatabaseLogEntry.php1
-rw-r--r--includes/page/DeletePage.php2
-rw-r--r--includes/page/PageCommandFactory.php2
-rw-r--r--includes/page/RollbackPage.php2
-rw-r--r--includes/page/WikiPage.php2
-rw-r--r--includes/revisiondelete/RevDelLogItem.php1
-rw-r--r--includes/revisiondelete/RevDelLogList.php1
-rw-r--r--includes/specials/SpecialAutoblockList.php1
-rw-r--r--includes/specials/SpecialBlock.php1
-rw-r--r--includes/specials/SpecialBlockList.php1
-rw-r--r--includes/specials/SpecialChangeContentModel.php1
-rw-r--r--includes/specials/SpecialDeletedContributions.php1
-rw-r--r--includes/specials/SpecialEditTags.php1
-rw-r--r--includes/specials/SpecialListFiles.php1
-rw-r--r--includes/specials/SpecialMovepage.php1
-rw-r--r--includes/specials/SpecialNewpages.php1
-rw-r--r--includes/specials/SpecialProtectedpages.php1
-rw-r--r--includes/specials/SpecialRevisionDelete.php1
-rw-r--r--includes/specials/SpecialTags.php1
-rw-r--r--includes/specials/SpecialUndelete.php1
-rw-r--r--includes/specials/SpecialUserrights.php1
-rw-r--r--includes/specials/helpers/ImportReporter.php1
-rw-r--r--includes/specials/pagers/BlockListPager.php1
-rw-r--r--includes/specials/pagers/DeletedContribsPager.php1
-rw-r--r--includes/specials/pagers/ImageListPager.php1
-rw-r--r--includes/specials/pagers/ProtectedPagesPager.php1
-rw-r--r--includes/watcheditem/WatchedItemQueryService.php1
-rw-r--r--maintenance/edit.php1
-rw-r--r--maintenance/populateArchiveRevId.php1
-rw-r--r--maintenance/rebuildrecentchanges.php1
-rw-r--r--tests/phpunit/includes/CommentStoreTest.php32
81 files changed, 233 insertions, 90 deletions
diff --git a/autoload.php b/autoload.php
index 43dadd441c5f..aa2493b61f75 100644
--- a/autoload.php
+++ b/autoload.php
@@ -269,8 +269,8 @@ $wgAutoloadLocalClasses = [
'CollapsibleFieldsetLayout' => __DIR__ . '/includes/htmlform/CollapsibleFieldsetLayout.php',
'Collation' => __DIR__ . '/includes/collation/Collation.php',
'CollationCkb' => __DIR__ . '/includes/collation/CollationCkb.php',
- 'CommentStore' => __DIR__ . '/includes/CommentStore.php',
- 'CommentStoreComment' => __DIR__ . '/includes/CommentStoreComment.php',
+ 'CommentStore' => __DIR__ . '/includes/CommentStore/CommentStore.php',
+ 'CommentStoreComment' => __DIR__ . '/includes/CommentStore/CommentStoreComment.php',
'CompareParserCache' => __DIR__ . '/maintenance/compareParserCache.php',
'CompareParsers' => __DIR__ . '/maintenance/compareParsers.php',
'ComposerHookHandler' => __DIR__ . '/includes/composer/ComposerHookHandler.php',
@@ -976,6 +976,9 @@ $wgAutoloadLocalClasses = [
'MediaWiki\\CommentFormatter\\RowCommentFormatter' => __DIR__ . '/includes/CommentFormatter/RowCommentFormatter.php',
'MediaWiki\\CommentFormatter\\RowCommentIterator' => __DIR__ . '/includes/CommentFormatter/RowCommentIterator.php',
'MediaWiki\\CommentFormatter\\StringCommentIterator' => __DIR__ . '/includes/CommentFormatter/StringCommentIterator.php',
+ 'MediaWiki\\CommentStore\\CommentStore' => __DIR__ . '/includes/CommentStore/CommentStore.php',
+ 'MediaWiki\\CommentStore\\CommentStoreBase' => __DIR__ . '/includes/CommentStore/CommentStoreBase.php',
+ 'MediaWiki\\CommentStore\\CommentStoreComment' => __DIR__ . '/includes/CommentStore/CommentStoreComment.php',
'MediaWiki\\Config\\ConfigRepository' => __DIR__ . '/includes/config/ConfigRepository.php',
'MediaWiki\\Config\\IterableConfig' => __DIR__ . '/includes/config/IterableConfig.php',
'MediaWiki\\Config\\ServiceOptions' => __DIR__ . '/includes/config/ServiceOptions.php',
diff --git a/includes/CommentFormatter/RowCommentFormatter.php b/includes/CommentFormatter/RowCommentFormatter.php
index a90fe34364a4..99d5a2ce93da 100644
--- a/includes/CommentFormatter/RowCommentFormatter.php
+++ b/includes/CommentFormatter/RowCommentFormatter.php
@@ -2,7 +2,7 @@
namespace MediaWiki\CommentFormatter;
-use CommentStore;
+use MediaWiki\CommentStore\CommentStore;
use Traversable;
use Wikimedia\Rdbms\IResultWrapper;
diff --git a/includes/CommentFormatter/RowCommentIterator.php b/includes/CommentFormatter/RowCommentIterator.php
index 4455b7378980..620a2e7ee765 100644
--- a/includes/CommentFormatter/RowCommentIterator.php
+++ b/includes/CommentFormatter/RowCommentIterator.php
@@ -3,8 +3,8 @@
namespace MediaWiki\CommentFormatter;
use ArrayIterator;
-use CommentStore;
use IteratorIterator;
+use MediaWiki\CommentStore\CommentStore;
use TitleValue;
use Traversable;
diff --git a/includes/CommentStore/CommentStore.php b/includes/CommentStore/CommentStore.php
new file mode 100644
index 000000000000..c47f6e49d435
--- /dev/null
+++ b/includes/CommentStore/CommentStore.php
@@ -0,0 +1,87 @@
+<?php
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+namespace MediaWiki\CommentStore;
+
+use Language;
+use MediaWiki\MediaWikiServices;
+
+/**
+ * @defgroup CommentStore CommentStore
+ *
+ * The Comment store in MediaWiki is responsible for storing edit summaries,
+ * log action comments and other such short strings (referred to as "comments").
+ *
+ * The CommentStore class handles the database abstraction for reading
+ * and writing comments, which are represented by CommentStoreComment objects.
+ *
+ * Data is internally stored in the `comment` table.
+ */
+
+/**
+ * Handle database storage of comments such as edit summaries and log reasons.
+ *
+ * @ingroup CommentStore
+ * @since 1.30
+ */
+class CommentStore extends CommentStoreBase {
+ /**
+ * Define fields that use temporary tables for transitional purposes
+ * Array keys are field names, values are arrays with these possible fields:
+ * - table: Temporary table name
+ * - pk: Temporary table column referring to the main table's primary key
+ * - field: Temporary table column referring comment.comment_id
+ * - joinPK: Main table's primary key
+ * - stage: Migration stage
+ * - deprecatedIn: Version when using insertWithTempTable() was deprecated
+ */
+ protected const TEMP_TABLES = [
+ 'rev_comment' => [
+ 'table' => 'revision_comment_temp',
+ 'pk' => 'revcomment_rev',
+ 'field' => 'revcomment_comment_id',
+ 'joinPK' => 'rev_id',
+ 'stage' => MIGRATION_OLD,
+ 'deprecatedIn' => null,
+ ],
+ ];
+
+ /**
+ * @param Language $lang Language to use for comment truncation. Defaults
+ * to content language.
+ * @param int $stage One of the MIGRATION_* constants, or an appropriate
+ * combination of SCHEMA_COMPAT_* constants. Always MIGRATION_NEW for
+ * MediaWiki core since 1.33.
+ */
+ public function __construct( Language $lang, $stage ) {
+ parent::__construct( self::TEMP_TABLES, $lang, $stage );
+ }
+
+ /**
+ * @since 1.31
+ * @deprecated in 1.31 Use DI to inject a CommentStore instance into your class.
+ * @return CommentStore
+ */
+ public static function getStore() {
+ return MediaWikiServices::getInstance()->getCommentStore();
+ }
+}
+
+class_alias( CommentStore::class, 'CommentStore' );
diff --git a/includes/CommentStore.php b/includes/CommentStore/CommentStoreBase.php
index f064ec21bcef..4c2e0bde8994 100644
--- a/includes/CommentStore.php
+++ b/includes/CommentStore/CommentStoreBase.php
@@ -18,29 +18,25 @@
* @file
*/
+namespace MediaWiki\CommentStore;
+
+use FormatJson;
+use InvalidArgumentException;
+use Language;
+use LogicException;
use MediaWiki\Language\RawMessage;
-use MediaWiki\MediaWikiServices;
+use Message;
+use OverflowException;
+use stdClass;
use Wikimedia\Rdbms\IDatabase;
-/**
- * @defgroup CommentStore CommentStore
- *
- * The Comment store in MediaWiki is responsible for storing edit summaries,
- * log action comments and other such short strings (referred to as "comments").
- *
- * The CommentStore class handles the database abstraction for reading
- * and writing comments, which are represented by CommentStoreComment objects.
- *
- * Data is internally stored in the `comment` table.
- */
-
-/**
+/*
* Handle database storage of comments such as edit summaries and log reasons.
*
* @ingroup CommentStore
- * @since 1.30
+ * @since 1.40
*/
-class CommentStore {
+class CommentStoreBase {
/**
* Maximum length of a comment in UTF-8 characters. Longer comments will be truncated.
@@ -65,16 +61,7 @@ class CommentStore {
* - stage: Migration stage
* - deprecatedIn: Version when using insertWithTempTable() was deprecated
*/
- protected const TEMP_TABLES = [
- 'rev_comment' => [
- 'table' => 'revision_comment_temp',
- 'pk' => 'revcomment_rev',
- 'field' => 'revcomment_comment_id',
- 'joinPK' => 'rev_id',
- 'stage' => MIGRATION_OLD,
- 'deprecatedIn' => null,
- ],
- ];
+ private $tempTables;
/**
* @var int One of the MIGRATION_* constants, or an appropriate combination
@@ -91,13 +78,13 @@ class CommentStore {
private $lang;
/**
+ * @param array $tempTables Define fields that use temporary tables for transitional purposes
* @param Language $lang Language to use for comment truncation. Defaults
* to content language.
* @param int $stage One of the MIGRATION_* constants, or an appropriate
- * combination of SCHEMA_COMPAT_* constants. Always MIGRATION_NEW for
- * MediaWiki core since 1.33.
+ * combination of SCHEMA_COMPAT_* constants.
*/
- public function __construct( Language $lang, $stage ) {
+ public function __construct( $tempTables, Language $lang, $stage ) {
if ( ( $stage & SCHEMA_COMPAT_WRITE_BOTH ) === 0 ) {
throw new InvalidArgumentException( '$stage must include a write mode' );
}
@@ -105,17 +92,9 @@ class CommentStore {
throw new InvalidArgumentException( '$stage must include a read mode' );
}
- $this->stage = $stage;
+ $this->tempTables = $tempTables;
$this->lang = $lang;
- }
-
- /**
- * @since 1.31
- * @deprecated in 1.31 Use DI to inject a CommentStore instance into your class.
- * @return CommentStore
- */
- public static function getStore() {
- return MediaWikiServices::getInstance()->getCommentStore();
+ $this->stage = $stage;
}
/**
@@ -145,9 +124,9 @@ class CommentStore {
$fields["{$key}_old"] = $key;
}
- $tempTableStage = static::TEMP_TABLES[$key]['stage'] ?? MIGRATION_NEW;
+ $tempTableStage = $this->tempTables[$key]['stage'] ?? MIGRATION_NEW;
if ( $tempTableStage & SCHEMA_COMPAT_READ_OLD ) {
- $fields["{$key}_pk"] = static::TEMP_TABLES[$key]['joinPK'];
+ $fields["{$key}_pk"] = $this->tempTables[$key]['joinPK'];
}
if ( $tempTableStage & SCHEMA_COMPAT_READ_NEW ) {
$fields["{$key}_id"] = "{$key}_id";
@@ -186,9 +165,9 @@ class CommentStore {
} else { // READ_BOTH or READ_NEW
$join = ( $this->stage & SCHEMA_COMPAT_READ_OLD ) ? 'LEFT JOIN' : 'JOIN';
- $tempTableStage = static::TEMP_TABLES[$key]['stage'] ?? MIGRATION_NEW;
+ $tempTableStage = $this->tempTables[$key]['stage'] ?? MIGRATION_NEW;
if ( $tempTableStage & SCHEMA_COMPAT_READ_OLD ) {
- $t = static::TEMP_TABLES[$key];
+ $t = $this->tempTables[$key];
$alias = "temp_$key";
$tables[$alias] = $t['table'];
$joins[$alias] = [ $join, "{$alias}.{$t['pk']} = {$t['joinPK']}" ];
@@ -196,7 +175,7 @@ class CommentStore {
$joinField = "{$alias}.{$t['field']}";
} else {
// Nothing hits this code path for now, but will in the future when we set
- // static::TEMP_TABLES['rev_comment']['stage'] to MIGRATION_WRITE_NEW while
+ // $this->tempTables['rev_comment']['stage'] to MIGRATION_WRITE_NEW while
// merging revision_comment_temp into revision.
// @codeCoverageIgnoreStart
$joins[$alias][0] = 'LEFT JOIN';
@@ -262,7 +241,7 @@ class CommentStore {
}
$data = null;
} else {
- $tempTableStage = static::TEMP_TABLES[$key]['stage'] ?? MIGRATION_NEW;
+ $tempTableStage = $this->tempTables[$key]['stage'] ?? MIGRATION_NEW;
$row2 = null;
if ( ( $tempTableStage & SCHEMA_COMPAT_READ_NEW ) && array_key_exists( "{$key}_id", $row ) ) {
if ( !$db ) {
@@ -287,7 +266,7 @@ class CommentStore {
. "does have fields for getCommentLegacy()"
);
}
- $t = static::TEMP_TABLES[$key];
+ $t = $this->tempTables[$key];
$id = $row["{$key}_pk"];
$row2 = $db->newSelectQueryBuilder()
->select( [ 'comment_id', 'comment_text', 'comment_data' ] )
@@ -495,9 +474,9 @@ class CommentStore {
}
if ( $this->stage & SCHEMA_COMPAT_WRITE_NEW ) {
- $tempTableStage = static::TEMP_TABLES[$key]['stage'] ?? MIGRATION_NEW;
+ $tempTableStage = $this->tempTables[$key]['stage'] ?? MIGRATION_NEW;
if ( $tempTableStage & SCHEMA_COMPAT_WRITE_OLD ) {
- $t = static::TEMP_TABLES[$key];
+ $t = $this->tempTables[$key];
$func = __METHOD__;
$commentId = $comment->id;
$callback = static function ( $id ) use ( $dbw, $commentId, $t, $func ) {
@@ -541,7 +520,7 @@ class CommentStore {
// @codeCoverageIgnoreEnd
}
- $tempTableStage = static::TEMP_TABLES[$key]['stage'] ?? MIGRATION_NEW;
+ $tempTableStage = $this->tempTables[$key]['stage'] ?? MIGRATION_NEW;
if ( $tempTableStage & SCHEMA_COMPAT_WRITE_OLD ) {
throw new InvalidArgumentException( "Must use insertWithTempTable() for $key" );
}
@@ -577,11 +556,10 @@ class CommentStore {
// @codeCoverageIgnoreEnd
}
- if ( !isset( static::TEMP_TABLES[$key] ) ) {
+ if ( !isset( $this->tempTables[$key] ) ) {
throw new InvalidArgumentException( "Must use insert() for $key" );
- } elseif ( isset( static::TEMP_TABLES[$key]['deprecatedIn'] ) ) {
- // @phan-suppress-next-line PhanTypeMismatchArgument 'deprecatedIn' is usually string
- wfDeprecated( __METHOD__ . " for $key", static::TEMP_TABLES[$key]['deprecatedIn'] );
+ } elseif ( isset( $this->tempTables[$key]['deprecatedIn'] ) ) {
+ wfDeprecated( __METHOD__ . " for $key", $this->tempTables[$key]['deprecatedIn'] );
}
[ $fields, $callback ] = $this->insertInternal( $dbw, $key, $comment, $data );
diff --git a/includes/CommentStoreComment.php b/includes/CommentStore/CommentStoreComment.php
index cce94b0e2ed0..315cdb459c1a 100644
--- a/includes/CommentStoreComment.php
+++ b/includes/CommentStore/CommentStoreComment.php
@@ -18,8 +18,12 @@
* @file
*/
+namespace MediaWiki\CommentStore;
+
+use InvalidArgumentException;
use MediaWiki\Language\RawMessage;
use MediaWiki\MediaWikiServices;
+use Message;
/**
* Value object for a comment stored by CommentStore.
@@ -91,3 +95,5 @@ class CommentStoreComment {
}
}
}
+
+class_alias( CommentStoreComment::class, 'CommentStoreComment' );
diff --git a/includes/EditPage.php b/includes/EditPage.php
index 9eca31fc7682..d9c3812dd706 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -22,6 +22,8 @@
use MediaWiki\Block\DatabaseBlock;
use MediaWiki\Cache\LinkBatchFactory;
+use MediaWiki\CommentStore\CommentStore;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Content\IContentHandlerFactory;
use MediaWiki\EditPage\Constraint\AccidentalRecreationConstraint;
use MediaWiki\EditPage\Constraint\AutoSummaryMissingSummaryConstraint;
diff --git a/includes/Feed/FeedUtils.php b/includes/Feed/FeedUtils.php
index c0860e08f56e..e82ec53a5094 100644
--- a/includes/Feed/FeedUtils.php
+++ b/includes/Feed/FeedUtils.php
@@ -23,10 +23,10 @@
namespace MediaWiki\Feed;
-use CommentStore;
use DerivativeContext;
use Html;
use LogFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\RevisionRecord;
diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php
index 8f7f6fdcd498..7417a7e77343 100644
--- a/includes/MediaWikiServices.php
+++ b/includes/MediaWikiServices.php
@@ -22,7 +22,6 @@ namespace MediaWiki;
use BagOStuff;
use CentralIdLookup;
-use CommentStore;
use Config;
use ConfigFactory;
use ConfiguredReadOnlyMode;
@@ -60,6 +59,7 @@ use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\Collation\CollationFactory;
use MediaWiki\CommentFormatter\CommentFormatter;
use MediaWiki\CommentFormatter\RowCommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Config\ConfigRepository;
use MediaWiki\Content\IContentHandlerFactory;
use MediaWiki\Content\Renderer\ContentRenderer;
diff --git a/includes/MergeHistory.php b/includes/MergeHistory.php
index 4d606cc82d1b..5754615b542c 100644
--- a/includes/MergeHistory.php
+++ b/includes/MergeHistory.php
@@ -21,6 +21,7 @@
* @file
*/
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Content\IContentHandlerFactory;
use MediaWiki\EditPage\SpamChecker;
use MediaWiki\HookContainer\HookContainer;
diff --git a/includes/MovePage.php b/includes/MovePage.php
index 7cefc0361fa4..1efb522bcf48 100644
--- a/includes/MovePage.php
+++ b/includes/MovePage.php
@@ -19,6 +19,7 @@
*/
use MediaWiki\Collation\CollationFactory;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\Content\IContentHandlerFactory;
use MediaWiki\EditPage\SpamChecker;
diff --git a/includes/Permissions/RestrictionStore.php b/includes/Permissions/RestrictionStore.php
index 8f5c0d8cf7d2..789781d60fdb 100644
--- a/includes/Permissions/RestrictionStore.php
+++ b/includes/Permissions/RestrictionStore.php
@@ -2,11 +2,11 @@
namespace MediaWiki\Permissions;
-use CommentStore;
use DBAccessObjectUtils;
use IDBAccessObject;
use LinkCache;
use MediaWiki\Cache\CacheKeyHelper;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\HookContainer\HookRunner;
diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php
index ba94125a3033..dc709003c86d 100644
--- a/includes/ProtectionForm.php
+++ b/includes/ProtectionForm.php
@@ -23,6 +23,7 @@
* @file
*/
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\HookContainer\HookRunner;
use MediaWiki\MediaWikiServices;
use MediaWiki\Permissions\Authority;
diff --git a/includes/ResourceLoader/ResourceLoader.php b/includes/ResourceLoader/ResourceLoader.php
index 9b937eedf69b..442b9d8d58c9 100644
--- a/includes/ResourceLoader/ResourceLoader.php
+++ b/includes/ResourceLoader/ResourceLoader.php
@@ -23,7 +23,6 @@
namespace MediaWiki\ResourceLoader;
use BagOStuff;
-use CommentStore;
use Config;
use DeferredUpdates;
use Exception;
@@ -34,6 +33,7 @@ use Html;
use HttpStatus;
use InvalidArgumentException;
use Less_Parser;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
diff --git a/includes/Revision/MutableRevisionRecord.php b/includes/Revision/MutableRevisionRecord.php
index 1bd448b0870c..ed73692d7246 100644
--- a/includes/Revision/MutableRevisionRecord.php
+++ b/includes/Revision/MutableRevisionRecord.php
@@ -22,9 +22,9 @@
namespace MediaWiki\Revision;
-use CommentStoreComment;
use Content;
use InvalidArgumentException;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Page\PageIdentity;
use MediaWiki\Storage\RevisionSlotsUpdate;
use MediaWiki\User\UserIdentity;
diff --git a/includes/Revision/RevisionArchiveRecord.php b/includes/Revision/RevisionArchiveRecord.php
index 4233cdd931c2..7ed1378c6ed7 100644
--- a/includes/Revision/RevisionArchiveRecord.php
+++ b/includes/Revision/RevisionArchiveRecord.php
@@ -22,7 +22,7 @@
namespace MediaWiki\Revision;
-use CommentStoreComment;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Page\PageIdentity;
use MediaWiki\Permissions\Authority;
use MediaWiki\User\UserIdentity;
diff --git a/includes/Revision/RevisionRecord.php b/includes/Revision/RevisionRecord.php
index f089f772ce09..074d6becc5d7 100644
--- a/includes/Revision/RevisionRecord.php
+++ b/includes/Revision/RevisionRecord.php
@@ -22,9 +22,9 @@
namespace MediaWiki\Revision;
-use CommentStoreComment;
use Content;
use InvalidArgumentException;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\DAO\WikiAwareEntity;
use MediaWiki\DAO\WikiAwareEntityTrait;
use MediaWiki\Linker\LinkTarget;
diff --git a/includes/Revision/RevisionStore.php b/includes/Revision/RevisionStore.php
index 8f1871aca04f..da06a22475b9 100644
--- a/includes/Revision/RevisionStore.php
+++ b/includes/Revision/RevisionStore.php
@@ -26,14 +26,14 @@
namespace MediaWiki\Revision;
use BagOStuff;
-use CommentStore;
-use CommentStoreComment;
use Content;
use DBAccessObjectUtils;
use FallbackContent;
use IDBAccessObject;
use InvalidArgumentException;
use LogicException;
+use MediaWiki\CommentStore\CommentStore;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Content\IContentHandlerFactory;
use MediaWiki\DAO\WikiAwareEntity;
use MediaWiki\HookContainer\HookContainer;
diff --git a/includes/Revision/RevisionStoreCacheRecord.php b/includes/Revision/RevisionStoreCacheRecord.php
index 246e25e7a0a6..e0bb2456ad06 100644
--- a/includes/Revision/RevisionStoreCacheRecord.php
+++ b/includes/Revision/RevisionStoreCacheRecord.php
@@ -22,7 +22,7 @@
namespace MediaWiki\Revision;
-use CommentStoreComment;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Page\PageIdentity;
use MediaWiki\Permissions\Authority;
use MediaWiki\User\UserIdentity;
diff --git a/includes/Revision/RevisionStoreFactory.php b/includes/Revision/RevisionStoreFactory.php
index dcffeb37ee75..9ec96b43fbb3 100644
--- a/includes/Revision/RevisionStoreFactory.php
+++ b/includes/Revision/RevisionStoreFactory.php
@@ -27,7 +27,7 @@
namespace MediaWiki\Revision;
use BagOStuff;
-use CommentStore;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Content\IContentHandlerFactory;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\Page\PageStoreFactory;
diff --git a/includes/Revision/RevisionStoreRecord.php b/includes/Revision/RevisionStoreRecord.php
index 1d088c032e6c..e273bf1907ef 100644
--- a/includes/Revision/RevisionStoreRecord.php
+++ b/includes/Revision/RevisionStoreRecord.php
@@ -22,8 +22,8 @@
namespace MediaWiki\Revision;
-use CommentStoreComment;
use InvalidArgumentException;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Page\PageIdentity;
use MediaWiki\Permissions\Authority;
use MediaWiki\User\UserIdentity;
diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php
index c94bd856e9e0..b56f1d1cfb40 100644
--- a/includes/ServiceWiring.php
+++ b/includes/ServiceWiring.php
@@ -63,6 +63,7 @@ use MediaWiki\Collation\CollationFactory;
use MediaWiki\CommentFormatter\CommentFormatter;
use MediaWiki\CommentFormatter\CommentParserFactory;
use MediaWiki\CommentFormatter\RowCommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Config\ConfigRepository;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\Content\ContentHandlerFactory;
diff --git a/includes/Storage/Hook/BeforeRevertedTagUpdateHook.php b/includes/Storage/Hook/BeforeRevertedTagUpdateHook.php
index a499f83d7dcb..fcbde174f5d3 100644
--- a/includes/Storage/Hook/BeforeRevertedTagUpdateHook.php
+++ b/includes/Storage/Hook/BeforeRevertedTagUpdateHook.php
@@ -2,7 +2,7 @@
namespace MediaWiki\Storage\Hook;
-use CommentStoreComment;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Storage\EditResult;
use MediaWiki\User\UserIdentity;
diff --git a/includes/Storage/Hook/MultiContentSaveHook.php b/includes/Storage/Hook/MultiContentSaveHook.php
index e3b002851486..f6f80aad58a7 100644
--- a/includes/Storage/Hook/MultiContentSaveHook.php
+++ b/includes/Storage/Hook/MultiContentSaveHook.php
@@ -2,7 +2,7 @@
namespace MediaWiki\Storage\Hook;
-use CommentStoreComment;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Revision\RenderedRevision;
use MediaWiki\User\UserIdentity;
use Status;
diff --git a/includes/Storage/Hook/PageContentSaveHook.php b/includes/Storage/Hook/PageContentSaveHook.php
index d5e0593977d9..15632bab1716 100644
--- a/includes/Storage/Hook/PageContentSaveHook.php
+++ b/includes/Storage/Hook/PageContentSaveHook.php
@@ -2,8 +2,8 @@
namespace MediaWiki\Storage\Hook;
-use CommentStoreComment;
use Content;
+use MediaWiki\CommentStore\CommentStoreComment;
use StatusValue;
use User;
use WikiPage;
diff --git a/includes/Storage/PageUpdater.php b/includes/Storage/PageUpdater.php
index 68795eb915e3..05c978217281 100644
--- a/includes/Storage/PageUpdater.php
+++ b/includes/Storage/PageUpdater.php
@@ -22,13 +22,13 @@ namespace MediaWiki\Storage;
use AtomicSectionUpdate;
use ChangeTags;
-use CommentStoreComment;
use Content;
use ContentHandler;
use DeferredUpdates;
use InvalidArgumentException;
use LogicException;
use ManualLogEntry;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\Content\IContentHandlerFactory;
use MediaWiki\Content\ValidationParams;
diff --git a/includes/actions/DeleteAction.php b/includes/actions/DeleteAction.php
index 2dd577b94e28..49105de65d1f 100644
--- a/includes/actions/DeleteAction.php
+++ b/includes/actions/DeleteAction.php
@@ -19,6 +19,7 @@
*/
use MediaWiki\Cache\BacklinkCacheFactory;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
diff --git a/includes/actions/McrUndoAction.php b/includes/actions/McrUndoAction.php
index 7c6802a3b672..ed912ca7bedc 100644
--- a/includes/actions/McrUndoAction.php
+++ b/includes/actions/McrUndoAction.php
@@ -6,6 +6,8 @@
*/
use MediaWiki\CommentFormatter\CommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Linker\Linker;
use MediaWiki\MainConfigNames;
use MediaWiki\Permissions\PermissionStatus;
diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php
index c17f42dce978..98a09f81f4c8 100644
--- a/includes/api/ApiQueryBlocks.php
+++ b/includes/api/ApiQueryBlocks.php
@@ -23,6 +23,7 @@
use MediaWiki\Block\BlockActionInfo;
use MediaWiki\Block\BlockRestrictionStore;
use MediaWiki\Block\Restriction\PageRestriction;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MainConfigNames;
use MediaWiki\ParamValidator\TypeDef\UserDef;
use Wikimedia\IPUtils;
diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php
index 95cf3d6d82c3..9be6f8458641 100644
--- a/includes/api/ApiQueryDeletedrevs.php
+++ b/includes/api/ApiQueryDeletedrevs.php
@@ -22,6 +22,7 @@
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\CommentFormatter\RowCommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\ParamValidator\TypeDef\UserDef;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Revision\RevisionStore;
diff --git a/includes/api/ApiQueryFilearchive.php b/includes/api/ApiQueryFilearchive.php
index 3e2004292733..16143b4d0272 100644
--- a/includes/api/ApiQueryFilearchive.php
+++ b/includes/api/ApiQueryFilearchive.php
@@ -26,6 +26,7 @@
use MediaWiki\CommentFormatter\CommentFormatter;
use MediaWiki\CommentFormatter\CommentItem;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Revision\RevisionRecord;
use Wikimedia\ParamValidator\ParamValidator;
use Wikimedia\ParamValidator\TypeDef\IntegerDef;
diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php
index 756d01daa1fa..f3efc0a0abaf 100644
--- a/includes/api/ApiQueryLogEvents.php
+++ b/includes/api/ApiQueryLogEvents.php
@@ -22,6 +22,7 @@
use MediaWiki\CommentFormatter\CommentFormatter;
use MediaWiki\CommentFormatter\RowCommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MainConfigNames;
use MediaWiki\ParamValidator\TypeDef\NamespaceDef;
use MediaWiki\ParamValidator\TypeDef\UserDef;
diff --git a/includes/api/ApiQueryProtectedTitles.php b/includes/api/ApiQueryProtectedTitles.php
index c08d332736e5..89be6a6c5700 100644
--- a/includes/api/ApiQueryProtectedTitles.php
+++ b/includes/api/ApiQueryProtectedTitles.php
@@ -21,6 +21,7 @@
*/
use MediaWiki\CommentFormatter\RowCommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MainConfigNames;
use Wikimedia\ParamValidator\ParamValidator;
use Wikimedia\ParamValidator\TypeDef\IntegerDef;
diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php
index db613848eac4..74a8682cb771 100644
--- a/includes/api/ApiQueryRecentChanges.php
+++ b/includes/api/ApiQueryRecentChanges.php
@@ -21,6 +21,7 @@
*/
use MediaWiki\CommentFormatter\RowCommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MainConfigNames;
use MediaWiki\ParamValidator\TypeDef\NamespaceDef;
use MediaWiki\ParamValidator\TypeDef\UserDef;
diff --git a/includes/api/ApiQueryUserContribs.php b/includes/api/ApiQueryUserContribs.php
index ce341f548eae..5e25b6019b5b 100644
--- a/includes/api/ApiQueryUserContribs.php
+++ b/includes/api/ApiQueryUserContribs.php
@@ -21,6 +21,7 @@
*/
use MediaWiki\CommentFormatter\CommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MainConfigNames;
use MediaWiki\ParamValidator\TypeDef\UserDef;
use MediaWiki\Revision\RevisionRecord;
diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php
index 52edf47aeff3..0e6ebfc575f8 100644
--- a/includes/api/ApiQueryWatchlist.php
+++ b/includes/api/ApiQueryWatchlist.php
@@ -21,6 +21,7 @@
*/
use MediaWiki\CommentFormatter\CommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Linker\LinkTarget;
use MediaWiki\ParamValidator\TypeDef\UserDef;
use MediaWiki\Revision\RevisionRecord;
diff --git a/includes/block/AbstractBlock.php b/includes/block/AbstractBlock.php
index 1ac2347f1092..1f86a1f38f44 100644
--- a/includes/block/AbstractBlock.php
+++ b/includes/block/AbstractBlock.php
@@ -20,10 +20,10 @@
namespace MediaWiki\Block;
-use CommentStoreComment;
use DeprecationHelper;
use IContextSource;
use InvalidArgumentException;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\DAO\WikiAwareEntityTrait;
use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
diff --git a/includes/block/Block.php b/includes/block/Block.php
index 83e26695d69b..90abc8f6501c 100644
--- a/includes/block/Block.php
+++ b/includes/block/Block.php
@@ -21,7 +21,7 @@
namespace MediaWiki\Block;
-use CommentStoreComment;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\DAO\WikiAwareEntity;
use MediaWiki\User\UserIdentity;
diff --git a/includes/block/BlockErrorFormatter.php b/includes/block/BlockErrorFormatter.php
index 1e3221bd3d68..191d1464d3e2 100644
--- a/includes/block/BlockErrorFormatter.php
+++ b/includes/block/BlockErrorFormatter.php
@@ -20,8 +20,8 @@
namespace MediaWiki\Block;
-use CommentStoreComment;
use Language;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\HookContainer\HookRunner;
use MediaWiki\Page\PageReferenceValue;
diff --git a/includes/block/DatabaseBlock.php b/includes/block/DatabaseBlock.php
index a6d73bf3a7ac..800b4e78b629 100644
--- a/includes/block/DatabaseBlock.php
+++ b/includes/block/DatabaseBlock.php
@@ -22,7 +22,6 @@
namespace MediaWiki\Block;
-use CommentStore;
use Hooks;
use Html;
use InvalidArgumentException;
@@ -30,6 +29,7 @@ use MediaWiki\Block\Restriction\ActionRestriction;
use MediaWiki\Block\Restriction\NamespaceRestriction;
use MediaWiki\Block\Restriction\PageRestriction;
use MediaWiki\Block\Restriction\Restriction;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
use MediaWiki\User\UserIdentity;
diff --git a/includes/block/DatabaseBlockStore.php b/includes/block/DatabaseBlockStore.php
index 5740ec00bb39..a80396fd96c7 100644
--- a/includes/block/DatabaseBlockStore.php
+++ b/includes/block/DatabaseBlockStore.php
@@ -23,9 +23,9 @@
namespace MediaWiki\Block;
use AutoCommitUpdate;
-use CommentStore;
use DeferredUpdates;
use InvalidArgumentException;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\HookContainer\HookRunner;
diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php
index 0cf335ff01ef..bba141a2eda7 100644
--- a/includes/changes/RecentChange.php
+++ b/includes/changes/RecentChange.php
@@ -21,6 +21,7 @@
*/
use MediaWiki\ChangeTags\Taggable;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
use MediaWiki\Page\PageIdentity;
diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php
index 94e6c5585db6..4840fd92bbc6 100644
--- a/includes/content/ContentHandler.php
+++ b/includes/content/ContentHandler.php
@@ -26,6 +26,7 @@
* @author Daniel Kinzler
*/
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Content\Renderer\ContentParseParams;
use MediaWiki\Content\Transform\PreloadTransformParams;
use MediaWiki\Content\Transform\PreSaveTransformParams;
diff --git a/includes/export/WikiExporter.php b/includes/export/WikiExporter.php
index 6a3282400860..fe3d6c55b8c7 100644
--- a/includes/export/WikiExporter.php
+++ b/includes/export/WikiExporter.php
@@ -27,6 +27,7 @@
* @defgroup Dump Dump
*/
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\HookContainer\HookRunner;
use MediaWiki\MainConfigNames;
diff --git a/includes/export/XmlDumpWriter.php b/includes/export/XmlDumpWriter.php
index d280ef98402f..0bd51d9e9917 100644
--- a/includes/export/XmlDumpWriter.php
+++ b/includes/export/XmlDumpWriter.php
@@ -23,6 +23,7 @@
* @file
*/
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\HookContainer\HookRunner;
use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php
index 44a03fb20989..a022f12fb83c 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -18,6 +18,7 @@
* @file
*/
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Deferred\LinksUpdate\LinksUpdate;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MainConfigNames;
diff --git a/includes/import/ImportableOldRevisionImporter.php b/includes/import/ImportableOldRevisionImporter.php
index 66cb64e4c2d4..09eba1483bc1 100644
--- a/includes/import/ImportableOldRevisionImporter.php
+++ b/includes/import/ImportableOldRevisionImporter.php
@@ -1,5 +1,6 @@
<?php
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\MediaWikiServices;
use MediaWiki\Page\WikiPageFactory;
use MediaWiki\Revision\MutableRevisionRecord;
diff --git a/includes/import/WikiRevision.php b/includes/import/WikiRevision.php
index 5d1a6abc3be6..d93e9e42964e 100644
--- a/includes/import/WikiRevision.php
+++ b/includes/import/WikiRevision.php
@@ -23,6 +23,8 @@
* @file
* @ingroup SpecialPage
*/
+
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\MutableRevisionSlots;
use MediaWiki\Revision\SlotRecord;
diff --git a/includes/logging/DatabaseLogEntry.php b/includes/logging/DatabaseLogEntry.php
index 8fad2d1d0c86..8127a4405528 100644
--- a/includes/logging/DatabaseLogEntry.php
+++ b/includes/logging/DatabaseLogEntry.php
@@ -23,6 +23,7 @@
* @since 1.19
*/
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
use MediaWiki\User\UserIdentity;
diff --git a/includes/logging/ManualLogEntry.php b/includes/logging/ManualLogEntry.php
index c7838d3af366..95555aefd58f 100644
--- a/includes/logging/ManualLogEntry.php
+++ b/includes/logging/ManualLogEntry.php
@@ -24,6 +24,7 @@
*/
use MediaWiki\ChangeTags\Taggable;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Linker\LinkTarget;
use MediaWiki\MediaWikiServices;
use MediaWiki\Page\PageReference;
diff --git a/includes/logging/RCDatabaseLogEntry.php b/includes/logging/RCDatabaseLogEntry.php
index 77823dc46762..62953325e60c 100644
--- a/includes/logging/RCDatabaseLogEntry.php
+++ b/includes/logging/RCDatabaseLogEntry.php
@@ -23,6 +23,7 @@
* @since 1.19
*/
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
use MediaWiki\User\UserIdentity;
diff --git a/includes/page/DeletePage.php b/includes/page/DeletePage.php
index 457ae314a5d4..d09e9707e18c 100644
--- a/includes/page/DeletePage.php
+++ b/includes/page/DeletePage.php
@@ -5,7 +5,6 @@ namespace MediaWiki\Page;
use BadMethodCallException;
use BagOStuff;
use ChangeTags;
-use CommentStore;
use Content;
use DeferrableUpdate;
use DeferredUpdates;
@@ -15,6 +14,7 @@ use JobQueueGroup;
use LogicException;
use ManualLogEntry;
use MediaWiki\Cache\BacklinkCacheFactory;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate;
use MediaWiki\Deferred\LinksUpdate\LinksUpdate;
diff --git a/includes/page/PageCommandFactory.php b/includes/page/PageCommandFactory.php
index 765dc3d14684..30eb45fe4f6a 100644
--- a/includes/page/PageCommandFactory.php
+++ b/includes/page/PageCommandFactory.php
@@ -22,12 +22,12 @@
namespace MediaWiki\Page;
use BagOStuff;
-use CommentStore;
use Config;
use ContentModelChange;
use JobQueueGroup;
use MediaWiki\Cache\BacklinkCacheFactory;
use MediaWiki\Collation\CollationFactory;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\Content\IContentHandlerFactory;
use MediaWiki\EditPage\SpamChecker;
diff --git a/includes/page/RollbackPage.php b/includes/page/RollbackPage.php
index 0ef8e2db7032..94fa04f518c5 100644
--- a/includes/page/RollbackPage.php
+++ b/includes/page/RollbackPage.php
@@ -20,8 +20,8 @@
namespace MediaWiki\Page;
-use CommentStoreComment;
use ManualLogEntry;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\HookContainer\HookRunner;
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index de0a8810436b..e337495ae7f8 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -18,6 +18,8 @@
* @file
*/
+use MediaWiki\CommentStore\CommentStore;
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\DAO\WikiAwareEntityTrait;
use MediaWiki\Edit\PreparedEdit;
use MediaWiki\HookContainer\ProtectedHookAccessorTrait;
diff --git a/includes/revisiondelete/RevDelLogItem.php b/includes/revisiondelete/RevDelLogItem.php
index 0d4ffc3092bb..9a5defcdd823 100644
--- a/includes/revisiondelete/RevDelLogItem.php
+++ b/includes/revisiondelete/RevDelLogItem.php
@@ -19,6 +19,7 @@
* @ingroup RevisionDelete
*/
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\RevisionRecord;
diff --git a/includes/revisiondelete/RevDelLogList.php b/includes/revisiondelete/RevDelLogList.php
index 5c51d9ede854..ebe7ca786783 100644
--- a/includes/revisiondelete/RevDelLogList.php
+++ b/includes/revisiondelete/RevDelLogList.php
@@ -19,6 +19,7 @@
* @ingroup RevisionDelete
*/
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Page\PageIdentity;
use MediaWiki\Revision\RevisionRecord;
use Wikimedia\Rdbms\IDatabase;
diff --git a/includes/specials/SpecialAutoblockList.php b/includes/specials/SpecialAutoblockList.php
index 336b860b2249..8d66a02366a9 100644
--- a/includes/specials/SpecialAutoblockList.php
+++ b/includes/specials/SpecialAutoblockList.php
@@ -26,6 +26,7 @@ use MediaWiki\Block\BlockRestrictionStore;
use MediaWiki\Block\BlockUtils;
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\CommentFormatter\RowCommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use Wikimedia\Rdbms\ILoadBalancer;
/**
diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php
index 6404da79614b..081338c382c1 100644
--- a/includes/specials/SpecialBlock.php
+++ b/includes/specials/SpecialBlock.php
@@ -30,6 +30,7 @@ use MediaWiki\Block\DatabaseBlock;
use MediaWiki\Block\Restriction\ActionRestriction;
use MediaWiki\Block\Restriction\NamespaceRestriction;
use MediaWiki\Block\Restriction\PageRestriction;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
use MediaWiki\Page\PageReference;
diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php
index d4ab47f9aa7f..9fd7937bd635 100644
--- a/includes/specials/SpecialBlockList.php
+++ b/includes/specials/SpecialBlockList.php
@@ -27,6 +27,7 @@ use MediaWiki\Block\BlockUtils;
use MediaWiki\Block\DatabaseBlock;
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\CommentFormatter\RowCommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use Wikimedia\IPUtils;
use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\ILoadBalancer;
diff --git a/includes/specials/SpecialChangeContentModel.php b/includes/specials/SpecialChangeContentModel.php
index 77f32f801e52..4981e184b411 100644
--- a/includes/specials/SpecialChangeContentModel.php
+++ b/includes/specials/SpecialChangeContentModel.php
@@ -1,5 +1,6 @@
<?php
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Content\IContentHandlerFactory;
use MediaWiki\EditPage\SpamChecker;
use MediaWiki\Language\RawMessage;
diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php
index 8a0b6bd88085..ac362fa3d2a9 100644
--- a/includes/specials/SpecialDeletedContributions.php
+++ b/includes/specials/SpecialDeletedContributions.php
@@ -23,6 +23,7 @@
use MediaWiki\Block\DatabaseBlock;
use MediaWiki\CommentFormatter\CommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MainConfigNames;
use MediaWiki\Permissions\PermissionManager;
use MediaWiki\Revision\RevisionFactory;
diff --git a/includes/specials/SpecialEditTags.php b/includes/specials/SpecialEditTags.php
index 692cc8825ded..61955fa3977e 100644
--- a/includes/specials/SpecialEditTags.php
+++ b/includes/specials/SpecialEditTags.php
@@ -19,6 +19,7 @@
* @ingroup SpecialPage
*/
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Permissions\PermissionManager;
/**
diff --git a/includes/specials/SpecialListFiles.php b/includes/specials/SpecialListFiles.php
index 0191490596b4..d33b5752a001 100644
--- a/includes/specials/SpecialListFiles.php
+++ b/includes/specials/SpecialListFiles.php
@@ -22,6 +22,7 @@
*/
use MediaWiki\CommentFormatter\CommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\User\UserNamePrefixSearch;
use MediaWiki\User\UserNameUtils;
use MediaWiki\User\UserRigorOptions;
diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php
index 4063541e5a38..b02d8e06b83b 100644
--- a/includes/specials/SpecialMovepage.php
+++ b/includes/specials/SpecialMovepage.php
@@ -22,6 +22,7 @@
*/
use MediaWiki\Cache\LinkBatchFactory;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Content\IContentHandlerFactory;
use MediaWiki\MainConfigNames;
use MediaWiki\Page\MovePageFactory;
diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php
index 9a28566580e5..fb195c1a6023 100644
--- a/includes/specials/SpecialNewpages.php
+++ b/includes/specials/SpecialNewpages.php
@@ -23,6 +23,7 @@
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\CommentFormatter\CommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Content\IContentHandlerFactory;
use MediaWiki\Feed\FeedItem;
use MediaWiki\Linker\Linker;
diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php
index e83723be20f6..6fded4cdcb6e 100644
--- a/includes/specials/SpecialProtectedpages.php
+++ b/includes/specials/SpecialProtectedpages.php
@@ -23,6 +23,7 @@
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\CommentFormatter\RowCommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MainConfigNames;
use MediaWiki\Permissions\RestrictionStore;
use Wikimedia\Rdbms\ILoadBalancer;
diff --git a/includes/specials/SpecialRevisionDelete.php b/includes/specials/SpecialRevisionDelete.php
index bf0e99c5984b..23042aaeed28 100644
--- a/includes/specials/SpecialRevisionDelete.php
+++ b/includes/specials/SpecialRevisionDelete.php
@@ -21,6 +21,7 @@
* @ingroup SpecialPage
*/
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Permissions\PermissionManager;
use MediaWiki\Revision\RevisionRecord;
diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php
index e436d20d9af7..58546aadfeb5 100644
--- a/includes/specials/SpecialTags.php
+++ b/includes/specials/SpecialTags.php
@@ -21,6 +21,7 @@
* @ingroup SpecialPage
*/
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MainConfigNames;
/**
diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php
index c37c00144293..ae0b5f07b079 100644
--- a/includes/specials/SpecialUndelete.php
+++ b/includes/specials/SpecialUndelete.php
@@ -23,6 +23,7 @@
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\CommentFormatter\CommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Content\IContentHandlerFactory;
use MediaWiki\Linker\Linker;
use MediaWiki\MainConfigNames;
diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php
index 685529297213..63692af5ca5f 100644
--- a/includes/specials/SpecialUserrights.php
+++ b/includes/specials/SpecialUserrights.php
@@ -21,6 +21,7 @@
* @ingroup SpecialPage
*/
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Linker\Linker;
use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
diff --git a/includes/specials/helpers/ImportReporter.php b/includes/specials/helpers/ImportReporter.php
index 30a5a6b9e440..156eeeea70fb 100644
--- a/includes/specials/helpers/ImportReporter.php
+++ b/includes/specials/helpers/ImportReporter.php
@@ -18,6 +18,7 @@
* @file
*/
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\HookContainer\ProtectedHookAccessorTrait;
use MediaWiki\MediaWikiServices;
use MediaWiki\Page\PageIdentity;
diff --git a/includes/specials/pagers/BlockListPager.php b/includes/specials/pagers/BlockListPager.php
index 0db04fba2d2b..9bb4f6fd46d3 100644
--- a/includes/specials/pagers/BlockListPager.php
+++ b/includes/specials/pagers/BlockListPager.php
@@ -28,6 +28,7 @@ use MediaWiki\Block\Restriction\PageRestriction;
use MediaWiki\Block\Restriction\Restriction;
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\CommentFormatter\RowCommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Linker\Linker;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\MainConfigNames;
diff --git a/includes/specials/pagers/DeletedContribsPager.php b/includes/specials/pagers/DeletedContribsPager.php
index 5b05142ee329..b86fb5b0c565 100644
--- a/includes/specials/pagers/DeletedContribsPager.php
+++ b/includes/specials/pagers/DeletedContribsPager.php
@@ -20,6 +20,7 @@
*/
use MediaWiki\CommentFormatter\CommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\HookContainer\HookRunner;
use MediaWiki\Linker\Linker;
diff --git a/includes/specials/pagers/ImageListPager.php b/includes/specials/pagers/ImageListPager.php
index 44d9481f224f..ef0803114459 100644
--- a/includes/specials/pagers/ImageListPager.php
+++ b/includes/specials/pagers/ImageListPager.php
@@ -20,6 +20,7 @@
*/
use MediaWiki\CommentFormatter\CommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\MainConfigNames;
use MediaWiki\User\UserNameUtils;
diff --git a/includes/specials/pagers/ProtectedPagesPager.php b/includes/specials/pagers/ProtectedPagesPager.php
index cf9d51b36d8f..8da48246554d 100644
--- a/includes/specials/pagers/ProtectedPagesPager.php
+++ b/includes/specials/pagers/ProtectedPagesPager.php
@@ -21,6 +21,7 @@
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\CommentFormatter\RowCommentFormatter;
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\Linker\Linker;
use MediaWiki\Linker\LinkRenderer;
use Wikimedia\Rdbms\ILoadBalancer;
diff --git a/includes/watcheditem/WatchedItemQueryService.php b/includes/watcheditem/WatchedItemQueryService.php
index c4a8912fc69a..9c6ba1ea2226 100644
--- a/includes/watcheditem/WatchedItemQueryService.php
+++ b/includes/watcheditem/WatchedItemQueryService.php
@@ -1,5 +1,6 @@
<?php
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\HookContainer\HookRunner;
use MediaWiki\Linker\LinkTarget;
diff --git a/maintenance/edit.php b/maintenance/edit.php
index 6e30bbabdf83..8a7fd85c8f76 100644
--- a/maintenance/edit.php
+++ b/maintenance/edit.php
@@ -21,6 +21,7 @@
* @ingroup Maintenance
*/
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Language\RawMessage;
use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\SlotRecord;
diff --git a/maintenance/populateArchiveRevId.php b/maintenance/populateArchiveRevId.php
index 62d922589819..b79ac0a792de 100644
--- a/maintenance/populateArchiveRevId.php
+++ b/maintenance/populateArchiveRevId.php
@@ -21,6 +21,7 @@
* @ingroup Maintenance
*/
+use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\SlotRecord;
use Wikimedia\Rdbms\DBQueryError;
diff --git a/maintenance/rebuildrecentchanges.php b/maintenance/rebuildrecentchanges.php
index 9cf0bf5b0c3f..ed9a23ea9fcb 100644
--- a/maintenance/rebuildrecentchanges.php
+++ b/maintenance/rebuildrecentchanges.php
@@ -25,6 +25,7 @@
require_once __DIR__ . '/Maintenance.php';
+use MediaWiki\CommentStore\CommentStore;
use MediaWiki\MediaWikiServices;
use MediaWiki\User\ActorMigration;
use Wikimedia\Rdbms\IDatabase;
diff --git a/tests/phpunit/includes/CommentStoreTest.php b/tests/phpunit/includes/CommentStoreTest.php
index 54ddb797ca5f..54bab1edc1f4 100644
--- a/tests/phpunit/includes/CommentStoreTest.php
+++ b/tests/phpunit/includes/CommentStoreTest.php
@@ -1,5 +1,7 @@
<?php
+use MediaWiki\CommentStore\CommentStore;
+use MediaWiki\CommentStore\CommentStoreBase;
use MediaWiki\Language\RawMessage;
use Wikimedia\Rdbms\IMaintainableDatabase;
@@ -41,7 +43,7 @@ class CommentStoreTest extends MediaWikiLangTestCase {
$lang->method( 'truncateForVisual' )->willReturnCallback( static function ( $str, $len ) {
return mb_strlen( $str ) > $len ? mb_substr( $str, 0, $len - 3 ) . '...' : $str;
} );
- return new class( $lang, $stage ) extends CommentStore {
+ return new class( $lang, $stage ) extends CommentStoreBase {
protected const TEMP_TABLES = [
'rev_comment' => [
'table' => 'revision_comment_temp',
@@ -60,6 +62,10 @@ class CommentStoreTest extends MediaWikiLangTestCase {
'deprecatedIn' => null,
],
];
+
+ public function __construct( $lang, $stage ) {
+ parent::__construct( self::TEMP_TABLES, $lang, $stage );
+ }
};
}
@@ -806,16 +812,24 @@ class CommentStoreTest extends MediaWikiLangTestCase {
*/
public function testInsertWithTempTableDeprecated( $stage ) {
$lang = $this->getServiceContainer()->getContentLanguage();
- $store = new class( $lang, $stage ) extends CommentStore {
- protected const TEMP_TABLES = [
- 'ipb_reason' => [
- 'stage' => MIGRATION_NEW,
- 'deprecatedIn' => '1.30',
- ],
- ];
+ $store = new class( $lang, $stage ) extends CommentStoreBase {
+ public function __construct( $lang, $stage ) {
+ parent::__construct(
+ [
+ 'ipb_reason' => [
+ 'stage' => MIGRATION_NEW,
+ 'deprecatedIn' => '1.30',
+ ],
+ ],
+ $lang,
+ $stage
+ );
+ }
};
- $this->hideDeprecated( 'CommentStore::insertWithTempTable for ipb_reason' );
+ $this->hideDeprecated(
+ 'MediaWiki\\CommentStore\\CommentStoreBase::insertWithTempTable for ipb_reason'
+ );
[ $fields, $callback ] = $store->insertWithTempTable( $this->db, 'ipb_reason', 'foo' );
$this->assertIsCallable( $callback );
}