* Add revText() to get non-public revision if user can, add rev_deleted constant...
[lhc/web/wiklou.git] / includes / Revision.php
1 <?php
2 /**
3 * @todo document
4 */
5
6 /**
7 * @todo document
8 */
9 class Revision {
10 const DELETED_TEXT = 1;
11 const DELETED_COMMENT = 2;
12 const DELETED_USER = 4;
13 const DELETED_RESTRICTED = 8;
14 const DELETED_NAME = 16;
15
16 /**
17 * Load a page revision from a given revision ID number.
18 * Returns null if no such revision can be found.
19 *
20 * @param int $id
21 * @access public
22 * @static
23 */
24 public static function newFromId( $id ) {
25 return Revision::newFromConds(
26 array( 'page_id=rev_page',
27 'rev_id' => intval( $id ) ) );
28 }
29
30 /**
31 * Load either the current, or a specified, revision
32 * that's attached to a given title. If not attached
33 * to that title, will return null.
34 *
35 * @param Title $title
36 * @param int $id
37 * @return Revision
38 * @access public
39 * @static
40 */
41 public static function newFromTitle( &$title, $id = 0 ) {
42 if( $id ) {
43 $matchId = intval( $id );
44 } else {
45 $matchId = 'page_latest';
46 }
47 return Revision::newFromConds(
48 array( "rev_id=$matchId",
49 'page_id=rev_page',
50 'page_namespace' => $title->getNamespace(),
51 'page_title' => $title->getDbkey() ) );
52 }
53
54 /**
55 * Load a page revision from a given revision ID number.
56 * Returns null if no such revision can be found.
57 *
58 * @param Database $db
59 * @param int $id
60 * @access public
61 * @static
62 */
63 public static function loadFromId( &$db, $id ) {
64 return Revision::loadFromConds( $db,
65 array( 'page_id=rev_page',
66 'rev_id' => intval( $id ) ) );
67 }
68
69 /**
70 * Load either the current, or a specified, revision
71 * that's attached to a given page. If not attached
72 * to that page, will return null.
73 *
74 * @param Database $db
75 * @param int $pageid
76 * @param int $id
77 * @return Revision
78 * @access public
79 * @static
80 */
81 public static function loadFromPageId( $db, $pageid, $id = 0 ) {
82 $conds=array('page_id=rev_page','rev_page'=>intval( $pageid ), 'page_id'=>intval( $pageid ));
83 if( $id ) {
84 $conds['rev_id']=intval($id);
85 } else {
86 $conds[]='rev_id=page_latest';
87 }
88 return Revision::loadFromConds( $db, $conds );
89 }
90
91 /**
92 * Load either the current, or a specified, revision
93 * that's attached to a given page. If not attached
94 * to that page, will return null.
95 *
96 * @param Database $db
97 * @param Title $title
98 * @param int $id
99 * @return Revision
100 * @access public
101 * @static
102 */
103 public static function loadFromTitle( &$db, $title, $id = 0 ) {
104 if( $id ) {
105 $matchId = intval( $id );
106 } else {
107 $matchId = 'page_latest';
108 }
109 return Revision::loadFromConds(
110 $db,
111 array( "rev_id=$matchId",
112 'page_id=rev_page',
113 'page_namespace' => $title->getNamespace(),
114 'page_title' => $title->getDbkey() ) );
115 }
116
117 /**
118 * Load the revision for the given title with the given timestamp.
119 * WARNING: Timestamps may in some circumstances not be unique,
120 * so this isn't the best key to use.
121 *
122 * @param Database $db
123 * @param Title $title
124 * @param string $timestamp
125 * @return Revision
126 * @access public
127 * @static
128 */
129 public static function loadFromTimestamp( &$db, &$title, $timestamp ) {
130 return Revision::loadFromConds(
131 $db,
132 array( 'rev_timestamp' => $db->timestamp( $timestamp ),
133 'page_id=rev_page',
134 'page_namespace' => $title->getNamespace(),
135 'page_title' => $title->getDbkey() ) );
136 }
137
138 /**
139 * Given a set of conditions, fetch a revision.
140 *
141 * @param array $conditions
142 * @return Revision
143 * @access private
144 * @static
145 */
146 private static function newFromConds( $conditions ) {
147 $db = wfGetDB( DB_SLAVE );
148 $row = Revision::loadFromConds( $db, $conditions );
149 if( is_null( $row ) ) {
150 $dbw = wfGetDB( DB_MASTER );
151 $row = Revision::loadFromConds( $dbw, $conditions );
152 }
153 return $row;
154 }
155
156 /**
157 * Given a set of conditions, fetch a revision from
158 * the given database connection.
159 *
160 * @param Database $db
161 * @param array $conditions
162 * @return Revision
163 * @access private
164 * @static
165 */
166 private static function loadFromConds( $db, $conditions ) {
167 $res = Revision::fetchFromConds( $db, $conditions );
168 if( $res ) {
169 $row = $res->fetchObject();
170 $res->free();
171 if( $row ) {
172 $ret = new Revision( $row );
173 return $ret;
174 }
175 }
176 $ret = null;
177 return $ret;
178 }
179
180 /**
181 * Return a wrapper for a series of database rows to
182 * fetch all of a given page's revisions in turn.
183 * Each row can be fed to the constructor to get objects.
184 *
185 * @param Title $title
186 * @return ResultWrapper
187 * @access public
188 * @static
189 */
190 public static function fetchAllRevisions( &$title ) {
191 return Revision::fetchFromConds(
192 wfGetDB( DB_SLAVE ),
193 array( 'page_namespace' => $title->getNamespace(),
194 'page_title' => $title->getDbkey(),
195 'page_id=rev_page' ) );
196 }
197
198 /**
199 * Return a wrapper for a series of database rows to
200 * fetch all of a given page's revisions in turn.
201 * Each row can be fed to the constructor to get objects.
202 *
203 * @param Title $title
204 * @return ResultWrapper
205 * @access public
206 * @static
207 */
208 public static function fetchRevision( &$title ) {
209 return Revision::fetchFromConds(
210 wfGetDB( DB_SLAVE ),
211 array( 'rev_id=page_latest',
212 'page_namespace' => $title->getNamespace(),
213 'page_title' => $title->getDbkey(),
214 'page_id=rev_page' ) );
215 }
216
217 /**
218 * Given a set of conditions, return a ResultWrapper
219 * which will return matching database rows with the
220 * fields necessary to build Revision objects.
221 *
222 * @param Database $db
223 * @param array $conditions
224 * @return ResultWrapper
225 * @access private
226 * @static
227 */
228 private static function fetchFromConds( $db, $conditions ) {
229 $res = $db->select(
230 array( 'page', 'revision' ),
231 array( 'page_namespace',
232 'page_title',
233 'page_latest',
234 'rev_id',
235 'rev_page',
236 'rev_text_id',
237 'rev_comment',
238 'rev_user_text',
239 'rev_user',
240 'rev_minor_edit',
241 'rev_timestamp',
242 'rev_deleted' ),
243 $conditions,
244 'Revision::fetchRow',
245 array( 'LIMIT' => 1 ) );
246 $ret = $db->resultObject( $res );
247 return $ret;
248 }
249
250 /**
251 * @param object $row
252 * @access private
253 */
254 function Revision( $row ) {
255 if( is_object( $row ) ) {
256 $this->mId = intval( $row->rev_id );
257 $this->mPage = intval( $row->rev_page );
258 $this->mTextId = intval( $row->rev_text_id );
259 $this->mComment = $row->rev_comment;
260 $this->mUserText = $row->rev_user_text;
261 $this->mUser = intval( $row->rev_user );
262 $this->mMinorEdit = intval( $row->rev_minor_edit );
263 $this->mTimestamp = $row->rev_timestamp;
264 $this->mDeleted = intval( $row->rev_deleted );
265
266 if( isset( $row->page_latest ) ) {
267 $this->mCurrent = ( $row->rev_id == $row->page_latest );
268 $this->mTitle = Title::makeTitle( $row->page_namespace,
269 $row->page_title );
270 } else {
271 $this->mCurrent = false;
272 $this->mTitle = null;
273 }
274
275 // Lazy extraction...
276 $this->mText = null;
277 if( isset( $row->old_text ) ) {
278 $this->mTextRow = $row;
279 } else {
280 // 'text' table row entry will be lazy-loaded
281 $this->mTextRow = null;
282 }
283 } elseif( is_array( $row ) ) {
284 // Build a new revision to be saved...
285 global $wgUser;
286
287 $this->mId = isset( $row['id'] ) ? intval( $row['id'] ) : null;
288 $this->mPage = isset( $row['page'] ) ? intval( $row['page'] ) : null;
289 $this->mTextId = isset( $row['text_id'] ) ? intval( $row['text_id'] ) : null;
290 $this->mUserText = isset( $row['user_text'] ) ? strval( $row['user_text'] ) : $wgUser->getName();
291 $this->mUser = isset( $row['user'] ) ? intval( $row['user'] ) : $wgUser->getId();
292 $this->mMinorEdit = isset( $row['minor_edit'] ) ? intval( $row['minor_edit'] ) : 0;
293 $this->mTimestamp = isset( $row['timestamp'] ) ? strval( $row['timestamp'] ) : wfTimestamp( TS_MW );
294 $this->mDeleted = isset( $row['deleted'] ) ? intval( $row['deleted'] ) : 0;
295
296 // Enforce spacing trimming on supplied text
297 $this->mComment = isset( $row['comment'] ) ? trim( strval( $row['comment'] ) ) : null;
298 $this->mText = isset( $row['text'] ) ? rtrim( strval( $row['text'] ) ) : null;
299 $this->mTextRow = null;
300
301 $this->mTitle = null; # Load on demand if needed
302 $this->mCurrent = false;
303 } else {
304 throw new MWException( 'Revision constructor passed invalid row format.' );
305 }
306 }
307
308 /**#@+
309 * @access public
310 */
311
312 /**
313 * @return int
314 */
315 function getId() {
316 return $this->mId;
317 }
318
319 /**
320 * @return int
321 */
322 function getTextId() {
323 return $this->mTextId;
324 }
325
326 /**
327 * Returns the title of the page associated with this entry.
328 * @return Title
329 */
330 function getTitle() {
331 if( isset( $this->mTitle ) ) {
332 return $this->mTitle;
333 }
334 $dbr = wfGetDB( DB_SLAVE );
335 $row = $dbr->selectRow(
336 array( 'page', 'revision' ),
337 array( 'page_namespace', 'page_title' ),
338 array( 'page_id=rev_page',
339 'rev_id' => $this->mId ),
340 'Revision::getTitle' );
341 if( $row ) {
342 $this->mTitle = Title::makeTitle( $row->page_namespace,
343 $row->page_title );
344 }
345 return $this->mTitle;
346 }
347
348 /**
349 * Set the title of the revision
350 * @param Title $title
351 */
352 function setTitle( $title ) {
353 $this->mTitle = $title;
354 }
355
356 /**
357 * @return int
358 */
359 function getPage() {
360 return $this->mPage;
361 }
362
363 /**
364 * Fetch revision's user id if it's available to all users
365 * @return int
366 */
367 function getUser() {
368 if( $this->isDeleted( self::DELETED_USER ) ) {
369 return 0;
370 } else {
371 return $this->mUser;
372 }
373 }
374
375 /**
376 * Fetch revision's user id without regard for the current user's permissions
377 * @return string
378 */
379 function getRawUser() {
380 return $this->mUser;
381 }
382
383 /**
384 * Fetch revision's username if it's available to all users
385 * @return string
386 */
387 function getUserText() {
388 if( $this->isDeleted( self::DELETED_USER ) ) {
389 return "";
390 } else {
391 return $this->mUserText;
392 }
393 }
394
395 /**
396 * Fetch revision's username without regard for view restrictions
397 * @return string
398 */
399 function getRawUserText() {
400 return $this->mUserText;
401 }
402
403 /**
404 * Fetch revision comment if it's available to all users
405 * @return string
406 */
407 function getComment() {
408 if( $this->isDeleted( self::DELETED_COMMENT ) ) {
409 return "";
410 } else {
411 return $this->mComment;
412 }
413 }
414
415 /**
416 * Fetch revision comment without regard for the current user's permissions
417 * @return string
418 */
419 function getRawComment() {
420 return $this->mComment;
421 }
422
423 /**
424 * @return bool
425 */
426 function isMinor() {
427 return (bool)$this->mMinorEdit;
428 }
429
430 /**
431 * int $field one of DELETED_* bitfield constants
432 * @return bool
433 */
434 function isDeleted( $field ) {
435 return ($this->mDeleted & $field) == $field;
436 }
437
438 /**
439 * Fetch revision text if it's available to all users
440 * @return string
441 */
442 function getText() {
443 if( $this->isDeleted( self::DELETED_TEXT ) ) {
444 return "";
445 } else {
446 return $this->getRawText();
447 }
448 }
449
450 /**
451 * Fetch revision text without regard for view restrictions
452 * @return string
453 */
454 function getRawText() {
455 if( is_null( $this->mText ) ) {
456 // Revision text is immutable. Load on demand:
457 $this->mText = $this->loadText();
458 }
459 return $this->mText;
460 }
461
462 /**
463 * Fetch revision text if it's available to THIS user
464 * @return string
465 */
466 function revText() {
467 if( !$this->userCan( self::DELETED_TEXT ) ) {
468 return "";
469 } else {
470 return $this->getRawText();
471 }
472 }
473
474 /**
475 * @return string
476 */
477 function getTimestamp() {
478 return wfTimestamp(TS_MW, $this->mTimestamp);
479 }
480
481 /**
482 * @return bool
483 */
484 function isCurrent() {
485 return $this->mCurrent;
486 }
487
488 /**
489 * @return Revision
490 */
491 function getPrevious() {
492 $prev = $this->mTitle->getPreviousRevisionID( $this->mId );
493 if ( $prev ) {
494 return Revision::newFromTitle( $this->mTitle, $prev );
495 } else {
496 return null;
497 }
498 }
499
500 /**
501 * @return Revision
502 */
503 function getNext() {
504 $next = $this->mTitle->getNextRevisionID( $this->mId );
505 if ( $next ) {
506 return Revision::newFromTitle( $this->mTitle, $next );
507 } else {
508 return null;
509 }
510 }
511 /**#@-*/
512
513 /**
514 * Get revision text associated with an old or archive row
515 * $row is usually an object from wfFetchRow(), both the flags and the text
516 * field must be included
517 * @static
518 * @param integer $row Id of a row
519 * @param string $prefix table prefix (default 'old_')
520 * @return string $text|false the text requested
521 */
522 public static function getRevisionText( $row, $prefix = 'old_' ) {
523 $fname = 'Revision::getRevisionText';
524 wfProfileIn( $fname );
525
526 # Get data
527 $textField = $prefix . 'text';
528 $flagsField = $prefix . 'flags';
529
530 if( isset( $row->$flagsField ) ) {
531 $flags = explode( ',', $row->$flagsField );
532 } else {
533 $flags = array();
534 }
535
536 if( isset( $row->$textField ) ) {
537 $text = $row->$textField;
538 } else {
539 wfProfileOut( $fname );
540 return false;
541 }
542
543 # Use external methods for external objects, text in table is URL-only then
544 if ( in_array( 'external', $flags ) ) {
545 $url=$text;
546 @list(/* $proto */,$path)=explode('://',$url,2);
547 if ($path=="") {
548 wfProfileOut( $fname );
549 return false;
550 }
551 $text=ExternalStore::fetchFromURL($url);
552 }
553
554 // If the text was fetched without an error, convert it
555 if ( $text !== false ) {
556 if( in_array( 'gzip', $flags ) ) {
557 # Deal with optional compression of archived pages.
558 # This can be done periodically via maintenance/compressOld.php, and
559 # as pages are saved if $wgCompressRevisions is set.
560 $text = gzinflate( $text );
561 }
562
563 if( in_array( 'object', $flags ) ) {
564 # Generic compressed storage
565 $obj = unserialize( $text );
566 if ( !is_object( $obj ) ) {
567 // Invalid object
568 wfProfileOut( $fname );
569 return false;
570 }
571 $text = $obj->getText();
572 }
573
574 global $wgLegacyEncoding;
575 if( $wgLegacyEncoding && !in_array( 'utf-8', $flags ) ) {
576 # Old revisions kept around in a legacy encoding?
577 # Upconvert on demand.
578 global $wgInputEncoding, $wgContLang;
579 $text = $wgContLang->iconv( $wgLegacyEncoding, $wgInputEncoding . '//IGNORE', $text );
580 }
581 }
582 wfProfileOut( $fname );
583 return $text;
584 }
585
586 /**
587 * If $wgCompressRevisions is enabled, we will compress data.
588 * The input string is modified in place.
589 * Return value is the flags field: contains 'gzip' if the
590 * data is compressed, and 'utf-8' if we're saving in UTF-8
591 * mode.
592 *
593 * @static
594 * @param mixed $text reference to a text
595 * @return string
596 */
597 function compressRevisionText( &$text ) {
598 global $wgCompressRevisions;
599 $flags = array();
600
601 # Revisions not marked this way will be converted
602 # on load if $wgLegacyCharset is set in the future.
603 $flags[] = 'utf-8';
604
605 if( $wgCompressRevisions ) {
606 if( function_exists( 'gzdeflate' ) ) {
607 $text = gzdeflate( $text );
608 $flags[] = 'gzip';
609 } else {
610 wfDebug( "Revision::compressRevisionText() -- no zlib support, not compressing\n" );
611 }
612 }
613 return implode( ',', $flags );
614 }
615
616 /**
617 * Insert a new revision into the database, returning the new revision ID
618 * number on success and dies horribly on failure.
619 *
620 * @param Database $dbw
621 * @return int
622 */
623 function insertOn( &$dbw ) {
624 global $wgDefaultExternalStore;
625
626 $fname = 'Revision::insertOn';
627 wfProfileIn( $fname );
628
629 $data = $this->mText;
630 $flags = Revision::compressRevisionText( $data );
631
632 # Write to external storage if required
633 if ( $wgDefaultExternalStore ) {
634 if ( is_array( $wgDefaultExternalStore ) ) {
635 // Distribute storage across multiple clusters
636 $store = $wgDefaultExternalStore[mt_rand(0, count( $wgDefaultExternalStore ) - 1)];
637 } else {
638 $store = $wgDefaultExternalStore;
639 }
640 // Store and get the URL
641 $data = ExternalStore::insert( $store, $data );
642 if ( !$data ) {
643 # This should only happen in the case of a configuration error, where the external store is not valid
644 throw new MWException( "Unable to store text to external storage $store" );
645 }
646 if ( $flags ) {
647 $flags .= ',';
648 }
649 $flags .= 'external';
650 }
651
652 # Record the text (or external storage URL) to the text table
653 if( !isset( $this->mTextId ) ) {
654 $old_id = $dbw->nextSequenceValue( 'text_old_id_val' );
655 $dbw->insert( 'text',
656 array(
657 'old_id' => $old_id,
658 'old_text' => $data,
659 'old_flags' => $flags,
660 ), $fname
661 );
662 $this->mTextId = $dbw->insertId();
663 }
664
665 # Record the edit in revisions
666 $rev_id = isset( $this->mId )
667 ? $this->mId
668 : $dbw->nextSequenceValue( 'rev_rev_id_val' );
669 $dbw->insert( 'revision',
670 array(
671 'rev_id' => $rev_id,
672 'rev_page' => $this->mPage,
673 'rev_text_id' => $this->mTextId,
674 'rev_comment' => $this->mComment,
675 'rev_minor_edit' => $this->mMinorEdit ? 1 : 0,
676 'rev_user' => $this->mUser,
677 'rev_user_text' => $this->mUserText,
678 'rev_timestamp' => $dbw->timestamp( $this->mTimestamp ),
679 'rev_deleted' => $this->mDeleted,
680 ), $fname
681 );
682
683 $this->mId = !is_null($rev_id) ? $rev_id : $dbw->insertId();
684 wfProfileOut( $fname );
685 return $this->mId;
686 }
687
688 /**
689 * Lazy-load the revision's text.
690 * Currently hardcoded to the 'text' table storage engine.
691 *
692 * @return string
693 * @access private
694 */
695 function loadText() {
696 $fname = 'Revision::loadText';
697 wfProfileIn( $fname );
698
699 // Caching may be beneficial for massive use of external storage
700 global $wgRevisionCacheExpiry, $wgMemc;
701 $key = wfMemcKey( 'revisiontext', 'textid', $this->getTextId() );
702 if( $wgRevisionCacheExpiry ) {
703 $text = $wgMemc->get( $key );
704 if( is_string( $text ) ) {
705 wfProfileOut( $fname );
706 return $text;
707 }
708 }
709
710 // If we kept data for lazy extraction, use it now...
711 if ( isset( $this->mTextRow ) ) {
712 $row = $this->mTextRow;
713 $this->mTextRow = null;
714 } else {
715 $row = null;
716 }
717
718 if( !$row ) {
719 // Text data is immutable; check slaves first.
720 $dbr = wfGetDB( DB_SLAVE );
721 $row = $dbr->selectRow( 'text',
722 array( 'old_text', 'old_flags' ),
723 array( 'old_id' => $this->getTextId() ),
724 $fname);
725 }
726
727 if( !$row ) {
728 // Possible slave lag!
729 $dbw = wfGetDB( DB_MASTER );
730 $row = $dbw->selectRow( 'text',
731 array( 'old_text', 'old_flags' ),
732 array( 'old_id' => $this->getTextId() ),
733 $fname);
734 }
735
736 $text = Revision::getRevisionText( $row );
737
738 if( $wgRevisionCacheExpiry ) {
739 $wgMemc->set( $key, $text, $wgRevisionCacheExpiry );
740 }
741
742 wfProfileOut( $fname );
743
744 return $text;
745 }
746
747 /**
748 * Create a new null-revision for insertion into a page's
749 * history. This will not re-save the text, but simply refer
750 * to the text from the previous version.
751 *
752 * Such revisions can for instance identify page rename
753 * operations and other such meta-modifications.
754 *
755 * @param Database $dbw
756 * @param int $pageId ID number of the page to read from
757 * @param string $summary
758 * @param bool $minor
759 * @return Revision
760 */
761 function newNullRevision( &$dbw, $pageId, $summary, $minor ) {
762 $fname = 'Revision::newNullRevision';
763 wfProfileIn( $fname );
764
765 $current = $dbw->selectRow(
766 array( 'page', 'revision' ),
767 array( 'page_latest', 'rev_text_id' ),
768 array(
769 'page_id' => $pageId,
770 'page_latest=rev_id',
771 ),
772 $fname );
773
774 if( $current ) {
775 $revision = new Revision( array(
776 'page' => $pageId,
777 'comment' => $summary,
778 'minor_edit' => $minor,
779 'text_id' => $current->rev_text_id,
780 ) );
781 } else {
782 $revision = null;
783 }
784
785 wfProfileOut( $fname );
786 return $revision;
787 }
788
789 /**
790 * Determine if the current user is allowed to view a particular
791 * field of this revision, if it's marked as deleted.
792 * @param int $field one of self::DELETED_TEXT,
793 * self::DELETED_COMMENT,
794 * self::DELETED_USER
795 * @return bool
796 */
797 function userCan( $field ) {
798 if( ( $this->mDeleted & $field ) == $field ) {
799 global $wgUser;
800 $permission = ( $this->mDeleted & self::DELETED_RESTRICTED ) == self::DELETED_RESTRICTED
801 ? 'hiderevision'
802 : 'deleterevision';
803 wfDebug( "Checking for $permission due to $field match on $this->mDeleted\n" );
804 return $wgUser->isAllowed( $permission );
805 } else {
806 return true;
807 }
808 }
809
810
811 /**
812 * Get rev_timestamp from rev_id, without loading the rest of the row
813 * @param integer $id
814 */
815 static function getTimestampFromID( $id ) {
816 $dbr = wfGetDB( DB_SLAVE );
817 $timestamp = $dbr->selectField( 'revision', 'rev_timestamp',
818 array( 'rev_id' => $id ), __METHOD__ );
819 if ( $timestamp === false ) {
820 # Not in slave, try master
821 $dbw = wfGetDB( DB_MASTER );
822 $timestamp = $dbw->selectField( 'revision', 'rev_timestamp',
823 array( 'rev_id' => $id ), __METHOD__ );
824 }
825 return $timestamp;
826 }
827
828 static function countByPageId( $db, $id ) {
829 $row = $db->selectRow( 'revision', 'COUNT(*) AS revCount',
830 array( 'rev_page' => $id ), __METHOD__ );
831 if( $row ) {
832 return $row->revCount;
833 }
834 return 0;
835 }
836
837 static function countByTitle( $db, $title ) {
838 $id = $title->getArticleId();
839 if( $id ) {
840 return Revision::countByPageId( $db, $id );
841 }
842 return 0;
843 }
844 }
845
846 /**
847 * Aliases for backwards compatibility with 1.6
848 */
849 define( 'MW_REV_DELETED_TEXT', Revision::DELETED_TEXT );
850 define( 'MW_REV_DELETED_COMMENT', Revision::DELETED_COMMENT );
851 define( 'MW_REV_DELETED_USER', Revision::DELETED_USER );
852 define( 'MW_REV_DELETED_RESTRICTED', Revision::DELETED_RESTRICTED );
853
854
855 ?>