MediaWiki
REL1_20
|
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. | |
patch ($base, $diff) | |
setText ($text) | |
uncompress () | |
xdiffAdler32 ($s) | |
Compute a binary "Adler-32" checksum as defined by LibXDiff, i.e. | |
Public Attributes | |
$mCompressed | |
Compressed storage. | |
$mDefaultKey | |
The key for getText() | |
$mDiffMap | |
The diff map, see above. | |
$mDiffs | |
Array of diffs. | |
$mFrozen = false | |
True if the object is locked against further writes. | |
$mItems = array() | |
Uncompressed item cache. | |
$mMaxCount = 100 | |
The maximum number of text items before the object becomes sad. | |
$mMaxSize = 10000000 | |
The maximum uncompressed size before the object becomes sad Should be less than max_allowed_packet. | |
$mSize = 0 | |
Total uncompressed size. | |
const | XDL_BDOP_CPY = 2 |
const | XDL_BDOP_INS = 1 |
Constants from xdiff.h. | |
const | XDL_BDOP_INSB = 3 |
Diff-based history compression Requires xdiff 1.5+ and zlib.
Definition at line 337 of file HistoryBlob.php.
Definition at line 388 of file HistoryBlob.php.
Definition at line 649 of file HistoryBlob.php.
References uncompress().
DiffHistoryBlob::addItem | ( | $ | text | ) |
MWException |
$text | string |
Implements HistoryBlob.
Definition at line 399 of file HistoryBlob.php.
Referenced by setText().
MWException |
Definition at line 435 of file HistoryBlob.php.
References diff(), and patch().
Referenced by __sleep().
DiffHistoryBlob::diff | ( | $ | t1, |
$ | t2 | ||
) |
$t1 | |
$t2 |
Definition at line 512 of file HistoryBlob.php.
References wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by compress().
DiffHistoryBlob::getItem | ( | $ | key | ) |
$key | string |
Implements HistoryBlob.
Definition at line 414 of file HistoryBlob.php.
Referenced by getText().
Implements HistoryBlob.
Definition at line 428 of file HistoryBlob.php.
References getItem().
Helper function for compression jobs Returns true until the object is "full" and ready to be committed.
Definition at line 689 of file HistoryBlob.php.
DiffHistoryBlob::patch | ( | $ | base, |
$ | diff | ||
) |
$base | |
$diff |
Definition at line 526 of file HistoryBlob.php.
References $out, wfDebug(), wfRestoreWarnings(), wfSuppressWarnings(), and xdiffAdler32().
Referenced by compress(), and uncompress().
DiffHistoryBlob::setText | ( | $ | text | ) |
$text | string |
Implements HistoryBlob.
Definition at line 421 of file HistoryBlob.php.
References addItem().
Compute a binary "Adler-32" checksum as defined by LibXDiff, i.e.
with the bytes backwards and initialised with 0 instead of 1. See bug 34428.
Returns false if no hashing library is available
Definition at line 587 of file HistoryBlob.php.
References $s.
Referenced by patch(), and DiffHistoryBlobTest\testXdiffAdler32().
DiffHistoryBlob::$mCompressed |
Compressed storage.
Definition at line 365 of file HistoryBlob.php.
DiffHistoryBlob::$mDefaultKey |
The key for getText()
Definition at line 360 of file HistoryBlob.php.
DiffHistoryBlob::$mDiffMap |
The diff map, see above.
Definition at line 355 of file HistoryBlob.php.
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 352 of file HistoryBlob.php.
DiffHistoryBlob::$mFrozen = false |
True if the object is locked against further writes.
Definition at line 370 of file HistoryBlob.php.
DiffHistoryBlob::$mItems = array() |
Uncompressed item cache.
Definition at line 339 of file HistoryBlob.php.
DiffHistoryBlob::$mMaxCount = 100 |
The maximum number of text items before the object becomes sad.
Definition at line 381 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 376 of file HistoryBlob.php.
DiffHistoryBlob::$mSize = 0 |
Total uncompressed size.
Definition at line 342 of file HistoryBlob.php.
const DiffHistoryBlob::XDL_BDOP_CPY = 2 |
Definition at line 385 of file HistoryBlob.php.
const DiffHistoryBlob::XDL_BDOP_INS = 1 |
Constants from xdiff.h.
Definition at line 384 of file HistoryBlob.php.
const DiffHistoryBlob::XDL_BDOP_INSB = 3 |
Definition at line 386 of file HistoryBlob.php.