MediaWiki  master
ActorMigration.php
Go to the documentation of this file.
1 <?php
2 
7 
24 
29  public const FIELD_INFOS = [
30  // Deprecated since 1.39
31  'rev_user' => [
32  'tempTable' => [
33  'table' => 'revision_actor_temp',
34  'pk' => 'revactor_rev',
35  'field' => 'revactor_actor',
36  'joinPK' => 'rev_id',
37  'extra' => [
38  'revactor_timestamp' => 'rev_timestamp',
39  'revactor_page' => 'rev_page',
40  ],
41  ]
42  ],
43 
44  // Deprecated since 1.34
45  'ar_user' => [
46  'deprecatedVersion' => '1.37',
47  ],
48  // Deprecated since 1.34
49  'img_user' => [
50  'deprecatedVersion' => '1.37',
51  ],
52  // Deprecated since 1.34
53  'oi_user' => [
54  'deprecatedVersion' => '1.37',
55  ],
56  // Deprecated since 1.34
57  'fa_user' => [
58  'deprecatedVersion' => '1.37',
59  ],
60  // Deprecated since 1.34
61  'rc_user' => [
62  'deprecatedVersion' => '1.37',
63  ],
64  // Deprecated since 1.34
65  'log_user' => [
66  'deprecatedVersion' => '1.37',
67  ],
68  // Deprecated since 1.34
69  'ipb_by' => [
70  'deprecatedVersion' => '1.37',
71  'textField' => 'ipb_by_text',
72  'actorField' => 'ipb_by_actor'
73  ]
74  ];
75 
80  public static function newMigration() {
81  return MediaWikiServices::getInstance()->getActorMigration();
82  }
83 
90  public function __construct(
91  $stage,
92  ActorStoreFactory $actorStoreFactory
93  ) {
94  if ( $stage & SCHEMA_COMPAT_OLD ) {
95  throw new InvalidArgumentException(
96  'The old actor table schema is no longer supported' );
97  }
98  parent::__construct(
99  self::FIELD_INFOS,
100  $stage,
101  $actorStoreFactory
102  );
103  }
104 
110  public function getJoin( $key ) {
111  return parent::getJoin( $key );
112  }
113 
121  public function getWhere( IDatabase $db, $key, $users, $useId = true ) {
122  return parent::getWhere( $db, $key, $users, $useId );
123  }
124 
131  public function getInsertValues( IDatabase $dbw, $key, UserIdentity $user ) {
132  return parent::getInsertValues( $dbw, $key, $user );
133  }
134 
139  public function getInsertValuesWithTempTable( IDatabase $dbw, $key, UserIdentity $user ) {
140  return parent::getInsertValuesWithTempTable( $dbw, $key, $user );
141  }
142 
143 }
const SCHEMA_COMPAT_OLD
Definition: Defines.php:277
This abstract base class helps migrate core and extension code to use the actor table.
This is not intended to be a long-term part of MediaWiki; it will be deprecated and removed once acto...
const MIGRATION_STAGE_SCHEMA_COMPAT
Constant for extensions to feature-test whether $wgActorTableSchemaMigrationStage (in MW <1....
const FIELD_INFOS
Field information.
getInsertValues(IDatabase $dbw, $key, UserIdentity $user)
Get UPDATE fields for the actor.Database to use for creating an actor ID, if necessary A key such as ...
__construct( $stage, ActorStoreFactory $actorStoreFactory)
static newMigration()
Static constructor.
getInsertValuesWithTempTable(IDatabase $dbw, $key, UserIdentity $user)
Get UPDATE fields for the actor.Database to use for creating an actor ID, if necessary A key such as ...
getWhere(IDatabase $db, $key, $users, $useId=true)
Get WHERE condition for the actor.Database to use for quoting and list-making A key such as "rev_user...
getJoin( $key)
Get SELECT fields and joins for the actor key.A key such as "rev_user" identifying the actor field be...
Service locator for MediaWiki core services.
Interface for objects representing user identity.
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:40