DiffHistoryBlob Class Reference

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

Inherits HistoryBlob.

List of all members.

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


Detailed Description

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

Definition at line 277 of file HistoryBlob.php.


Constructor & Destructor Documentation

DiffHistoryBlob::__construct (  ) 

Definition at line 328 of file HistoryBlob.php.


Member Function Documentation

DiffHistoryBlob::__sleep (  ) 

Definition at line 508 of file HistoryBlob.php.

References $i, and compress().

DiffHistoryBlob::__wakeup (  ) 

Definition at line 536 of file HistoryBlob.php.

References $i, and uncompress().

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

Definition at line 357 of file HistoryBlob.php.

References $i, $text, diff(), and patch().

Referenced by __sleep().

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.

References $text, and addItem().

DiffHistoryBlob::uncompress (  ) 

Definition at line 495 of file HistoryBlob.php.

References $text, and patch().

Referenced by __wakeup().


Member Data Documentation

DiffHistoryBlob::$mCompressed

Compressed storage.

Definition at line 305 of file HistoryBlob.php.

DiffHistoryBlob::$mDefaultKey

The key for getText().

Definition at line 300 of file HistoryBlob.php.

DiffHistoryBlob::$mDiffMap

The diff map, see above.

Definition at line 295 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 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()

Uncompressed item cache.

Definition at line 279 of file HistoryBlob.php.

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

Total uncompressed size.

Definition at line 282 of file HistoryBlob.php.

Definition at line 325 of file HistoryBlob.php.

Constants from xdiff.h.

Definition at line 324 of file HistoryBlob.php.

Definition at line 326 of file HistoryBlob.php.


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

Generated on Sat Sep 5 02:08:36 2009 for MediaWiki by  doxygen 1.5.9