23 parent::__construct( $name,
$data, $dataName );
72 12313 =>
'Dummy_talk',
77 'wgNamespaceContentModels',
99 if ( !$this->testPage ) {
104 $this->testPage = $this->
createPage( __CLASS__, __CLASS__ );
114 ->disableOriginalConstructor()
116 $mock->expects( $this->
any() )
117 ->method(
'getNamespace' )
119 $mock->expects( $this->
any() )
120 ->method(
'getPrefixedText' )
122 $mock->expects( $this->
any() )
123 ->method(
'getDBkey' )
125 $mock->expects( $this->
any() )
126 ->method(
'getArticleID' )
135 if ( $props ===
null ) {
139 if ( !
isset( $props[
'content'] ) && !
isset( $props[
'text'] ) ) {
140 $props[
'text'] =
'Lorem Ipsum';
143 if ( !
isset( $props[
'user_text'] ) ) {
145 $props[
'user_text'] = $user->getName();
146 $props[
'user'] = $user->getId();
149 if ( !
isset( $props[
'user'] ) ) {
153 if ( !
isset( $props[
'comment'] ) ) {
154 $props[
'comment'] =
'just a test';
157 if ( !
isset( $props[
'page'] ) ) {
158 $props[
'page'] = $this->testPage->getId();
161 if ( !
isset( $props[
'content_model'] ) ) {
168 $rev->insertOn( $dbw );
180 private function createPage( $titleString, $text, $model =
null ) {
185 $titleString = MWNamespace::getCanonicalName( $ns ) .
':' .
$titleString;
188 $title = Title::newFromText( $titleString );
192 if ( $wikipage->exists() ) {
193 $wikipage->doDeleteArticle(
"done" );
196 $content = ContentHandler::makeContent( $text, $title, $model );
218 $rev = $this->testPage->getRevision();
219 $recentChange =
$rev->getRecentChange();
222 $this->
assertEquals(
$rev->getTimestamp(), $recentChange->getAttribute(
'rc_timestamp' ) );
224 $rev->getTitle()->getNamespace(),
225 $recentChange->getAttribute(
'rc_namespace' )
228 $rev->getTitle()->getDBkey(),
229 $recentChange->getAttribute(
'rc_title' )
231 $this->
assertEquals(
$rev->getUser(), $recentChange->getAttribute(
'rc_user' ) );
232 $this->
assertEquals(
$rev->getUserText(), $recentChange->getAttribute(
'rc_user_text' ) );
233 $this->
assertEquals(
$rev->getComment(), $recentChange->getAttribute(
'rc_comment' ) );
234 $this->
assertEquals(
$rev->getPage(), $recentChange->getAttribute(
'rc_cur_id' ) );
235 $this->
assertEquals(
$rev->getId(), $recentChange->getAttribute(
'rc_this_oldid' ) );
242 $parentId = $this->testPage->getLatest();
248 'page' => $this->testPage->getId(),
249 'title' => $this->testPage->getTitle(),
250 'text' =>
'Revision Text',
251 'comment' =>
'Revision comment',
262 $mainSlot =
$rev->getRevisionRecord()->getSlot( SlotRecord::MAIN, RevisionRecord::RAW );
265 $textId = MediaWikiServices::getInstance()
267 ->getTextIdFromAddress( $mainSlot->getAddress() );
271 [
'old_id',
'old_text' ],
273 [ [
strval( $textId ),
'Revision Text' ] ]
286 "rev_id = {$rev->getId()}",
289 strval( $this->testPage->getId() ),
294 's0ngbdoxagreuf2vjtuxzwdz64n29xm',
303 yield
'no parent' => [
309 IncompleteRevisionException::class,
310 "rev_page field must not be 0!"
313 yield
'no comment' => [
319 IncompleteRevisionException::class,
320 "comment must not be NULL!"
323 yield
'no content' => [
329 IncompleteRevisionException::class,
330 "Uninitialized field: content_address"
343 $title = Title::newFromText(
'Nonexistant-' . __METHOD__ );
353 $latestRevId = $this->testPage->getLatest();
357 $this->
assertTrue( $this->testPage->getTitle()->equals(
$rev->getTitle() ) );
365 $latestRevId = $this->testPage->getLatest();
369 $this->
assertTrue( $this->testPage->getTitle()->equals(
$rev->getTitle() ) );
377 $latestRevId = $this->testPage->getLatest();
396 $row =
$res->fetchObject();
412 return $f + [
'ar_namespace',
'ar_title' ];
452 $services = MediaWikiServices::getInstance();
456 $services->getService(
'_SqlBlobStore' ),
462 $this->getMcrMigrationStage(),
470 'RevisionStorageTest_testNewFromArchiveRow',
474 $orig = $page->getRevision();
475 $page->doDeleteArticle(
'test Revision::newFromArchiveRow' );
481 $arQuery[
'tables'], $arQuery[
'fields'], [
'ar_rev_id' => $orig->getId() ],
482 __METHOD__, [], $arQuery[
'joins']
486 $row =
$res->fetchObject();
501 'RevisionStorageTest_testNewFromArchiveRow',
505 $orig = $page->getRevision();
506 $page->doDeleteArticle(
'test Revision::newFromArchiveRow' );
511 $arQuery[
'tables'], $arQuery[
'fields'], [
'ar_rev_id' => $orig->getId() ],
512 __METHOD__, [], $arQuery[
'joins']
516 $row =
$res->fetchObject();
529 $orig = $this->testPage->getRevision();
540 $this->testPage->getRevision(),
550 $this->testPage->getId(),
551 $this->testPage->getLatest()
554 $this->testPage->getRevision(),
564 $this->testPage->doEditContent(
$content, __METHOD__ );
566 $this->testPage->getId(),
567 $this->testPage->getRevision()->getPrevious()->getId()
570 $this->testPage->getRevision()->getPrevious(),
591 $rev1 = $this->testPage->getRevision();
593 # @todo find out if this should be true
594 # $this->assertTrue( $rev1->isCurrent() );
599 $this->testPage->doEditContent(
new WikitextContent( __METHOD__ ), __METHOD__ );
600 $rev2 = $this->testPage->getRevision();
602 # @todo find out if this should be true
603 # $this->assertTrue( $rev2->isCurrent() );
616 $oldestRevision = $this->testPage->getOldestRevision();
617 $latestRevision = $this->testPage->getLatest();
619 $this->
assertNull( $oldestRevision->getPrevious() );
621 $this->testPage->doEditContent(
new WikitextContent( __METHOD__ ), __METHOD__ );
622 $newRevision = $this->testPage->getRevision();
625 $this->
assertEquals( $latestRevision, $newRevision->getPrevious()->getId() );
632 $rev1 = $this->testPage->getRevision();
636 $this->testPage->doEditContent(
new WikitextContent( __METHOD__ ), __METHOD__ );
637 $rev2 = $this->testPage->getRevision();
640 $this->
assertEquals( $rev2->getId(), $rev1->getNext()->getId() );
647 $this->testPage->doEditContent(
new WikitextContent( __METHOD__ ), __METHOD__ );
648 $orig = $this->testPage->getRevision();
654 'new null revision should have a different id from the original revision' );
656 'new null revision should have the same text id as the original revision' );
658 'new null revision should have the same SHA1 as the original revision' );
659 $this->
assertTrue( $orig->getRevisionRecord()->hasSameContent(
$rev->getRevisionRecord() ),
660 'new null revision should have the same content as the original revision' );
678 $ip =
'2600:387:ed7:947e:8c16:a1ad:dd34:1dd7';
686 $res =
$dbr->select(
'ip_changes',
'*', [
'ipc_rev_id' => $orig->getId() ] );
687 $row =
$res->fetchObject();
691 $orig->getTimestamp(),
697 yield
'actually the last edit' => [ 3,
true ];
698 yield
'not the current edit, but still by this user' => [ 2,
true ];
699 yield
'edit by another user' => [ 1,
false ];
700 yield
'first edit, by this user, but another user edited in the mean time' => [ 0,
false ];
711 if ( $userA->getId() === 0 ) {
715 if ( $userB->getId() === 0 ) {
725 $page = WikiPage::factory( Title::newFromText(
726 'RevisionStorageTest_testUserWasLastToEdit', $ns ) );
727 $page->insertOn( $dbw );
730 'page' => $page->getId(),
732 'title' => $page->getTitle(),
733 'timestamp' =>
'20120101000000',
734 'user' => $userA->getId(),
737 'comment' =>
'edit zero'
739 $revisions[0]->insertOn( $dbw );
742 'page' => $page->getId(),
744 'title' => $page->getTitle(),
745 'timestamp' =>
'20120101000100',
746 'user' => $userA->getId(),
749 'comment' =>
'edit one'
751 $revisions[1]->insertOn( $dbw );
754 'page' => $page->getId(),
755 'title' => $page->getTitle(),
756 'timestamp' =>
'20120101000200',
757 'user' => $userB->getId(),
760 'comment' =>
'edit two'
762 $revisions[2]->insertOn( $dbw );
765 'page' => $page->getId(),
766 'title' => $page->getTitle(),
767 'timestamp' =>
'20120101000300',
768 'user' => $userA->getId(),
771 'comment' =>
'edit three'
773 $revisions[3]->insertOn( $dbw );
776 'page' => $page->getId(),
777 'title' => $page->getTitle(),
778 'timestamp' =>
'20120101000200',
779 'user' => $userA->getId(),
782 'comment' =>
'edit four'
784 $revisions[4]->insertOn( $dbw );
787 $since = $revisions[
$sinceIdx]->getTimestamp();
792 [
'rev_id',
'rev_timestamp',
'rev_user' =>
$revQuery[
'fields'][
'rev_user'] ],
794 'rev_page' => $page->getId(),
798 [
'ORDER BY' =>
'rev_timestamp ASC',
'LIMIT' => 50 ],
819 $title = Title::newFromText( $title );
822 $content = ContentHandler::makeContent( $text, $title, $model, $format );
832 'comment' =>
"testing",
833 'minor_edit' =>
false,
835 'content_format' => $format,
884 [
'hello world',
'Help:Hello',
null,
null, WikitextContentHandler::class ],
885 [
'hello world',
'User:hello/there.css',
null,
null, CssContentHandler::class ],
886 [
serialize(
'hello world' ),
'Dummy:Hello',
null,
null, DummyContentHandlerForTesting::class ],
928 $audience, $expectedSerialization
934 $expectedSerialization,
944 'page' => $this->testPage->getId(),
945 'content_model' => $this->testPage->getContentModel(),
952 "getContent() should return null if the revision's text blob could not be loaded." );
956 "getContent() should return null if the revision's text blob could not be loaded." );
1009 'title' => Title::newFromText(
"testGetContentClone_dummy" ),
1013 'comment' =>
"testing",
1014 'minor_edit' =>
false,
1029 $content2->setText(
"bla bla" );
1051 $rev = $this->testPage->getRevision();
1064 $this->testPage->getRevision(),
1074 $this->testPage->getRevision(),
1077 $this->testPage->getId(),
1078 $this->testPage->getLatest()
1087 $this->testPage->doEditContent(
new WikitextContent( __METHOD__ ), __METHOD__ );
1089 $this->testPage->getRevision()->getPrevious(),
1092 $this->testPage->getId(),
1093 $this->testPage->getRevision()->getPrevious()->getId()
1103 $this->testPage->getRevision(),
1113 $this->testPage->getRevision(),
1116 $this->testPage->getTitle(),
1117 $this->testPage->getLatest()
1126 $this->testPage->doEditContent(
new WikitextContent( __METHOD__ ), __METHOD__ );
1128 $this->testPage->getRevision()->getPrevious(),
1131 $this->testPage->getTitle(),
1132 $this->testPage->getRevision()->getPrevious()->getId()
1142 $this->testPage->getRevision(),
1145 $this->testPage->getTitle(),
1146 $this->testPage->getRevision()->getTimestamp()
1168 $text =
'831jr091jr0921kr21kr0921kjr0921j09rj1';
1169 $textLength =
strlen( $text );
1171 $this->testPage->doEditContent(
new WikitextContent( $text ), __METHOD__ );
1172 $rev[1] = $this->testPage->getLatest();
1175 [
$rev[1] => $textLength ],
1187 $textOne =
'831jr091jr0921kr21kr0921kjr0921j09rj1';
1188 $textOneLength =
strlen( $textOne );
1189 $textTwo =
'831jr091jr092121j09rj1';
1190 $textTwoLength =
strlen( $textTwo );
1192 $this->testPage->doEditContent(
new WikitextContent( $textOne ), __METHOD__ );
1193 $rev[1] = $this->testPage->getLatest();
1194 $this->testPage->doEditContent(
new WikitextContent( $textTwo ), __METHOD__ );
1195 $rev[2] = $this->testPage->getLatest();
1198 [
$rev[1] => $textOneLength,
$rev[2] => $textTwoLength ],
1211 $this->testPage->getTitle()->equals(
1212 $this->testPage->getRevision()->getTitle()
1221 $rev =
new Revision( [
'id' => $this->testPage->getLatest() ] );
1223 $this->testPage->getTitle()->equals(
1236 $this->testPage->doEditContent(
1243 $rev = $this->testPage->getRevision();
1252 $this->testPage->doEditContent(
1257 $rev = $this->testPage->getRevision();
1268 $this->testPage->doEditContent(
1272 $rev = $this->testPage->getRevision();
1286 $this->testPage->doEditContent(
1293 $rev = $this->testPage->getRevision();
1303 $rev = $this->testPage->getRevision();
1315 $rev = $this->testPage->getRevision();
1324 $expectedSummary =
'goatlicious summary';
1326 $this->testPage->doEditContent(
1330 $rev = $this->testPage->getRevision();
1339 $this->testPage->doEditContent(
new WikitextContent( __METHOD__ ), __METHOD__ );
1340 $rev = $this->testPage->getRevision();
1343 $this->
assertSame(
$rev->getRecentChange()->getAttribute(
'rc_id' ),
$rev->isUnpatrolled() );
1352 $this->testPage->doEditContent(
1359 $rev = $this->testPage->getRevision();
1374 $expectedText =
'testSimpleContentGetters in Revision. Goats love MCR...';
1375 $expectedSummary =
'goatlicious testSimpleContentGetters summary';
1377 $this->testPage->doEditContent(
1381 $rev = $this->testPage->getRevision();
1383 $this->
assertSame( $expectedText,
$rev->getContent()->getText() );
1385 $this->
assertSame( $this->testPage->getContentModel(),
$rev->getContentModel() );
1386 $this->
assertSame( $this->testPage->getContent()->getDefaultFormat(),
$rev->getContentFormat() );
1387 $this->
assertSame( $this->testPage->getContentHandler(),
$rev->getContentHandler() );
1401 $cache->setMockTime( $now );
1404 $this->testPage->doEditContent(
new WikitextContent( __METHOD__ ), __METHOD__ );
1405 $rev = $this->testPage->getRevision();
1408 $key =
$cache->makeGlobalKey(
1409 RevisionStore::ROW_CACHE_KEY,
1414 $cache->delete( $key, WANObjectCache::HOLDOFF_NONE );
1423 $cachedRow =
$cache->get( $key );
1431 $this->testPage->doEditContent(
new WikitextContent( __METHOD__ ), __METHOD__ );
1432 $rev = $this->testPage->getRevision();
1434 $pageId = $this->testPage->getId();
1447 yield [ 0, 0, [],
null,
true ];
1483 $title = Title::newFromText( $title );
1486 'wgGroupPermissions',
1489 'deletedtext' =>
true,
1490 'deletedhistory' =>
true,
1493 'viewsuppressed' =>
true,
1494 'suppressrevision' =>
true,
1498 $user = $this->
getTestUser( $userGroups )->getUser();
1517 yield [ 0, 0, [],
true ];
1537 public function testUserCan( $bitField, $field, $userGroups, $expected ) {
1539 'wgGroupPermissions',
1542 'deletedtext' =>
true,
1543 'deletedhistory' =>
true,
1546 'viewsuppressed' =>
true,
1547 'suppressrevision' =>
true,
1551 $user = $this->
getTestUser( $userGroups )->getUser();
1552 $revision =
new Revision( [
'deleted' => $bitField ], 0, $this->testPage->getTitle() );
1556 $revision->userCan( $field, $user )
1564 'slot_revision_id' => 42,
1565 'slot_content_id' => 1,
1566 'content_address' =>
'tt:789',
1568 'role_name' => SlotRecord::MAIN,
1574 $rec->setSlot( $slot );
1576 yield [
$rec, 789 ];
1584 $rev =
new Revision( $spec, 0, $this->testPage->getTitle() );
1599 $rev = $this->testPage->getRevisionRecord();
1602 $queryInfo[
'tables'] =
array_merge( $queryInfo[
'tables'], $queryInfoExtra[
'tables'] ?? [] );
1603 $queryInfo[
'fields'] =
array_merge( $queryInfo[
'fields'], $queryInfoExtra[
'fields'] ?? [] );
1604 $queryInfo[
'joins'] =
array_merge( $queryInfo[
'joins'], $queryInfoExtra[
'joins'] ?? [] );
1606 $conds = [
'rev_id' =>
$rev->getId() ];
1607 $row = $this->db->selectRow(
1608 $queryInfo[
'tables'],
1609 $queryInfo[
'fields'],
1616 $expected =
$rev->getContent( SlotRecord::MAIN )->serialize();
1618 $this->
hideDeprecated(
'Revision::getRevisionText (MCR without SCHEMA_COMPAT_WRITE_OLD)' );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
they could even be mouse clicks or menu items whatever suits your program You should also get your if any
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Simple store for keeping values in an associative array for the current process.
RevisionDbTestBase contains test cases for the Revision class that have Database interactions.
testLoadFromTitle()
Revision::loadFromTitle.
testNewNullRevision()
Revision::newNullRevision.
testNewKnownCurrent()
Revision::newKnownCurrent.
provideNewFromArchiveRow()
testLoadFromTitleWithNotLatestRevId()
Revision::loadFromTitle.
testUserCan( $bitField, $field, $userGroups, $expected)
provideUserCan Revision::userCan
testNewFromArchiveRowOverrides()
Revision::newFromArchiveRow.
testLoadFromPageIdWithNotLatestRevId()
Revision::loadFromPageId.
testGetContentHandler( $text, $title, $model, $format, $expectedClass)
provideGetContentHandler Revision::getContentHandler
testGetParentLengths_noRevIds()
Revision::getParentLengths.
testInsertOn_success()
Revision::insertOn.
assertRevEquals(Revision $orig, Revision $rev=null)
testGetComment_notDeleted()
Revision::getComment.
testNewKnownCurrent_withPageId()
provideGetContentHandler()
testGetVisibility_nothingDeleted()
Revision::getVisibility.
testGetContent_failure()
Revision::getContent.
testGetParentLengths_multipleRevIds()
Revision::getParentLengths.
testLoadFromId()
Revision::loadFromId.
testLoadFromPageId()
Revision::loadFromPageId.
testGetTitle_fromExistingRevision()
Revision::getTitle.
testNewFromTitle_withBadId()
Revision::newFromTitle.
testGetSize( $text, $model, $expected_size)
Revision::getSize provideGetSize.
createPage( $titleString, $text, $model=null)
testGetContentModel( $text, $title, $model, $format, $expectedModel)
provideGetContentModel Revision::getContentModel
testGetContent( $text, $title, $model, $format, $audience, $expectedSerialization)
provideGetContent Revision::getContent
testInsertOn()
Revision::insertOn.
testGetTimestamp()
Revision::getTimestamp.
testNewFromPageId()
Revision::newFromPageId.
testInsertOn_exceptionOnIncomplete( $array, $expException, $expMessage)
provideInsertOn_exceptionOnIncomplete Revision::insertOn
testGetUserAndText()
Revision::getUser Revision::getUserText.
testLoadFromTitleWithLatestRevId()
Revision::loadFromTitle.
testGetRecentChange()
Revision::getRecentChange.
provideInsertOn_exceptionOnIncomplete()
testGetSha1( $text, $model, $expected_hash)
Revision::getSha1 provideGetSha1.
testGetTitle_fromRevisionWhichWillLoadTheTitle()
Revision::getTitle.
testNewFromArchiveRow( $selectModifier)
provideNewFromArchiveRow Revision::newFromArchiveRow
testGetContentFormat( $text, $title, $model, $format, $expectedFormat)
provideGetContentFormat Revision::getContentFormat
testGetTextId( $spec, $expected)
provideGetTextId Revision::getTextId()
makeRevisionWithProps( $props=null)
testGetContentClone()
Tests whether $rev->getContent() returns a clone when needed.
testLoadFromTimestamp()
Revision::loadFromTimestamp()
testNewFromRow()
Revision::newFromRow.
testIsUnpatrolled_returnsRecentChangesId()
Revision::isUnpatrolled.
testNewNullRevision_badPage()
Revision::newNullRevision.
testGetRevisionText(array $queryInfoOptions, array $queryInfoExtra=[])
provideGetRevisionText Revision::getRevisionText
testIsDeleted_nothingDeleted()
Revision::isDeleted.
testNewFromTitle_withId()
Revision::newFromTitle.
static provideUserWasLastToEdit()
testIsMinor_false()
Revision::isMinor.
testLoadFromPageIdWithLatestRevId()
Revision::loadFromPageId.
testNewFromId()
Revision::newFromId.
testNewFromTitle_withoutId()
Revision::newFromTitle.
testUserCanBitfield( $bitField, $field, $userGroups, $title, $expected)
provideUserCanBitfield Revision::userCanBitfield
testNewFromPageIdWithLatestId()
Revision::newFromPageId.
testGetContentUncloned()
Tests whether $rev->getContent() returns the same object repeatedly if appropriate.
testIsCurrent()
Revision::isCurrent.
testGetPrevious()
Revision::getPrevious.
testGetParentLengths_oneRevId()
Revision::getParentLengths.
provideGetContentFormat()
testSimpleContentGetters()
This is a simple blanket test for all simple content getters and is methods to provide some coverage ...
testNewFromPageIdWithNotLatestId()
Revision::newFromPageId.
testIsMinor_true()
Revision::isMinor.
testNewKnownCurrent_returnsFalseWhenTitleDoesntExist()
testIsUnpatrolled_returnsZeroIfPatrolled()
Revision::isUnpatrolled.
testGetNext()
Revision::getNext.
__construct( $name=null, array $data=[], $dataName='')
testUserWasLastToEdit( $sinceIdx, $expectedLast)
Revision::userWasLastToEdit provideUserWasLastToEdit.
newTestRevision( $text, $title="Test", $model=CONTENT_MODEL_WIKITEXT, $format=null)
testGetPage()
Revision::getPage.
static newKnownCurrent(IDatabase $db, $pageIdOrTitle, $revId=0)
Load a revision based on a known page ID and current revision ID from the DB.
static getRevisionText( $row, $prefix='old_', $wiki=false)
Get revision text associated with an old or archive row.
static loadFromTitle( $db, $title, $id=0)
Load either the current, or a specified, revision that's attached to a given page.
static newFromPageId( $pageId, $revId=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given page ID.
getContentFormat()
Returns the content format for the main slot of this revision.
static loadFromTimestamp( $db, $title, $timestamp)
Load the revision for the given title with the given timestamp.
getPage()
Get the page ID.
static getArchiveQueryInfo()
Return the tables, fields, and join conditions to be selected to create a new archived revision objec...
static newNullRevision( $dbw, $pageId, $summary, $minor, $user=null)
Create a new null-revision for insertion into a page's history.
static loadFromId( $db, $id)
Load a page revision from a given revision ID number.
getContentModel()
Returns the content model for the main slot of this revision.
getUser( $audience=self::FOR_PUBLIC, User $user=null)
Fetch revision's user id if it's available to the specified audience.
static newFromArchiveRow( $row, $overrides=[])
Make a fake revision object from an archive table row.
static getQueryInfo( $options=[])
Return the tables, fields, and join conditions to be selected to create a new revision object.
static base36Sha1( $text)
Get the base 36 SHA-1 value for a string of text.
getSha1()
Returns the base36 sha1 of the content in this revision, or null if unknown.
static loadFromPageId( $db, $pageid, $id=0)
Load either the current, or a specified, revision that's attached to a given page.
static userCanBitfield( $bitfield, $field, User $user=null, Title $title=null)
Determine if the current user is allowed to view a particular field of this revision,...
static userWasLastToEdit( $db, $pageId, $userId, $since)
Check if no edits were made by other users since the time a user started editing the page.
static getParentLengths( $db, array $revIds)
Do a batched query to get the parent revision lengths.
static newFromTitle(LinkTarget $linkTarget, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target.
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
Content object implementation for representing flat text.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
static createNew( $name, $params=[])
Add a user to the database, return the user object.
Multi-datacenter aware caching interface.
Class representing a MediaWiki article and history.
Content object for wiki text pages.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title e g db for database replication lag or jobqueue for job queue size converted to pseudo seconds It is possible to add more fields and they will be returned to the user in the API response after the basic globals have been set but before ordinary actions take place or wrap services the preferred way to define a new service is the $wgServiceWiringFiles array $services
return true to allow those checks to and false if checking is done & $user
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
processing should stop and the error should be shown to the user * false
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
const CONTENT_MODEL_WIKITEXT
const CONTENT_FORMAT_WIKITEXT
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))