MediaWiki REL1_40
HistoryBlobStub Class Reference

Pointer object for an item within a CGZ blob stored in the text table. More...

Public Member Functions

 __construct ( $hash='', $oldid=0)
 
 getHash ()
 Get the content hash.
 
 getLocation ()
 Gets the location of the main object.
 
 getReferrer ()
 Gets the location of the referring object.
 
 getText ()
 
 setLocation ( $id)
 Sets the location (old_id) of the main object to which this object points.
 
 setReferrer ( $id)
 Sets the location (old_id) of the referring object.
 

Protected Attributes

string $mHash
 
int $mOldId
 
string $mRef
 

Static Protected Attributes

static array $blobCache = []
 One-step cache variable to hold base blobs; operations that pull multiple revisions may often pull multiple times from the same blob.
 

Detailed Description

Pointer object for an item within a CGZ blob stored in the text table.

WARNING: Objects of this class are serialized and permanently stored in the DB. Do not change the name or visibility of any property!

Note: the property visibility was changed in 2020 from public to protected. This may cause problems in future.

Definition at line 34 of file HistoryBlobStub.php.

Constructor & Destructor Documentation

◆ __construct()

HistoryBlobStub::__construct ( $hash = '',
$oldid = 0 )
Parameters
string$hashThe content hash of the text
int$oldidThe old_id for the CGZ object

Definition at line 56 of file HistoryBlobStub.php.

Member Function Documentation

◆ getHash()

HistoryBlobStub::getHash ( )

Get the content hash.

Returns
string

Definition at line 149 of file HistoryBlobStub.php.

References $mHash.

◆ getLocation()

HistoryBlobStub::getLocation ( )

Gets the location of the main object.

Returns
int

Definition at line 73 of file HistoryBlobStub.php.

References $mOldId.

◆ getReferrer()

HistoryBlobStub::getReferrer ( )

Gets the location of the referring object.

Returns
string

Definition at line 89 of file HistoryBlobStub.php.

References $mRef.

◆ getText()

HistoryBlobStub::getText ( )
Returns
string|false

Definition at line 96 of file HistoryBlobStub.php.

References $dbr, $mOldId, DB_REPLICA, and wfGetDB().

◆ setLocation()

HistoryBlobStub::setLocation ( $id)

Sets the location (old_id) of the main object to which this object points.

Parameters
int$id

Definition at line 65 of file HistoryBlobStub.php.

◆ setReferrer()

HistoryBlobStub::setReferrer ( $id)

Sets the location (old_id) of the referring object.

Parameters
string$id

Definition at line 81 of file HistoryBlobStub.php.

Member Data Documentation

◆ $blobCache

array HistoryBlobStub::$blobCache = []
staticprotected

One-step cache variable to hold base blobs; operations that pull multiple revisions may often pull multiple times from the same blob.

By keeping the last-used one open, we avoid redundant unserialization and decompression overhead.

Definition at line 41 of file HistoryBlobStub.php.

◆ $mHash

string HistoryBlobStub::$mHash
protected

Definition at line 47 of file HistoryBlobStub.php.

Referenced by getHash().

◆ $mOldId

int HistoryBlobStub::$mOldId
protected

Definition at line 44 of file HistoryBlobStub.php.

Referenced by getLocation(), and getText().

◆ $mRef

string HistoryBlobStub::$mRef
protected

Definition at line 50 of file HistoryBlobStub.php.

Referenced by getReferrer().


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