*/
class WikiRevision implements ImportableUploadRevision, ImportableOldRevision {
- /**
- * @since 1.17
- * @deprecated in 1.29. Unused.
- * @note Introduced in 9b3128eb2b654761f21fd4ca1d5a1a4b796dc912, unused there, unused now.
- */
- public $importer = null;
-
/**
* @since 1.2
* @var Title
*/
public $timestamp = "20010115000000";
- /**
- * @since 1.2
- * @var int
- * @deprecated in 1.29. Unused.
- * @note Introduced in 436a028086fb3f01c4605c5ad2964d56f9306aca, unused there, unused now.
- */
- public $user = 0;
-
/**
* @since 1.2
* @var string
*/
public $sha1base36 = false;
+ /**
+ * @since 1.34
+ * @var string[]
+ */
+ protected $tags = [];
+
/**
* @since 1.17
* @var string
$this->sha1base36 = $sha1base36;
}
+ /**
+ * @since 1.34
+ * @param string[] $tags
+ */
+ public function setTags( array $tags ) {
+ $this->tags = $tags;
+ }
+
/**
* @since 1.12.2
* @param string $filename
/**
* @since 1.12.2
- * @param array $params
+ * @param string $params
*/
public function setParams( $params ) {
$this->params = $params;
return false;
}
+ /**
+ * @since 1.34
+ * @return string[]
+ */
+ public function getTags() {
+ return $this->tags;
+ }
+
/**
* @since 1.17
* @return string
public function importLogItem() {
$dbw = wfGetDB( DB_MASTER );
- $user = $this->getUserObj() ?: User::newFromName( $this->getUser() );
- if ( $user ) {
- $userId = intval( $user->getId() );
- $userText = $user->getName();
- } else {
- $userId = 0;
- $userText = $this->getUser();
- }
+ $user = $this->getUserObj() ?: User::newFromName( $this->getUser(), false );
# @todo FIXME: This will not record autoblocks
if ( !$this->getTitle() ) {
'log_timestamp' => $dbw->timestamp( $this->timestamp ),
'log_namespace' => $this->getTitle()->getNamespace(),
'log_title' => $this->getTitle()->getDBkey(),
- # 'log_user_text' => $this->user_text,
'log_params' => $this->params ],
__METHOD__
);
'log_type' => $this->type,
'log_action' => $this->action,
'log_timestamp' => $dbw->timestamp( $this->timestamp ),
- 'log_user' => $userId,
- 'log_user_text' => $userText,
'log_namespace' => $this->getTitle()->getNamespace(),
'log_title' => $this->getTitle()->getDBkey(),
'log_params' => $this->params
- ] + CommentStore::getStore()->insert( $dbw, 'log_comment', $this->getComment() );
+ ] + CommentStore::getStore()->insert( $dbw, 'log_comment', $this->getComment() )
+ + ActorMigration::newMigration()->getInsertValues( $dbw, 'log_user', $user );
$dbw->insert( 'logging', $data, __METHOD__ );
return true;
/**
* @since 1.12.2
- * @deprecated in 1.31. Use UploadImporter::import
+ * @deprecated in 1.31. Use UploadRevisionImporter::import
* @return bool
*/
public function importUpload() {
/**
* @since 1.12.2
- * @deprecated in 1.31. Use UploadImporter::downloadSource
+ * @deprecated in 1.31. No replacement
* @return bool|string
*/
public function downloadSource() {