MediaWiki  1.29.1
RevisionStorageTest.php
Go to the documentation of this file.
1 <?php
2 
17  private $the_page;
18 
19  function __construct( $name = null, array $data = [], $dataName = '' ) {
20  parent::__construct( $name, $data, $dataName );
21 
22  $this->tablesUsed = array_merge( $this->tablesUsed,
23  [ 'page',
24  'revision',
25  'text',
26 
27  'recentchanges',
28  'logging',
29 
30  'page_props',
31  'pagelinks',
32  'categorylinks',
33  'langlinks',
34  'externallinks',
35  'imagelinks',
36  'templatelinks',
37  'iwlinks' ] );
38  }
39 
40  protected function setUp() {
41  global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang;
42 
43  parent::setUp();
44 
45  $wgExtraNamespaces[12312] = 'Dummy';
46  $wgExtraNamespaces[12313] = 'Dummy_talk';
47 
48  $wgNamespaceContentModels[12312] = 'DUMMY';
49  $wgContentHandlers['DUMMY'] = 'DummyContentHandlerForTesting';
50 
51  MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache
52  $wgContLang->resetNamespaces(); # reset namespace cache
53  if ( !$this->the_page ) {
54  $this->the_page = $this->createPage(
55  'RevisionStorageTest_the_page',
56  "just a dummy page",
58  );
59  }
60 
61  $this->tablesUsed[] = 'archive';
62  }
63 
64  protected function tearDown() {
65  global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang;
66 
67  parent::tearDown();
68 
69  unset( $wgExtraNamespaces[12312] );
70  unset( $wgExtraNamespaces[12313] );
71 
72  unset( $wgNamespaceContentModels[12312] );
73  unset( $wgContentHandlers['DUMMY'] );
74 
75  MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache
76  $wgContLang->resetNamespaces(); # reset namespace cache
77  }
78 
79  protected function makeRevision( $props = null ) {
80  if ( $props === null ) {
81  $props = [];
82  }
83 
84  if ( !isset( $props['content'] ) && !isset( $props['text'] ) ) {
85  $props['text'] = 'Lorem Ipsum';
86  }
87 
88  if ( !isset( $props['comment'] ) ) {
89  $props['comment'] = 'just a test';
90  }
91 
92  if ( !isset( $props['page'] ) ) {
93  $props['page'] = $this->the_page->getId();
94  }
95 
96  $rev = new Revision( $props );
97 
98  $dbw = wfGetDB( DB_MASTER );
99  $rev->insertOn( $dbw );
100 
101  return $rev;
102  }
103 
104  protected function createPage( $page, $text, $model = null ) {
105  if ( is_string( $page ) ) {
106  if ( !preg_match( '/:/', $page ) &&
107  ( $model === null || $model === CONTENT_MODEL_WIKITEXT )
108  ) {
109  $ns = $this->getDefaultWikitextNS();
110  $page = MWNamespace::getCanonicalName( $ns ) . ':' . $page;
111  }
112 
114  }
115 
116  if ( $page instanceof Title ) {
117  $page = new WikiPage( $page );
118  }
119 
120  if ( $page->exists() ) {
121  $page->doDeleteArticle( "done" );
122  }
123 
124  $content = ContentHandler::makeContent( $text, $page->getTitle(), $model );
125  $page->doEditContent( $content, "testing", EDIT_NEW );
126 
127  return $page;
128  }
129 
130  protected function assertRevEquals( Revision $orig, Revision $rev = null ) {
131  $this->assertNotNull( $rev, 'missing revision' );
132 
133  $this->assertEquals( $orig->getId(), $rev->getId() );
134  $this->assertEquals( $orig->getPage(), $rev->getPage() );
135  $this->assertEquals( $orig->getTimestamp(), $rev->getTimestamp() );
136  $this->assertEquals( $orig->getUser(), $rev->getUser() );
137  $this->assertEquals( $orig->getContentModel(), $rev->getContentModel() );
138  $this->assertEquals( $orig->getContentFormat(), $rev->getContentFormat() );
139  $this->assertEquals( $orig->getSha1(), $rev->getSha1() );
140  }
141 
145  public function testConstructFromRow() {
146  $orig = $this->makeRevision();
147 
148  $dbr = wfGetDB( DB_SLAVE );
149  $res = $dbr->select( 'revision', '*', [ 'rev_id' => $orig->getId() ] );
150  $this->assertTrue( is_object( $res ), 'query failed' );
151 
152  $row = $res->fetchObject();
153  $res->free();
154 
155  $rev = new Revision( $row );
156 
157  $this->assertRevEquals( $orig, $rev );
158  }
159 
163  public function testNewFromRow() {
164  $orig = $this->makeRevision();
165 
166  $dbr = wfGetDB( DB_SLAVE );
167  $res = $dbr->select( 'revision', '*', [ 'rev_id' => $orig->getId() ] );
168  $this->assertTrue( is_object( $res ), 'query failed' );
169 
170  $row = $res->fetchObject();
171  $res->free();
172 
173  $rev = Revision::newFromRow( $row );
174 
175  $this->assertRevEquals( $orig, $rev );
176  }
177 
181  public function testNewFromArchiveRow() {
182  $page = $this->createPage(
183  'RevisionStorageTest_testNewFromArchiveRow',
184  'Lorem Ipsum',
186  );
187  $orig = $page->getRevision();
188  $page->doDeleteArticle( 'test Revision::newFromArchiveRow' );
189 
190  $dbr = wfGetDB( DB_SLAVE );
191  $res = $dbr->select( 'archive', '*', [ 'ar_rev_id' => $orig->getId() ] );
192  $this->assertTrue( is_object( $res ), 'query failed' );
193 
194  $row = $res->fetchObject();
195  $res->free();
196 
198 
199  $this->assertRevEquals( $orig, $rev );
200  }
201 
205  public function testNewFromId() {
206  $orig = $this->makeRevision();
207 
208  $rev = Revision::newFromId( $orig->getId() );
209 
210  $this->assertRevEquals( $orig, $rev );
211  }
212 
216  public function testFetchRevision() {
217  $page = $this->createPage(
218  'RevisionStorageTest_testFetchRevision',
219  'one',
221  );
222 
223  // Hidden process cache assertion below
224  $page->getRevision()->getId();
225 
226  $page->doEditContent( new WikitextContent( 'two' ), 'second rev' );
227  $id = $page->getRevision()->getId();
228 
229  $res = Revision::fetchRevision( $page->getTitle() );
230 
231  # note: order is unspecified
232  $rows = [];
233  while ( ( $row = $res->fetchObject() ) ) {
234  $rows[$row->rev_id] = $row;
235  }
236 
237  $this->assertEquals( 1, count( $rows ), 'expected exactly one revision' );
238  $this->assertArrayHasKey( $id, $rows, 'missing revision with id ' . $id );
239  }
240 
244  public function testSelectFields() {
245  global $wgContentHandlerUseDB;
246 
247  $fields = Revision::selectFields();
248 
249  $this->assertTrue( in_array( 'rev_id', $fields ), 'missing rev_id in list of fields' );
250  $this->assertTrue( in_array( 'rev_page', $fields ), 'missing rev_page in list of fields' );
251  $this->assertTrue(
252  in_array( 'rev_timestamp', $fields ),
253  'missing rev_timestamp in list of fields'
254  );
255  $this->assertTrue( in_array( 'rev_user', $fields ), 'missing rev_user in list of fields' );
256 
257  if ( $wgContentHandlerUseDB ) {
258  $this->assertTrue( in_array( 'rev_content_model', $fields ),
259  'missing rev_content_model in list of fields' );
260  $this->assertTrue( in_array( 'rev_content_format', $fields ),
261  'missing rev_content_format in list of fields' );
262  }
263  }
264 
268  public function testGetPage() {
270 
271  $orig = $this->makeRevision( [ 'page' => $page->getId() ] );
272  $rev = Revision::newFromId( $orig->getId() );
273 
274  $this->assertEquals( $page->getId(), $rev->getPage() );
275  }
276 
280  public function testGetContent_failure() {
281  $rev = new Revision( [
282  'page' => $this->the_page->getId(),
283  'content_model' => $this->the_page->getContentModel(),
284  'text_id' => 123456789, // not in the test DB
285  ] );
286 
287  $this->assertNull( $rev->getContent(),
288  "getContent() should return null if the revision's text blob could not be loaded." );
289 
290  // NOTE: check this twice, once for lazy initialization, and once with the cached value.
291  $this->assertNull( $rev->getContent(),
292  "getContent() should return null if the revision's text blob could not be loaded." );
293  }
294 
298  public function testGetContent() {
299  $orig = $this->makeRevision( [ 'text' => 'hello hello.' ] );
300  $rev = Revision::newFromId( $orig->getId() );
301 
302  $this->assertEquals( 'hello hello.', $rev->getContent()->getNativeData() );
303  }
304 
308  public function testGetContentModel() {
309  global $wgContentHandlerUseDB;
310 
311  if ( !$wgContentHandlerUseDB ) {
312  $this->markTestSkipped( '$wgContentHandlerUseDB is disabled' );
313  }
314 
315  $orig = $this->makeRevision( [ 'text' => 'hello hello.',
316  'content_model' => CONTENT_MODEL_JAVASCRIPT ] );
317  $rev = Revision::newFromId( $orig->getId() );
318 
319  $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContentModel() );
320  }
321 
325  public function testGetContentFormat() {
326  global $wgContentHandlerUseDB;
327 
328  if ( !$wgContentHandlerUseDB ) {
329  $this->markTestSkipped( '$wgContentHandlerUseDB is disabled' );
330  }
331 
332  $orig = $this->makeRevision( [
333  'text' => 'hello hello.',
334  'content_model' => CONTENT_MODEL_JAVASCRIPT,
335  'content_format' => CONTENT_FORMAT_JAVASCRIPT
336  ] );
337  $rev = Revision::newFromId( $orig->getId() );
338 
339  $this->assertEquals( CONTENT_FORMAT_JAVASCRIPT, $rev->getContentFormat() );
340  }
341 
345  public function testIsCurrent() {
346  $page = $this->createPage(
347  'RevisionStorageTest_testIsCurrent',
348  'Lorem Ipsum',
350  );
351  $rev1 = $page->getRevision();
352 
353  # @todo find out if this should be true
354  # $this->assertTrue( $rev1->isCurrent() );
355 
356  $rev1x = Revision::newFromId( $rev1->getId() );
357  $this->assertTrue( $rev1x->isCurrent() );
358 
359  $page->doEditContent(
360  ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ),
361  'second rev'
362  );
363  $rev2 = $page->getRevision();
364 
365  # @todo find out if this should be true
366  # $this->assertTrue( $rev2->isCurrent() );
367 
368  $rev1x = Revision::newFromId( $rev1->getId() );
369  $this->assertFalse( $rev1x->isCurrent() );
370 
371  $rev2x = Revision::newFromId( $rev2->getId() );
372  $this->assertTrue( $rev2x->isCurrent() );
373  }
374 
378  public function testGetPrevious() {
379  $page = $this->createPage(
380  'RevisionStorageTest_testGetPrevious',
381  'Lorem Ipsum testGetPrevious',
383  );
384  $rev1 = $page->getRevision();
385 
386  $this->assertNull( $rev1->getPrevious() );
387 
388  $page->doEditContent(
389  ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ),
390  'second rev testGetPrevious' );
391  $rev2 = $page->getRevision();
392 
393  $this->assertNotNull( $rev2->getPrevious() );
394  $this->assertEquals( $rev1->getId(), $rev2->getPrevious()->getId() );
395  }
396 
400  public function testGetNext() {
401  $page = $this->createPage(
402  'RevisionStorageTest_testGetNext',
403  'Lorem Ipsum testGetNext',
405  );
406  $rev1 = $page->getRevision();
407 
408  $this->assertNull( $rev1->getNext() );
409 
410  $page->doEditContent(
411  ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ),
412  'second rev testGetNext'
413  );
414  $rev2 = $page->getRevision();
415 
416  $this->assertNotNull( $rev1->getNext() );
417  $this->assertEquals( $rev2->getId(), $rev1->getNext()->getId() );
418  }
419 
423  public function testNewNullRevision() {
424  $page = $this->createPage(
425  'RevisionStorageTest_testNewNullRevision',
426  'some testing text',
428  );
429  $orig = $page->getRevision();
430 
431  $dbw = wfGetDB( DB_MASTER );
432  $rev = Revision::newNullRevision( $dbw, $page->getId(), 'a null revision', false );
433 
434  $this->assertNotEquals( $orig->getId(), $rev->getId(),
435  'new null revision shold have a different id from the original revision' );
436  $this->assertEquals( $orig->getTextId(), $rev->getTextId(),
437  'new null revision shold have the same text id as the original revision' );
438  $this->assertEquals( 'some testing text', $rev->getContent()->getNativeData() );
439  }
440 
441  public static function provideUserWasLastToEdit() {
442  return [
443  [ # 0
444  3, true, # actually the last edit
445  ],
446  [ # 1
447  2, true, # not the current edit, but still by this user
448  ],
449  [ # 2
450  1, false, # edit by another user
451  ],
452  [ # 3
453  0, false, # first edit, by this user, but another user edited in the mean time
454  ],
455  ];
456  }
457 
461  public function testUserWasLastToEdit( $sinceIdx, $expectedLast ) {
462  $userA = User::newFromName( "RevisionStorageTest_userA" );
463  $userB = User::newFromName( "RevisionStorageTest_userB" );
464 
465  if ( $userA->getId() === 0 ) {
466  $userA = User::createNew( $userA->getName() );
467  }
468 
469  if ( $userB->getId() === 0 ) {
470  $userB = User::createNew( $userB->getName() );
471  }
472 
473  $ns = $this->getDefaultWikitextNS();
474 
475  $dbw = wfGetDB( DB_MASTER );
476  $revisions = [];
477 
478  // create revisions -----------------------------
480  'RevisionStorageTest_testUserWasLastToEdit', $ns ) );
481  $page->insertOn( $dbw );
482 
483  # zero
484  $revisions[0] = new Revision( [
485  'page' => $page->getId(),
486  // we need the title to determine the page's default content model
487  'title' => $page->getTitle(),
488  'timestamp' => '20120101000000',
489  'user' => $userA->getId(),
490  'text' => 'zero',
491  'content_model' => CONTENT_MODEL_WIKITEXT,
492  'summary' => 'edit zero'
493  ] );
494  $revisions[0]->insertOn( $dbw );
495 
496  # one
497  $revisions[1] = new Revision( [
498  'page' => $page->getId(),
499  // still need the title, because $page->getId() is 0 (there's no entry in the page table)
500  'title' => $page->getTitle(),
501  'timestamp' => '20120101000100',
502  'user' => $userA->getId(),
503  'text' => 'one',
504  'content_model' => CONTENT_MODEL_WIKITEXT,
505  'summary' => 'edit one'
506  ] );
507  $revisions[1]->insertOn( $dbw );
508 
509  # two
510  $revisions[2] = new Revision( [
511  'page' => $page->getId(),
512  'title' => $page->getTitle(),
513  'timestamp' => '20120101000200',
514  'user' => $userB->getId(),
515  'text' => 'two',
516  'content_model' => CONTENT_MODEL_WIKITEXT,
517  'summary' => 'edit two'
518  ] );
519  $revisions[2]->insertOn( $dbw );
520 
521  # three
522  $revisions[3] = new Revision( [
523  'page' => $page->getId(),
524  'title' => $page->getTitle(),
525  'timestamp' => '20120101000300',
526  'user' => $userA->getId(),
527  'text' => 'three',
528  'content_model' => CONTENT_MODEL_WIKITEXT,
529  'summary' => 'edit three'
530  ] );
531  $revisions[3]->insertOn( $dbw );
532 
533  # four
534  $revisions[4] = new Revision( [
535  'page' => $page->getId(),
536  'title' => $page->getTitle(),
537  'timestamp' => '20120101000200',
538  'user' => $userA->getId(),
539  'text' => 'zero',
540  'content_model' => CONTENT_MODEL_WIKITEXT,
541  'summary' => 'edit four'
542  ] );
543  $revisions[4]->insertOn( $dbw );
544 
545  // test it ---------------------------------
546  $since = $revisions[$sinceIdx]->getTimestamp();
547 
548  $wasLast = Revision::userWasLastToEdit( $dbw, $page->getId(), $userA->getId(), $since );
549 
550  $this->assertEquals( $expectedLast, $wasLast );
551  }
552 }
Revision\newFromArchiveRow
static newFromArchiveRow( $row, $overrides=[])
Make a fake revision object from an archive table row.
Definition: Revision.php:189
function
when a variable name is used in a function
Definition: design.txt:93
RevisionStorageTest\__construct
__construct( $name=null, array $data=[], $dataName='')
Definition: RevisionStorageTest.php:19
RevisionStorageTest\testNewFromRow
testNewFromRow()
Revision::newFromRow.
Definition: RevisionStorageTest.php:163
Revision\getTimestamp
getTimestamp()
Definition: Revision.php:1178
if
if($IP===false)
Definition: cleanupArchiveUserText.php:4
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:265
false
processing should stop and the error should be shown to the user * false
Definition: hooks.txt:189
Revision\newFromId
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
Definition: Revision.php:116
Revision\getUser
getUser( $audience=self::FOR_PUBLIC, User $user=null)
Fetch revision's user id if it's available to the specified audience.
Definition: Revision.php:869
RevisionStorageTest\testNewNullRevision
testNewNullRevision()
Revision::newNullRevision.
Definition: RevisionStorageTest.php:423
captcha-old.count
count
Definition: captcha-old.py:225
Revision\getPage
getPage()
Get the page ID.
Definition: Revision.php:852
RevisionStorageTest\createPage
createPage( $page, $text, $model=null)
Definition: RevisionStorageTest.php:104
WikiPage
Class representing a MediaWiki article and history.
Definition: WikiPage.php:36
User\newFromName
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition: User.php:556
DB_SLAVE
const DB_SLAVE
Definition: Defines.php:34
$res
$res
Definition: database.txt:21
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:304
CONTENT_MODEL_WIKITEXT
const CONTENT_MODEL_WIKITEXT
Definition: Defines.php:233
Revision\getSha1
getSha1()
Returns the base36 sha1 of the text in this revision, or null if unknown.
Definition: Revision.php:798
Revision\getId
getId()
Get revision ID.
Definition: Revision.php:735
Revision\getContentModel
getContentModel()
Returns the content model for this revision.
Definition: Revision.php:1118
RevisionStorageTest\testUserWasLastToEdit
testUserWasLastToEdit( $sinceIdx, $expectedLast)
provideUserWasLastToEdit
Definition: RevisionStorageTest.php:461
Revision\insertOn
insertOn( $dbw)
Insert a new revision into the database, returning the new revision ID number on success and dies hor...
Definition: Revision.php:1398
RevisionStorageTest\setUp
setUp()
Definition: RevisionStorageTest.php:40
cache
you have access to all of the normal MediaWiki so you can get a DB use the cache
Definition: maintenance.txt:52
edited
The ContentHandler facility adds support for arbitrary content types on wiki instead of relying on wikitext for everything It was introduced in MediaWiki Each kind of edited
Definition: contenthandler.txt:5
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
User\createNew
static createNew( $name, $params=[])
Add a user to the database, return the user object.
Definition: User.php:4081
Revision
Definition: Revision.php:33
RevisionStorageTest\testConstructFromRow
testConstructFromRow()
Revision::__construct.
Definition: RevisionStorageTest.php:145
RevisionStorageTest\testIsCurrent
testIsCurrent()
Revision::isCurrent.
Definition: RevisionStorageTest.php:345
WikiPage\factory
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
Definition: WikiPage.php:120
user
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same user
Definition: distributors.txt:9
$wgContentHandlers
$wgContentHandlers
Plugins for page content model handling.
Definition: DefaultSettings.php:969
RevisionStorageTest\testNewFromId
testNewFromId()
Revision::newFromId.
Definition: RevisionStorageTest.php:205
RevisionStorageTest\provideUserWasLastToEdit
static provideUserWasLastToEdit()
Definition: RevisionStorageTest.php:441
$content
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
Definition: hooks.txt:1049
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:3060
$page
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached $page
Definition: hooks.txt:2536
RevisionStorageTest\testGetContent_failure
testGetContent_failure()
Revision::getContent.
Definition: RevisionStorageTest.php:280
in
null for the wiki Added in
Definition: hooks.txt:1572
MediaWikiTestCase
Definition: MediaWikiTestCase.php:13
not
if not
Definition: COPYING.txt:307
RevisionStorageTest\testGetContentFormat
testGetContentFormat()
Revision::getContentFormat.
Definition: RevisionStorageTest.php:325
MediaWikiTestCase\getDefaultWikitextNS
getDefaultWikitextNS()
Returns the ID of a namespace that defaults to Wikitext.
Definition: MediaWikiTestCase.php:1639
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
DB_MASTER
const DB_MASTER
Definition: defines.php:26
WikitextContent
Content object for wiki text pages.
Definition: WikitextContent.php:33
by
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable or merely the Work and Derivative Works thereof Contribution shall mean any work of including the original version of the Work and any modifications or additions to that Work or Derivative Works that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner For the purposes of this submitted means any form of or written communication sent to the Licensor or its including but not limited to communication on electronic mailing source code control and issue tracking systems that are managed by
Definition: APACHE-LICENSE-2.0.txt:49
RevisionStorageTest\testNewFromArchiveRow
testNewFromArchiveRow()
Revision::newFromArchiveRow.
Definition: RevisionStorageTest.php:181
RevisionStorageTest\testSelectFields
testSelectFields()
Revision::selectFields.
Definition: RevisionStorageTest.php:244
ContentHandler\makeContent
static makeContent( $text, Title $title=null, $modelId=null, $format=null)
Convenience function for creating a Content object from a given textual representation.
Definition: ContentHandler.php:129
RevisionStorageTest\tearDown
tearDown()
Definition: RevisionStorageTest.php:64
RevisionStorageTest\testGetPage
testGetPage()
Revision::getPage.
Definition: RevisionStorageTest.php:268
Revision\userWasLastToEdit
static userWasLastToEdit( $db, $pageId, $userId, $since)
Check if no edits were made by other users since the time a user started editing the page.
Definition: Revision.php:1883
RevisionStorageTest\testFetchRevision
testFetchRevision()
Revision::fetchRevision.
Definition: RevisionStorageTest.php:216
Revision\newFromRow
static newFromRow( $row)
Definition: Revision.php:236
RevisionStorageTest\assertRevEquals
assertRevEquals(Revision $orig, Revision $rev=null)
Definition: RevisionStorageTest.php:130
RevisionStorageTest\testGetPrevious
testGetPrevious()
Revision::getPrevious.
Definition: RevisionStorageTest.php:378
Revision\getContentFormat
getContentFormat()
Returns the content format for this revision.
Definition: Revision.php:1142
RevisionStorageTest\makeRevision
makeRevision( $props=null)
Definition: RevisionStorageTest.php:79
EDIT_NEW
const EDIT_NEW
Definition: Defines.php:150
Revision\fetchRevision
static fetchRevision(LinkTarget $title)
Return a wrapper for a series of database rows to fetch all of a given page's revisions in turn.
Definition: Revision.php:380
RevisionStorageTest\testGetContentModel
testGetContentModel()
Revision::getContentModel.
Definition: RevisionStorageTest.php:308
Title
Represents a title within MediaWiki.
Definition: Title.php:39
$dbr
if(! $regexes) $dbr
Definition: cleanup.php:94
$rev
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
Definition: hooks.txt:1741
MWNamespace\getCanonicalNamespaces
static getCanonicalNamespaces( $rebuild=false)
Returns array of all defined namespaces with their canonical (English) names.
Definition: MWNamespace.php:207
RevisionStorageTest\$the_page
$the_page
Definition: RevisionStorageTest.php:17
Revision\newNullRevision
static newNullRevision( $dbw, $pageId, $summary, $minor, $user=null)
Create a new null-revision for insertion into a page's history.
Definition: Revision.php:1693
CONTENT_MODEL_JAVASCRIPT
const CONTENT_MODEL_JAVASCRIPT
Definition: Defines.php:234
CONTENT_FORMAT_JAVASCRIPT
const CONTENT_FORMAT_JAVASCRIPT
Definition: Defines.php:250
Revision\selectFields
static selectFields()
Return the list of revision fields that should be selected to create a new revision.
Definition: Revision.php:448
RevisionStorageTest\testGetContent
testGetContent()
Revision::getContent.
Definition: RevisionStorageTest.php:298
RevisionStorageTest\testGetNext
testGetNext()
Revision::getNext.
Definition: RevisionStorageTest.php:400
MWNamespace\getCanonicalName
static getCanonicalName( $index)
Returns the canonical (English) name for a given index.
Definition: MWNamespace.php:228
RevisionStorageTest
Test class for Revision storage.
Definition: RevisionStorageTest.php:13
array
the array() calling protocol came about after MediaWiki 1.4rc1.
$wgContLang
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
Definition: design.txt:56