* Represents a revision, log entry or upload during the import process.
* This class sticks closely to the structure of the XML dump.
*
+ * @since 1.2
+ *
* @ingroup SpecialPage
*/
class WikiRevision {
- /** @todo Unused? */
+
+ /**
+ * @since 1.17
+ * @deprecated in 1.29. Unused.
+ * @note Introduced in 9b3128eb2b654761f21fd4ca1d5a1a4b796dc912, unused there, unused now.
+ */
public $importer = null;
- /** @var Title */
+ /**
+ * @since 1.2
+ * @var Title
+ */
public $title = null;
- /** @var int */
+ /**
+ * @since 1.6.4
+ * @var int
+ */
public $id = 0;
- /** @var string */
+ /**
+ * @since 1.2
+ * @var string
+ */
public $timestamp = "20010115000000";
/**
+ * @since 1.2
* @var int
- * @todo Can't find any uses. Public, because that's suspicious. Get clarity. */
+ * @deprecated in 1.29. Unused.
+ * @note Introduced in 436a028086fb3f01c4605c5ad2964d56f9306aca, unused there, unused now.
+ */
public $user = 0;
- /** @var string */
+ /**
+ * @since 1.2
+ * @var string
+ */
public $user_text = "";
- /** @var User */
+ /**
+ * @since 1.27
+ * @var User
+ */
public $userObj = null;
- /** @var string */
+ /**
+ * @since 1.21
+ * @var string
+ */
public $model = null;
- /** @var string */
+ /**
+ * @since 1.21
+ * @var string
+ */
public $format = null;
- /** @var string */
+ /**
+ * @since 1.2
+ * @var string
+ */
public $text = "";
- /** @var int */
+ /**
+ * @since 1.12.2
+ * @var int
+ */
protected $size;
- /** @var Content */
+ /**
+ * @since 1.21
+ * @var Content
+ */
public $content = null;
- /** @var ContentHandler */
+ /**
+ * @since 1.24
+ * @var ContentHandler
+ */
protected $contentHandler = null;
- /** @var string */
+ /**
+ * @since 1.2.6
+ * @var string
+ */
public $comment = "";
- /** @var bool */
+ /**
+ * @since 1.5.7
+ * @var bool
+ */
public $minor = false;
- /** @var string */
+ /**
+ * @since 1.12.2
+ * @var string
+ */
public $type = "";
- /** @var string */
+ /**
+ * @since 1.12.2
+ * @var string
+ */
public $action = "";
- /** @var string */
+ /**
+ * @since 1.12.2
+ * @var string
+ */
public $params = "";
- /** @var string */
+ /**
+ * @since 1.17
+ * @var string
+ */
public $fileSrc = '';
- /** @var bool|string */
+ /**
+ * @since 1.17
+ * @var bool|string
+ */
public $sha1base36 = false;
/**
- * @var bool
- * @todo Unused?
+ * @since 1.17
+ * @var string
*/
- public $isTemp = false;
-
- /** @var string */
public $archiveName = '';
+ /**
+ * @since 1.12.2
+ */
protected $filename;
- /** @var mixed */
+ /**
+ * @since 1.12.2
+ * @var mixed
+ */
protected $src;
- /** @todo Unused? */
+ /**
+ * @since 1.18
+ * @var bool
+ * @todo Unused?
+ */
+ public $isTemp = false;
+
+ /**
+ * @since 1.18
+ * @deprecated 1.29 use Wikirevision::isTempSrc()
+ * First written to in 43d5d3b682cc1733ad01a837d11af4a402d57e6a
+ * Actually introduced in 52cd34acf590e5be946b7885ffdc13a157c1c6cf
+ */
public $fileIsTemp;
/** @var bool */
}
/**
+ * @since 1.7 taking a Title object (string before)
* @param Title $title
* @throws MWException
*/
- function setTitle( $title ) {
+ public function setTitle( $title ) {
if ( is_object( $title ) ) {
$this->title = $title;
} elseif ( is_null( $title ) ) {
}
/**
+ * @since 1.6.4
* @param int $id
*/
- function setID( $id ) {
+ public function setID( $id ) {
$this->id = $id;
}
/**
+ * @since 1.2
* @param string $ts
*/
- function setTimestamp( $ts ) {
+ public function setTimestamp( $ts ) {
# 2003-08-05T18:30:02Z
$this->timestamp = wfTimestamp( TS_MW, $ts );
}
/**
+ * @since 1.2
* @param string $user
*/
- function setUsername( $user ) {
+ public function setUsername( $user ) {
$this->user_text = $user;
}
/**
+ * @since 1.27
* @param User $user
*/
- function setUserObj( $user ) {
+ public function setUserObj( $user ) {
$this->userObj = $user;
}
/**
+ * @since 1.2
* @param string $ip
*/
- function setUserIP( $ip ) {
+ public function setUserIP( $ip ) {
$this->user_text = $ip;
}
/**
+ * @since 1.21
* @param string $model
*/
- function setModel( $model ) {
+ public function setModel( $model ) {
$this->model = $model;
}
/**
+ * @since 1.21
* @param string $format
*/
- function setFormat( $format ) {
+ public function setFormat( $format ) {
$this->format = $format;
}
/**
+ * @since 1.2
* @param string $text
*/
- function setText( $text ) {
+ public function setText( $text ) {
$this->text = $text;
}
/**
+ * @since 1.2.6
* @param string $text
*/
- function setComment( $text ) {
+ public function setComment( $text ) {
$this->comment = $text;
}
/**
+ * @since 1.5.7
* @param bool $minor
*/
- function setMinor( $minor ) {
+ public function setMinor( $minor ) {
$this->minor = (bool)$minor;
}
/**
+ * @since 1.12.2
* @param mixed $src
*/
- function setSrc( $src ) {
+ public function setSrc( $src ) {
$this->src = $src;
}
/**
+ * @since 1.17
* @param string $src
* @param bool $isTemp
*/
- function setFileSrc( $src, $isTemp ) {
+ public function setFileSrc( $src, $isTemp ) {
$this->fileSrc = $src;
$this->fileIsTemp = $isTemp;
+ $this->isTemp = $isTemp;
}
/**
+ * @since 1.17
* @param string $sha1base36
*/
- function setSha1Base36( $sha1base36 ) {
+ public function setSha1Base36( $sha1base36 ) {
$this->sha1base36 = $sha1base36;
}
/**
+ * @since 1.12.2
* @param string $filename
*/
- function setFilename( $filename ) {
+ public function setFilename( $filename ) {
$this->filename = $filename;
}
/**
+ * @since 1.17
* @param string $archiveName
*/
- function setArchiveName( $archiveName ) {
+ public function setArchiveName( $archiveName ) {
$this->archiveName = $archiveName;
}
/**
+ * @since 1.12.2
* @param int $size
*/
- function setSize( $size ) {
+ public function setSize( $size ) {
$this->size = intval( $size );
}
/**
+ * @since 1.12.2
* @param string $type
*/
- function setType( $type ) {
+ public function setType( $type ) {
$this->type = $type;
}
/**
+ * @since 1.12.2
* @param string $action
*/
- function setAction( $action ) {
+ public function setAction( $action ) {
$this->action = $action;
}
/**
+ * @since 1.12.2
* @param array $params
*/
- function setParams( $params ) {
+ public function setParams( $params ) {
$this->params = $params;
}
/**
+ * @since 1.18
* @param bool $noupdates
*/
public function setNoUpdates( $noupdates ) {
}
/**
+ * @since 1.2
* @return Title
*/
- function getTitle() {
+ public function getTitle() {
return $this->title;
}
/**
+ * @since 1.6.4
* @return int
*/
- function getID() {
+ public function getID() {
return $this->id;
}
/**
+ * @since 1.2
* @return string
*/
- function getTimestamp() {
+ public function getTimestamp() {
return $this->timestamp;
}
/**
+ * @since 1.2
* @return string
*/
- function getUser() {
+ public function getUser() {
return $this->user_text;
}
/**
+ * @since 1.27
* @return User
*/
- function getUserObj() {
+ public function getUserObj() {
return $this->userObj;
}
/**
+ * @since 1.2
* @return string
- *
- * @deprecated Since 1.21, use getContent() instead.
*/
- function getText() {
- wfDeprecated( __METHOD__, '1.21' );
-
+ public function getText() {
return $this->text;
}
/**
+ * @since 1.24
* @return ContentHandler
*/
- function getContentHandler() {
+ public function getContentHandler() {
if ( is_null( $this->contentHandler ) ) {
$this->contentHandler = ContentHandler::getForModelID( $this->getModel() );
}
}
/**
+ * @since 1.21
* @return Content
*/
- function getContent() {
+ public function getContent() {
if ( is_null( $this->content ) ) {
$handler = $this->getContentHandler();
$this->content = $handler->unserializeContent( $this->text, $this->getFormat() );
}
/**
+ * @since 1.21
* @return string
*/
- function getModel() {
+ public function getModel() {
if ( is_null( $this->model ) ) {
$this->model = $this->getTitle()->getContentModel();
}
}
/**
+ * @since 1.21
* @return string
*/
- function getFormat() {
+ public function getFormat() {
if ( is_null( $this->format ) ) {
$this->format = $this->getContentHandler()->getDefaultFormat();
}
}
/**
+ * @since 1.2.6
* @return string
*/
- function getComment() {
+ public function getComment() {
return $this->comment;
}
/**
+ * @since 1.5.7
* @return bool
*/
- function getMinor() {
+ public function getMinor() {
return $this->minor;
}
/**
+ * @since 1.12.2
* @return mixed
*/
- function getSrc() {
+ public function getSrc() {
return $this->src;
}
/**
+ * @since 1.17
* @return bool|string
*/
- function getSha1() {
+ public function getSha1() {
if ( $this->sha1base36 ) {
return Wikimedia\base_convert( $this->sha1base36, 36, 16 );
}
}
/**
+ * @since 1.17
* @return string
*/
- function getFileSrc() {
+ public function getFileSrc() {
return $this->fileSrc;
}
/**
+ * @since 1.17
* @return bool
*/
- function isTempSrc() {
+ public function isTempSrc() {
return $this->isTemp;
}
/**
+ * @since 1.12.2
* @return mixed
*/
- function getFilename() {
+ public function getFilename() {
return $this->filename;
}
/**
+ * @since 1.17
* @return string
*/
- function getArchiveName() {
+ public function getArchiveName() {
return $this->archiveName;
}
/**
+ * @since 1.12.2
* @return mixed
*/
- function getSize() {
+ public function getSize() {
return $this->size;
}
/**
+ * @since 1.12.2
* @return string
*/
- function getType() {
+ public function getType() {
return $this->type;
}
/**
+ * @since 1.12.2
* @return string
*/
- function getAction() {
+ public function getAction() {
return $this->action;
}
/**
+ * @since 1.12.2
* @return string
*/
- function getParams() {
+ public function getParams() {
return $this->params;
}
/**
+ * @since 1.4.1
* @return bool
*/
- function importOldRevision() {
+ public function importOldRevision() {
$dbw = wfGetDB( DB_MASTER );
# Sneak a single revision into place
return true;
}
- function importLogItem() {
+ /**
+ * @since 1.12.2
+ * @return bool
+ */
+ public function importLogItem() {
$dbw = wfGetDB( DB_MASTER );
$user = $this->getUserObj() ?: User::newFromName( $this->getUser() );
}
/**
+ * @since 1.12.2
* @return bool
*/
- function importUpload() {
+ public function importUpload() {
# Construct a file
$archiveName = $this->getArchiveName();
if ( $archiveName ) {
}
/**
+ * @since 1.12.2
* @return bool|string
*/
- function downloadSource() {
+ public function downloadSource() {
if ( !$this->config->get( 'EnableUploads' ) ) {
return false;
}