Inherits HistoryBlob.
Public Member Functions | |
__construct () | |
addItem ($text) | |
Adds an item of text, returns a stub object which points to the item. | |
getItem ($key) | |
Get item by key, or false if the key is not present. | |
setText ($text) | |
Set the "default text" This concept is an odd property of the current DB schema, whereby each text item has a revision associated with it. | |
getText () | |
Get default text. | |
compress () | |
diff ($t1, $t2) | |
patch ($base, $diff) | |
uncompress () | |
__sleep () | |
__wakeup () | |
isHappy () | |
Helper function for compression jobs Returns true until the object is "full" and ready to be committed. | |
Public Attributes | |
$mItems = array() | |
Uncompressed item cache. | |
$mSize = 0 | |
Total uncompressed size. | |
$mDiffs | |
Array of diffs. | |
$mDiffMap | |
The diff map, see above. | |
$mDefaultKey | |
The key for getText(). | |
$mCompressed | |
Compressed storage. | |
$mFrozen = false | |
True if the object is locked against further writes. | |
$mMaxSize = 10000000 | |
The maximum uncompressed size before the object becomes sad Should be less than max_allowed_packet. | |
$mMaxCount = 100 | |
The maximum number of text items before the object becomes sad. | |
const | XDL_BDOP_INS = 1 |
Constants from xdiff.h. | |
const | XDL_BDOP_CPY = 2 |
const | XDL_BDOP_INSB = 3 |
Definition at line 277 of file HistoryBlob.php.
DiffHistoryBlob::__construct | ( | ) |
Definition at line 328 of file HistoryBlob.php.
DiffHistoryBlob::__sleep | ( | ) |
DiffHistoryBlob::__wakeup | ( | ) |
DiffHistoryBlob::addItem | ( | $ | text | ) |
Adds an item of text, returns a stub object which points to the item.
You must call setLocation() on the stub object before storing it to the database Returns the key for getItem()
Implements HistoryBlob.
Definition at line 334 of file HistoryBlob.php.
References $text.
Referenced by setText().
DiffHistoryBlob::compress | ( | ) |
DiffHistoryBlob::diff | ( | $ | t1, | |
$ | t2 | |||
) |
Definition at line 429 of file HistoryBlob.php.
References wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by compress().
DiffHistoryBlob::getItem | ( | $ | key | ) |
Get item by key, or false if the key is not present.
Implements HistoryBlob.
Definition at line 345 of file HistoryBlob.php.
References $key.
Referenced by getText().
DiffHistoryBlob::getText | ( | ) |
Get default text.
This is called from Revision::getRevisionText()
Implements HistoryBlob.
Definition at line 353 of file HistoryBlob.php.
References getItem().
DiffHistoryBlob::isHappy | ( | ) |
Helper function for compression jobs Returns true until the object is "full" and ready to be committed.
Definition at line 574 of file HistoryBlob.php.
DiffHistoryBlob::patch | ( | $ | base, | |
$ | diff | |||
) |
Definition at line 438 of file HistoryBlob.php.
References $out, $text, wfDebug(), wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by compress(), and uncompress().
DiffHistoryBlob::setText | ( | $ | text | ) |
Set the "default text" This concept is an odd property of the current DB schema, whereby each text item has a revision associated with it.
The default text is the text of the associated revision. There may, however, be other revisions in the same object.
Default text is not required for two-part external storage URLs.
Implements HistoryBlob.
Definition at line 349 of file HistoryBlob.php.
DiffHistoryBlob::uncompress | ( | ) |
Definition at line 495 of file HistoryBlob.php.
References $text, and patch().
Referenced by __wakeup().
DiffHistoryBlob::$mCompressed |
DiffHistoryBlob::$mDefaultKey |
DiffHistoryBlob::$mDiffMap |
DiffHistoryBlob::$mDiffs |
Array of diffs.
If a diff D from A to B is notated D = B - A, and Z is an empty string:
{ item[map[i]] - item[map[i-1]] where i > 0 diff[i] = { { item[map[i]] - Z where i = 0
Definition at line 292 of file HistoryBlob.php.
DiffHistoryBlob::$mFrozen = false |
True if the object is locked against further writes.
Definition at line 310 of file HistoryBlob.php.
DiffHistoryBlob::$mItems = array() |
DiffHistoryBlob::$mMaxCount = 100 |
The maximum number of text items before the object becomes sad.
Definition at line 321 of file HistoryBlob.php.
DiffHistoryBlob::$mMaxSize = 10000000 |
The maximum uncompressed size before the object becomes sad Should be less than max_allowed_packet.
Definition at line 316 of file HistoryBlob.php.
DiffHistoryBlob::$mSize = 0 |
const DiffHistoryBlob::XDL_BDOP_CPY = 2 |
Definition at line 325 of file HistoryBlob.php.
const DiffHistoryBlob::XDL_BDOP_INS = 1 |
const DiffHistoryBlob::XDL_BDOP_INSB = 3 |
Definition at line 326 of file HistoryBlob.php.