MediaWiki  master
MediaWiki\CommentStore\CommentStore Class Reference

Handle database storage of comments such as edit summaries and log reasons. More...

Inheritance diagram for MediaWiki\CommentStore\CommentStore:
Collaboration diagram for MediaWiki\CommentStore\CommentStore:

Public Member Functions

 __construct (Language $lang, $stage, $tempTableStageOverrides)
 
- Public Member Functions inherited from MediaWiki\CommentStore\CommentStoreBase
 __construct ( $tempTables, Language $lang, $stage)
 
 createComment (IDatabase $dbw, $comment, array $data=null)
 Create a new CommentStoreComment, inserting it into the database if necessary. More...
 
 getComment ( $key, $row=null, $fallback=false)
 Extract the comment from a row. More...
 
 getCommentLegacy (IDatabase $db, $key, $row=null, $fallback=false)
 Extract the comment from a row, with legacy lookups. More...
 
 getFields ( $key)
 Get SELECT fields for the comment key. More...
 
 getJoin ( $key)
 Get SELECT fields and joins for the comment key. More...
 
 getTempTableMigrationStage (string $key)
 
 insert (IDatabase $dbw, $key, $comment=null, $data=null)
 Insert a comment in preparation for a row that references it. More...
 
 insertWithTempTable (IDatabase $dbw, $key, $comment=null, $data=null)
 Insert a comment in a temporary table in preparation for a row that references it. More...
 

Static Public Member Functions

static getStore ()
 
- Static Public Member Functions inherited from MediaWiki\CommentStore\CommentStoreBase
static hash ( $text, $data)
 Hashing function for comment storage. More...
 

Protected Attributes

const TEMP_TABLES
 Define fields that use temporary tables for transitional purposes Array keys are field names, values are arrays with these possible fields: More...
 
- Protected Attributes inherited from MediaWiki\CommentStore\CommentStoreBase
 $tempTables
 Define fields that use temporary tables for transitional purposes Array keys are field names, values are arrays with these possible fields: More...
 

Additional Inherited Members

- Public Attributes inherited from MediaWiki\CommentStore\CommentStoreBase
const COMMENT_CHARACTER_LIMIT = 500
 Maximum length of a comment in UTF-8 characters. More...
 
const MAX_DATA_LENGTH = 65535
 Maximum length of serialized data in bytes. More...
 

Detailed Description

Handle database storage of comments such as edit summaries and log reasons.

Since
1.30

Definition at line 44 of file CommentStore.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\CommentStore\CommentStore::__construct ( Language  $lang,
  $stage,
  $tempTableStageOverrides 
)
Parameters
Language$langLanguage to use for comment truncation. Defaults to content language.
int$stageOne of the MIGRATION_* constants, or an appropriate combination of SCHEMA_COMPAT_* constants. Always MIGRATION_NEW for MediaWiki core since 1.33.
array$tempTableStageOverrides

Definition at line 74 of file CommentStore.php.

References $lang.

Member Function Documentation

◆ getStore()

static MediaWiki\CommentStore\CommentStore::getStore ( )
static
Since
1.31
Deprecated:
in 1.31 Use DI to inject a CommentStore instance into your class. Hard-deprecated since 1.40.
Returns
CommentStore

Definition at line 87 of file CommentStore.php.

References MediaWiki\MediaWikiServices\getInstance(), and wfDeprecated().

Member Data Documentation

◆ TEMP_TABLES

const MediaWiki\CommentStore\CommentStore::TEMP_TABLES
protected
Initial value:
= [
'rev_comment' => [
'table' => 'revision_comment_temp',
'pk' => 'revcomment_rev',
'field' => 'revcomment_comment_id',
'joinPK' => 'rev_id',
'stage' => MIGRATION_OLD,
'deprecatedIn' => null,
],
]
const MIGRATION_OLD
Definition: Defines.php:303

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

Definition at line 55 of file CommentStore.php.


The documentation for this class was generated from the following file: