MediaWiki
1.30.0
|
Diff-based history compression Requires xdiff 1.5+ and zlib. More...
Public Member Functions | |
__construct () | |
__sleep () | |
__wakeup () | |
addItem ( $text) | |
compress () | |
diff ( $t1, $t2) | |
getItem ( $key) | |
getText () | |
isHappy () | |
Helper function for compression jobs Returns true until the object is "full" and ready to be committed. More... | |
patch ( $base, $diff) | |
setText ( $text) | |
uncompress () | |
xdiffAdler32 ( $s) | |
Compute a binary "Adler-32" checksum as defined by LibXDiff, i.e. More... | |
Public Attributes | |
string | $mCompressed |
Compressed storage. More... | |
int | $mDefaultKey |
The key for getText() More... | |
array | $mDiffMap |
The diff map, see above. More... | |
array | $mDiffs |
Array of diffs. More... | |
bool | $mFrozen = false |
True if the object is locked against further writes. More... | |
array | $mItems = [] |
Uncompressed item cache. More... | |
int | $mMaxCount = 100 |
The maximum number of text items before the object becomes sad. More... | |
int | $mMaxSize = 10000000 |
The maximum uncompressed size before the object becomes sad Should be less than max_allowed_packet. More... | |
int | $mSize = 0 |
Total uncompressed size. More... | |
const | XDL_BDOP_CPY = 2 |
const | XDL_BDOP_INS = 1 |
Constants from xdiff.h. More... | |
const | XDL_BDOP_INSB = 3 |
Diff-based history compression Requires xdiff 1.5+ and zlib.
Definition at line 349 of file HistoryBlob.php.
DiffHistoryBlob::__construct | ( | ) |
Definition at line 393 of file HistoryBlob.php.
DiffHistoryBlob::__sleep | ( | ) |
Definition at line 628 of file HistoryBlob.php.
References $mDefaultKey, $mDiffs, as, compress(), captcha-old\count, and serialize().
DiffHistoryBlob::__wakeup | ( | ) |
Definition at line 656 of file HistoryBlob.php.
References as, captcha-old\count, uncompress(), and unserialize().
DiffHistoryBlob::addItem | ( | $text | ) |
MWException |
string | $text |
Implements HistoryBlob.
Definition at line 404 of file HistoryBlob.php.
References captcha-old\count.
Referenced by setText().
DiffHistoryBlob::compress | ( | ) |
MWException |
Definition at line 440 of file HistoryBlob.php.
References as, captcha-old\count, diff(), and patch().
Referenced by __sleep().
DiffHistoryBlob::diff | ( | $t1, | |
$t2 | |||
) |
string | $t1 | |
string | $t2 |
Definition at line 519 of file HistoryBlob.php.
Referenced by compress().
DiffHistoryBlob::getItem | ( | $key | ) |
string | $key |
Implements HistoryBlob.
Definition at line 419 of file HistoryBlob.php.
Referenced by getText().
DiffHistoryBlob::getText | ( | ) |
Implements HistoryBlob.
Definition at line 433 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 696 of file HistoryBlob.php.
References $mMaxCount, and captcha-old\count.
DiffHistoryBlob::patch | ( | $base, | |
$diff | |||
) |
string | $base | |
string | $diff |
Definition at line 533 of file HistoryBlob.php.
References $base, $header, $out, wfDebug(), xdiffAdler32(), XDL_BDOP_CPY, XDL_BDOP_INS, and XDL_BDOP_INSB.
Referenced by compress(), and uncompress().
DiffHistoryBlob::setText | ( | $text | ) |
string | $text |
Implements HistoryBlob.
Definition at line 426 of file HistoryBlob.php.
References addItem().
DiffHistoryBlob::uncompress | ( | ) |
Definition at line 611 of file HistoryBlob.php.
References captcha-old\count, and patch().
Referenced by __wakeup().
DiffHistoryBlob::xdiffAdler32 | ( | $s | ) |
Compute a binary "Adler-32" checksum as defined by LibXDiff, i.e.
with the bytes backwards and initialised with 0 instead of 1. See T36428.
string | $s |
Definition at line 595 of file HistoryBlob.php.
References $s.
Referenced by patch(), and DiffHistoryBlobTest\testXdiffAdler32().
string DiffHistoryBlob::$mCompressed |
Compressed storage.
Definition at line 374 of file HistoryBlob.php.
int DiffHistoryBlob::$mDefaultKey |
array DiffHistoryBlob::$mDiffMap |
The diff map, see above.
Definition at line 367 of file HistoryBlob.php.
array 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 364 of file HistoryBlob.php.
Referenced by __sleep().
bool DiffHistoryBlob::$mFrozen = false |
True if the object is locked against further writes.
Definition at line 377 of file HistoryBlob.php.
array DiffHistoryBlob::$mItems = [] |
Uncompressed item cache.
Definition at line 351 of file HistoryBlob.php.
int DiffHistoryBlob::$mMaxCount = 100 |
The maximum number of text items before the object becomes sad.
Definition at line 386 of file HistoryBlob.php.
Referenced by isHappy().
int DiffHistoryBlob::$mMaxSize = 10000000 |
The maximum uncompressed size before the object becomes sad Should be less than max_allowed_packet.
Definition at line 383 of file HistoryBlob.php.
int DiffHistoryBlob::$mSize = 0 |
Total uncompressed size.
Definition at line 354 of file HistoryBlob.php.
const DiffHistoryBlob::XDL_BDOP_CPY = 2 |
Definition at line 390 of file HistoryBlob.php.
Referenced by patch().
const DiffHistoryBlob::XDL_BDOP_INS = 1 |
const DiffHistoryBlob::XDL_BDOP_INSB = 3 |
Definition at line 391 of file HistoryBlob.php.
Referenced by patch().