MediaWiki
1.33.0
|
This class handles the logic for the actor table migration. More...
Public Member Functions | |
__construct ( $stage) | |
getInsertValues (IDatabase $dbw, $key, UserIdentity $user) | |
Get UPDATE fields for the actor. More... | |
getInsertValuesWithTempTable (IDatabase $dbw, $key, UserIdentity $user) | |
Get UPDATE fields for the actor. More... | |
getJoin ( $key) | |
Get SELECT fields and joins for the actor key. More... | |
getWhere (IDatabase $db, $key, $users, $useId=true) | |
Get WHERE condition for the actor. More... | |
isAnon ( $field) | |
Return an SQL condition to test if a user field is anonymous. More... | |
isNotAnon ( $field) | |
Return an SQL condition to test if a user field is non-anonymous. More... | |
Static Public Member Functions | |
static | newMigration () |
Static constructor. More... | |
Public Attributes | |
const | MIGRATION_STAGE_SCHEMA_COMPAT = 1 |
Constant for extensions to feature-test whether $wgActorTableSchemaMigrationStage expects MIGRATION_* or SCHEMA_COMPAT_*. More... | |
Static Private Member Functions | |
static | getFieldNames ( $key) |
Private Attributes | |
array null | $joinCache = null |
Cache for self::getJoin() More... | |
int | $stage |
Combination of SCHEMA_COMPAT_* constants. More... | |
Static Private Attributes | |
static array | $formerTempTables = [] |
Fields that formerly used $tempTables Key is '$key', value is the MediaWiki version in which it was removed from $tempTables. More... | |
static array | $specialFields |
Define fields that use non-standard mapping Keys are the user id column name, values are arrays with two elements (the user text column name and the actor id column name) More... | |
static array | $tempTables |
Define fields that use temporary tables for transitional purposes Keys are '$key', values are arrays with four fields: More... | |
This class handles the logic for the actor table migration.
This is not intended to be a long-term part of MediaWiki; it will be deprecated and removed along with $wgActorTableSchemaMigrationStage.
Definition at line 35 of file ActorMigration.php.
ActorMigration::__construct | ( | $stage | ) |
Definition at line 87 of file ActorMigration.php.
References $stage, SCHEMA_COMPAT_READ_BOTH, SCHEMA_COMPAT_READ_NEW, SCHEMA_COMPAT_READ_OLD, SCHEMA_COMPAT_WRITE_BOTH, SCHEMA_COMPAT_WRITE_NEW, and SCHEMA_COMPAT_WRITE_OLD.
|
staticprivate |
string | $key | A key such as "rev_user" identifying the actor field being fetched. |
Definition at line 138 of file ActorMigration.php.
Referenced by getInsertValues(), getInsertValuesWithTempTable(), getJoin(), and getWhere().
ActorMigration::getInsertValues | ( | IDatabase | $dbw, |
$key, | |||
UserIdentity | $user | ||
) |
Get UPDATE fields for the actor.
IDatabase | $dbw | Database to use for creating an actor ID, if necessary |
string | $key | A key such as "rev_user" identifying the actor field being fetched. |
UserIdentity | $user | User to set in the update |
$values
to IDatabase->update()
or $a
to IDatabase->insert()
Definition at line 204 of file ActorMigration.php.
References $ret, $user, getFieldNames(), list, User\newFromAnyId(), null, SCHEMA_COMPAT_WRITE_NEW, and SCHEMA_COMPAT_WRITE_OLD.
ActorMigration::getInsertValuesWithTempTable | ( | IDatabase | $dbw, |
$key, | |||
UserIdentity | $user | ||
) |
Get UPDATE fields for the actor.
IDatabase | $dbw | Database to use for creating an actor ID, if necessary |
string | $key | A key such as "rev_user" identifying the actor field being fetched. |
UserIdentity | $user | User to set in the update |
$values
to IDatabase->update()
or $a
to IDatabase->insert()
Definition at line 237 of file ActorMigration.php.
References $ret, $t, $user, array(), as, getFieldNames(), list, User\newFromAnyId(), null, SCHEMA_COMPAT_WRITE_NEW, SCHEMA_COMPAT_WRITE_OLD, Wikimedia\Rdbms\IDatabase\upsert(), use, and wfDeprecated().
ActorMigration::getJoin | ( | $key | ) |
Get SELECT fields and joins for the actor key.
string | $key | A key such as "rev_user" identifying the actor field being fetched. |
Definition at line 153 of file ActorMigration.php.
References $t, $tables, getFieldNames(), list, and SCHEMA_COMPAT_READ_OLD.
Get WHERE condition for the actor.
IDatabase | $db | Database to use for quoting and list-making |
string | $key | A key such as "rev_user" identifying the actor field being fetched. |
UserIdentity | UserIdentity[] | $users | Users to test for |
bool | $useId | If false, don't try to query by the user ID. Intended for use with rc_user since it has an index on (rc_user_text,rc_timestamp) but not (rc_user,rc_timestamp). |
$table
to IDatabase->select()
$cond
to IDatabase->select()
$join_conds
to IDatabase->select()
All tables and joins are aliased, so +
is safe to use. Definition at line 320 of file ActorMigration.php.
References $t, $tables, $user, as, getFieldNames(), list, LIST_AND, LIST_OR, Wikimedia\Rdbms\IDatabase\makeList(), and SCHEMA_COMPAT_READ_NEW.
ActorMigration::isAnon | ( | $field | ) |
Return an SQL condition to test if a user field is anonymous.
string | $field | Field name or SQL fragment |
Definition at line 120 of file ActorMigration.php.
References SCHEMA_COMPAT_READ_NEW.
ActorMigration::isNotAnon | ( | $field | ) |
Return an SQL condition to test if a user field is non-anonymous.
string | $field | Field name or SQL fragment |
Definition at line 129 of file ActorMigration.php.
References SCHEMA_COMPAT_READ_NEW.
|
static |
Static constructor.
Definition at line 111 of file ActorMigration.php.
Referenced by ChangesListSpecialPage\__construct(), WikiPage\archiveRevisions(), ImageListPager\buildQueryConds(), SiteStatsUpdate\cacheUpdate(), Orphans\checkOrphans(), WikiPage\commitRollback(), Block\defaultRetroactiveAutoblock(), LocalFileDeleteBatch\doDBInserts(), DeduplicateArchiveRevId\doDBUpdates(), PopulateIpChanges\doDBUpdates(), RevDelLogList\doQuery(), ReassignEdits\doReassignEdits(), WikiExporter\dumpLogs(), ApiQueryBlocks\execute(), ApiQueryDeletedrevs\execute(), FixUserRegistration\execute(), DeleteDefaultMessages\execute(), InitEditCount\execute(), ApiQueryLogEvents\execute(), ApiQueryContributors\execute(), LocalFileRestoreBatch\execute(), ChangesListSpecialPage\filterOnUserExperienceLevel(), Block\getAutoblockUpdateArray(), WikiPage\getContributors(), Block\getDatabaseArray(), User\getEditTimestamp(), EditPage\getLastDelete(), SpecialNuke\getNewPages(), NewPagesPager\getQueryInfo(), NewFilesPager\getQueryInfo(), DeletedContribsPager\getQueryInfo(), OldLocalFile\getQueryInfo(), ContribsPager\getQueryInfo(), LocalFile\getQueryInfo(), ProtectedPagesPager\getQueryInfo(), Block\getQueryInfo(), ArchivedFile\getQueryInfo(), RecentChange\getQueryInfo(), BlockListPager\getQueryInfo(), ImageListPager\getQueryInfoReal(), RollbackEdits\getRollbackTitles(), DatabaseLogEntry\getSelectQueryData(), WikiRevision\importLogItem(), User\initEditCountInternal(), ManualLogEntry\insert(), RemoveUnusedAccounts\isInactiveAccount(), ApiStashEdit\lastEditTime(), LogPager\limitPerformer(), ApiQueryUserContribs\prepareQuery(), RebuildRecentchanges\rebuildRecentChangesTablePass1(), RebuildRecentchanges\rebuildRecentChangesTablePass3(), RebuildRecentchanges\rebuildRecentChangesTablePass4(), OldLocalFile\recordOldUpload(), LocalFile\recordUpload2(), ApiQueryDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllImages\run(), ApiQueryRevisions\run(), ApiQueryRecentChanges\run(), RecentChange\save(), LogPage\saveContent(), ApiQueryBase\showHiddenUsersAddBlockInfo(), WikiPageDbTestBase\testDoDeleteArticleReal_suppress(), WikiPageDbTestBase\testDoDeleteArticleReal_user0(), WikiPageDbTestBase\testDoDeleteArticleReal_userSysop(), MediaWiki\Tests\Revision\RevisionStoreFactoryTest\testGetRevisionStore(), ActorMigrationTest\testNewMigration(), MediaWiki\Tests\Revision\RevisionStoreFactoryTest\testValidConstruction_doesntCauseErrors(), and RecentChangesUpdateJob\updateActiveUsers().
|
staticprivate |
Fields that formerly used $tempTables Key is '$key', value is the MediaWiki version in which it was removed from $tempTables.
Definition at line 69 of file ActorMigration.php.
Cache for self::getJoin()
Definition at line 81 of file ActorMigration.php.
|
staticprivate |
Define fields that use non-standard mapping Keys are the user id column name, values are arrays with two elements (the user text column name and the actor id column name)
Definition at line 76 of file ActorMigration.php.
|
private |
Combination of SCHEMA_COMPAT_* constants.
Definition at line 84 of file ActorMigration.php.
Referenced by __construct().
|
staticprivate |
Define fields that use temporary tables for transitional purposes Keys are '$key', values are arrays with four fields:
Definition at line 51 of file ActorMigration.php.
const ActorMigration::MIGRATION_STAGE_SCHEMA_COMPAT = 1 |
Constant for extensions to feature-test whether $wgActorTableSchemaMigrationStage expects MIGRATION_* or SCHEMA_COMPAT_*.
Definition at line 41 of file ActorMigration.php.