MediaWiki REL1_40
WikiRevision Class Reference

Represents a revision, log entry or upload during the import process. More...

Inherits ImportableUploadRevision, and ImportableOldRevision.

Collaboration diagram for WikiRevision:

Public Member Functions

 __construct ()
 
 getAction ()
 
 getArchiveName ()
 
 getComment ()
 
 getContent ( $role=SlotRecord::MAIN)
 
 getContentHandler ()
 
 getFilename ()
 
 getFileSrc ()
 
 getFormat ()
 
 getID ()
 
 getMinor ()
 
 getModel ()
 
 getParams ()
 
 getSha1 ()
 
 getSha1Base36 ()
 
 getSize ()
 
 getSlot ( $role)
 
 getSlotRoles ()
 
 getSrc ()
 
 getTags ()
 
 getText ()
 
 getTimestamp ()
 
 getTitle ()
 
 getType ()
 
 getUser ()
 
 getUserObj ()
 
 importLogItem ()
 
 importOldRevision ()
 
 isTempSrc ()
 
 setAction ( $action)
 
 setArchiveName ( $archiveName)
 
 setComment (string $text)
 
 setContent ( $role, $content)
 
 setFilename ( $filename)
 
 setFileSrc ( $src, $isTemp)
 
 setFormat ( $format)
 
 setID ( $id)
 
 setMinor ( $minor)
 
 setModel ( $model)
 
 setNoUpdates ( $noupdates)
 
 setParams ( $params)
 
 setSha1Base36 ( $sha1base36)
 
 setSize ( $size)
 
 setSrc ( $src)
 
 setTags (array $tags)
 
 setText ( $text)
 
 setTimestamp ( $ts)
 
 setTitle ( $title)
 
 setType ( $type)
 
 setUserIP ( $ip)
 
 setUsername ( $user)
 
 setUserObj ( $user)
 

Public Attributes

string $action = ""
 
string $archiveName = ''
 
string $comment = ""
 
Content $content = null
 
string $fileSrc = ''
 
string $format = null
 
int $id = 0
 
bool $isTemp = false
 
bool $minor = false
 
string $model = null
 
string $params = ""
 
string $text = ""
 
string $timestamp = "20010115000000"
 
Title $title = null
 
string $type = ""
 
string $user_text = ""
 
User null $userObj = null
 

Protected Attributes

ContentHandler $contentHandler = null
 
string null $filename
 
int $size
 
string null $src = null
 
string[] $tags = []
 

Detailed Description

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

Definition at line 40 of file WikiRevision.php.

Constructor & Destructor Documentation

◆ __construct()

WikiRevision::__construct ( )

Definition at line 193 of file WikiRevision.php.

Member Function Documentation

◆ getAction()

WikiRevision::getAction ( )
Since
1.12.2
Returns
string

Definition at line 626 of file WikiRevision.php.

◆ getArchiveName()

WikiRevision::getArchiveName ( )
Since
1.17
Returns
string

Implements ImportableUploadRevision.

Definition at line 602 of file WikiRevision.php.

◆ getComment()

WikiRevision::getComment ( )
Since
1.2.6
Returns
string

Implements ImportableUploadRevision.

Definition at line 527 of file WikiRevision.php.

◆ getContent()

WikiRevision::getContent ( $role = SlotRecord::MAIN)
Since
1.21
Parameters
string$roleadded in 1.35
Returns
Content

Implements ImportableOldRevision.

Definition at line 480 of file WikiRevision.php.

Referenced by DumpRenderer\handleRevision(), CompareParsers\processRevision(), and SearchDump\processRevision().

◆ getContentHandler()

WikiRevision::getContentHandler ( )
Since
1.24
Deprecated
since 1.35, use getContent
Returns
ContentHandler
Exceptions
MWUnknownContentModelException

Definition at line 467 of file WikiRevision.php.

References $contentHandler, and getModel().

Referenced by getFormat().

◆ getFilename()

WikiRevision::getFilename ( )
Since
1.12.2
Returns
mixed

Definition at line 594 of file WikiRevision.php.

Referenced by BackupReader\handleUpload().

◆ getFileSrc()

WikiRevision::getFileSrc ( )
Since
1.17
Returns
string

Implements ImportableUploadRevision.

Definition at line 578 of file WikiRevision.php.

◆ getFormat()

WikiRevision::getFormat ( )
Since
1.21
Deprecated
since 1.35, use getContent
Returns
string

Implements ImportableOldRevision.

Definition at line 517 of file WikiRevision.php.

References $format, and getContentHandler().

◆ getID()

WikiRevision::getID ( )
Since
1.6.4
Returns
int

Definition at line 424 of file WikiRevision.php.

References $id.

◆ getMinor()

WikiRevision::getMinor ( )
Since
1.5.7
Returns
bool

Implements ImportableOldRevision.

Definition at line 535 of file WikiRevision.php.

◆ getModel()

WikiRevision::getModel ( )
Since
1.21
Deprecated
since 1.35, use getContent
Returns
string

Implements ImportableOldRevision.

Definition at line 506 of file WikiRevision.php.

References $model, and getTitle().

Referenced by getContentHandler(), and setText().

◆ getParams()

WikiRevision::getParams ( )
Since
1.12.2
Returns
string

Definition at line 634 of file WikiRevision.php.

◆ getSha1()

WikiRevision::getSha1 ( )
Since
1.17
Returns
string|false

Implements ImportableUploadRevision.

Definition at line 551 of file WikiRevision.php.

◆ getSha1Base36()

WikiRevision::getSha1Base36 ( )
Since
1.31
Returns
string|false

Implements ImportableOldRevision.

Definition at line 562 of file WikiRevision.php.

◆ getSize()

WikiRevision::getSize ( )
Since
1.12.2
Returns
mixed

Definition at line 610 of file WikiRevision.php.

◆ getSlot()

WikiRevision::getSlot ( $role)
Since
1.35
Parameters
string$role
Returns
SlotRecord

Implements ImportableOldRevision.

Definition at line 489 of file WikiRevision.php.

◆ getSlotRoles()

WikiRevision::getSlotRoles ( )
Since
1.35
Returns
string[]

Implements ImportableOldRevision.

Definition at line 497 of file WikiRevision.php.

◆ getSrc()

WikiRevision::getSrc ( )
Since
1.12.2
Returns
string|null

Implements ImportableUploadRevision.

Definition at line 543 of file WikiRevision.php.

◆ getTags()

WikiRevision::getTags ( )
Since
1.34
Returns
string[]

Implements ImportableOldRevision.

Definition at line 570 of file WikiRevision.php.

◆ getText()

WikiRevision::getText ( )
Since
1.2
Returns
string

Definition at line 457 of file WikiRevision.php.

References $text.

◆ getTimestamp()

WikiRevision::getTimestamp ( )
Since
1.2
Returns
string TS_MW timestamp, a string with 14 digits

Implements ImportableUploadRevision.

Definition at line 432 of file WikiRevision.php.

References $timestamp.

Referenced by SearchDump\processRevision().

◆ getTitle()

◆ getType()

WikiRevision::getType ( )
Since
1.12.2
Returns
string

Definition at line 618 of file WikiRevision.php.

References $type.

◆ getUser()

WikiRevision::getUser ( )
Since
1.2
Returns
string

Implements ImportableUploadRevision.

Definition at line 440 of file WikiRevision.php.

References $user_text.

◆ getUserObj()

WikiRevision::getUserObj ( )
Deprecated
since 1.39, use {
See also
getUser} instead; this is almost always null anyway
Since
1.27
Returns
User|null Typically null, use {
See also
getUser} instead

Implements ImportableUploadRevision.

Definition at line 449 of file WikiRevision.php.

References $userObj.

◆ importLogItem()

WikiRevision::importLogItem ( )
Since
1.12.2
Returns
bool

Definition at line 656 of file WikiRevision.php.

References $type, DB_PRIMARY, getTitle(), getUser(), User\newFromName(), wfDebug(), and wfGetDB().

◆ importOldRevision()

WikiRevision::importOldRevision ( )
Since
1.4.1
Deprecated
in 1.31. Use OldRevisionImporter::import
Returns
bool

Definition at line 643 of file WikiRevision.php.

◆ isTempSrc()

WikiRevision::isTempSrc ( )
Since
1.17
Returns
bool

Implements ImportableUploadRevision.

Definition at line 586 of file WikiRevision.php.

◆ setAction()

WikiRevision::setAction ( $action)
Since
1.12.2
Parameters
string$action

Definition at line 392 of file WikiRevision.php.

References $action.

◆ setArchiveName()

WikiRevision::setArchiveName ( $archiveName)
Since
1.17
Parameters
string$archiveName

Definition at line 368 of file WikiRevision.php.

References $archiveName.

◆ setComment()

WikiRevision::setComment ( string $text)
Since
1.2.6
Parameters
string$text

Definition at line 310 of file WikiRevision.php.

References $text.

◆ setContent()

WikiRevision::setContent ( $role,
$content )
Since
1.35
Parameters
string$role
Content$content

Definition at line 294 of file WikiRevision.php.

References $content, Content\getDefaultFormat(), Content\getModel(), and Content\serialize().

Referenced by setText().

◆ setFilename()

WikiRevision::setFilename ( $filename)
Since
1.12.2
Parameters
string$filename

Definition at line 360 of file WikiRevision.php.

References $filename.

◆ setFileSrc()

WikiRevision::setFileSrc ( $src,
$isTemp )
Since
1.17
Parameters
string$src
bool$isTemp

Definition at line 335 of file WikiRevision.php.

References $isTemp, and $src.

◆ setFormat()

WikiRevision::setFormat ( $format)
Since
1.21
Deprecated
since 1.35, use setContent instead.
Parameters
string$format

Definition at line 274 of file WikiRevision.php.

References $format.

◆ setID()

WikiRevision::setID ( $id)
Since
1.6.4
Parameters
int$id

Definition at line 217 of file WikiRevision.php.

References $id.

◆ setMinor()

WikiRevision::setMinor ( $minor)
Since
1.5.7
Parameters
bool$minor

Definition at line 318 of file WikiRevision.php.

References $minor.

◆ setModel()

WikiRevision::setModel ( $model)
Since
1.21
Deprecated
since 1.35, use setContent instead.
Parameters
string$model

Definition at line 265 of file WikiRevision.php.

References $model.

◆ setNoUpdates()

WikiRevision::setNoUpdates ( $noupdates)
Since
1.18
Parameters
bool$noupdates

Definition at line 408 of file WikiRevision.php.

◆ setParams()

WikiRevision::setParams ( $params)
Since
1.12.2
Parameters
string$params

Definition at line 400 of file WikiRevision.php.

References $params.

◆ setSha1Base36()

WikiRevision::setSha1Base36 ( $sha1base36)
Since
1.17
Parameters
string$sha1base36

Definition at line 344 of file WikiRevision.php.

◆ setSize()

WikiRevision::setSize ( $size)
Since
1.12.2
Parameters
int$size

Definition at line 376 of file WikiRevision.php.

References $size.

◆ setSrc()

WikiRevision::setSrc ( $src)
Since
1.12.2
Parameters
string | null$src

Definition at line 326 of file WikiRevision.php.

References $src.

◆ setTags()

WikiRevision::setTags ( array $tags)
Since
1.34
Parameters
string[]$tags

Definition at line 352 of file WikiRevision.php.

References $tags.

◆ setText()

WikiRevision::setText ( $text)
Since
1.2
Deprecated
since 1.35, use setContent instead.
Parameters
string$text

Definition at line 283 of file WikiRevision.php.

References $content, $text, getModel(), and setContent().

◆ setTimestamp()

WikiRevision::setTimestamp ( $ts)
Since
1.2
Parameters
string$ts

Definition at line 225 of file WikiRevision.php.

References wfTimestamp().

◆ setTitle()

WikiRevision::setTitle ( $title)
Since
1.7 taking a Title object (string before)
Parameters
Title$title
Exceptions
MWException

Definition at line 202 of file WikiRevision.php.

References $title.

◆ setType()

WikiRevision::setType ( $type)
Since
1.12.2
Parameters
string$type

Definition at line 384 of file WikiRevision.php.

References $type.

◆ setUserIP()

WikiRevision::setUserIP ( $ip)
Deprecated
since 1.39, use {
See also
setUsername} instead, it does the same anyway
Since
1.2
Parameters
string$ip

Definition at line 256 of file WikiRevision.php.

◆ setUsername()

WikiRevision::setUsername ( $user)
Since
1.2
Parameters
string$user

Definition at line 234 of file WikiRevision.php.

◆ setUserObj()

WikiRevision::setUserObj ( $user)
Deprecated
since 1.39, use {
See also
setUsername} instead
Since
1.27
Parameters
User$user

Definition at line 243 of file WikiRevision.php.

Member Data Documentation

◆ $action

string WikiRevision::$action = ""
Since
1.12.2

Definition at line 140 of file WikiRevision.php.

Referenced by setAction().

◆ $archiveName

string WikiRevision::$archiveName = ''
Since
1.17

Definition at line 169 of file WikiRevision.php.

Referenced by setArchiveName().

◆ $comment

string WikiRevision::$comment = ""
Since
1.2.6

Definition at line 117 of file WikiRevision.php.

◆ $content

Content WikiRevision::$content = null
Since
1.21
Deprecated
since 1.35, use getContent

Definition at line 105 of file WikiRevision.php.

Referenced by setContent(), and setText().

◆ $contentHandler

ContentHandler WikiRevision::$contentHandler = null
protected
Since
1.24

Definition at line 111 of file WikiRevision.php.

Referenced by getContentHandler().

◆ $filename

string null WikiRevision::$filename
protected
Since
1.12.2

Definition at line 175 of file WikiRevision.php.

Referenced by setFilename().

◆ $fileSrc

string WikiRevision::$fileSrc = ''
Since
1.17

Definition at line 152 of file WikiRevision.php.

◆ $format

string WikiRevision::$format = null
Since
1.21
Deprecated
since 1.35, use getContent

Definition at line 85 of file WikiRevision.php.

Referenced by getFormat(), and setFormat().

◆ $id

int WikiRevision::$id = 0
Since
1.6.4

Definition at line 52 of file WikiRevision.php.

Referenced by getID(), and setID().

◆ $isTemp

bool WikiRevision::$isTemp = false
Since
1.18
Todo
Unused?

Definition at line 188 of file WikiRevision.php.

Referenced by setFileSrc().

◆ $minor

bool WikiRevision::$minor = false
Since
1.5.7

Definition at line 128 of file WikiRevision.php.

Referenced by setMinor().

◆ $model

string WikiRevision::$model = null
Since
1.21
Deprecated
since 1.35, use getContent

Definition at line 78 of file WikiRevision.php.

Referenced by getModel(), and setModel().

◆ $params

string WikiRevision::$params = ""
Since
1.12.2

Definition at line 146 of file WikiRevision.php.

Referenced by setParams().

◆ $size

int WikiRevision::$size
protected
Since
1.12.2

Definition at line 98 of file WikiRevision.php.

Referenced by setSize().

◆ $src

string null WikiRevision::$src = null
protected
Since
1.12.2

Definition at line 181 of file WikiRevision.php.

Referenced by setFileSrc(), and setSrc().

◆ $tags

string [] WikiRevision::$tags = []
protected
Since
1.34

Definition at line 163 of file WikiRevision.php.

Referenced by setTags().

◆ $text

string WikiRevision::$text = ""
Since
1.2
Deprecated
since 1.35, use getContent

Definition at line 92 of file WikiRevision.php.

Referenced by getText(), setComment(), and setText().

◆ $timestamp

string WikiRevision::$timestamp = "20010115000000"
Since
1.2 TS_MW timestamp, a string with 14 digits

Definition at line 58 of file WikiRevision.php.

Referenced by getTimestamp().

◆ $title

Title WikiRevision::$title = null
Since
1.2

Definition at line 46 of file WikiRevision.php.

Referenced by getTitle(), and setTitle().

◆ $type

string WikiRevision::$type = ""
Since
1.12.2

Definition at line 134 of file WikiRevision.php.

Referenced by setType().

◆ $user_text

string WikiRevision::$user_text = ""
Since
1.2

Definition at line 64 of file WikiRevision.php.

Referenced by getUser().

◆ $userObj

User null WikiRevision::$userObj = null
Deprecated
since 1.39, use {
See also
$user_text} instead
Since
1.27

Definition at line 71 of file WikiRevision.php.

Referenced by getUserObj().


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