MediaWiki  REL1_19
DiffHistoryBlob Class Reference

Diff-based history compression Requires xdiff 1.5+ and zlib. More...

Inheritance diagram for DiffHistoryBlob:
Collaboration diagram for DiffHistoryBlob:

List of all members.

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 ()

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

Detailed Description

Diff-based history compression Requires xdiff 1.5+ and zlib.

Definition at line 317 of file HistoryBlob.php.


Constructor & Destructor Documentation

Definition at line 368 of file HistoryBlob.php.


Member Function Documentation

Returns:
array

Definition at line 579 of file HistoryBlob.php.

References compress().

Here is the call graph for this function:

Definition at line 607 of file HistoryBlob.php.

References uncompress().

Here is the call graph for this function:

Exceptions:
MWException
Parameters:
$textstring
Returns:
int

Implements HistoryBlob.

Definition at line 379 of file HistoryBlob.php.

Referenced by setText().

Here is the caller graph for this function:

Exceptions:
MWException

Definition at line 415 of file HistoryBlob.php.

References diff(), and patch().

Referenced by __sleep().

Here is the call graph for this function:

Here is the caller graph for this function:

DiffHistoryBlob::diff ( t1,
t2 
)
Parameters:
$t1
$t2
Returns:
string

Definition at line 492 of file HistoryBlob.php.

References wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by compress().

Here is the call graph for this function:

Here is the caller graph for this function:

Parameters:
$keystring
Returns:
string

Implements HistoryBlob.

Definition at line 394 of file HistoryBlob.php.

Referenced by getText().

Here is the caller graph for this function:

Returns:
string

Implements HistoryBlob.

Definition at line 408 of file HistoryBlob.php.

References getItem().

Here is the call graph for this function:

Helper function for compression jobs Returns true until the object is "full" and ready to be committed.

Returns:
bool

Definition at line 647 of file HistoryBlob.php.

DiffHistoryBlob::patch ( base,
diff 
)
Parameters:
$base
$diff
Returns:
bool|string

Definition at line 506 of file HistoryBlob.php.

References $out, wfDebug(), wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by compress(), and uncompress().

Here is the call graph for this function:

Here is the caller graph for this function:

Parameters:
$textstring

Implements HistoryBlob.

Definition at line 401 of file HistoryBlob.php.

References addItem().

Here is the call graph for this function:

Definition at line 563 of file HistoryBlob.php.

References patch().

Referenced by __wakeup().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

DiffHistoryBlob::$mCompressed

Compressed storage.

Definition at line 345 of file HistoryBlob.php.

DiffHistoryBlob::$mDefaultKey

The key for getText()

Definition at line 340 of file HistoryBlob.php.

DiffHistoryBlob::$mDiffMap

The diff map, see above.

Definition at line 335 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 332 of file HistoryBlob.php.

DiffHistoryBlob::$mFrozen = false

True if the object is locked against further writes.

Definition at line 350 of file HistoryBlob.php.

DiffHistoryBlob::$mItems = array()

Uncompressed item cache.

Definition at line 319 of file HistoryBlob.php.

DiffHistoryBlob::$mMaxCount = 100

The maximum number of text items before the object becomes sad.

Definition at line 361 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 356 of file HistoryBlob.php.

DiffHistoryBlob::$mSize = 0

Total uncompressed size.

Definition at line 322 of file HistoryBlob.php.

Definition at line 365 of file HistoryBlob.php.

Constants from xdiff.h.

Definition at line 364 of file HistoryBlob.php.

Definition at line 366 of file HistoryBlob.php.


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