Registered user can set their own language for the interface. See http://bugzilla...
[mediawiki.git] / includes / HistoryBlob.php
blob0c44b34415118aa383297fd9f79334024a22d545
1 <?php
2 /**
4 * @package MediaWiki
5 */
7 /**
8 * Pure virtual parent
9 * @package MediaWiki
11 class HistoryBlob
13 function setMeta() {}
14 function getMeta() {}
15 function addItem() {}
16 function getItem() {}
19 /**
20 * The real object
21 * @package MediaWiki
23 class ConcatenatedGzipHistoryBlob
25 /* private */ var $mVersion = 0, $mCompressed = false, $mItems = array();
27 function HistoryBlob() {
28 if ( !function_exists( 'gzdeflate' ) ) {
29 die( "Need zlib support to read or write this kind of history object (ConcatenatedGzipHistoryBlob)\n" );
33 function setMeta( $metaData ) {
34 $this->uncompress();
35 $this->mItems['meta'] = $metaData;
38 function getMeta() {
39 $this->uncompress();
40 return $this->mItems['meta'];
43 function addItem( $text ) {
44 $this->uncompress();
45 $this->mItems[md5($text)] = $text;
48 function getItem( $hash ) {
49 $this->compress();
50 return $this->mItems[$hash];
53 function compress() {
54 if ( !$this->mCompressed ) {
55 $this->mItems = gzdeflate( serialize( $this->mItems ) );
56 $this->mCompressed = true;
60 function uncompress() {
61 if ( $this->mCompressed ) {
62 $this->mItems = unserialize( gzinflate( $this->mItems ) );
66 function __sleep() {
67 compress();
70 function __wakeup() {
71 uncompress();