MediaWiki  1.23.6
RevisionStorageTest.php
Go to the documentation of this file.
1 <?php
2 
14 
18  var $the_page;
19 
20  function __construct( $name = null, array $data = array(), $dataName = '' ) {
21  parent::__construct( $name, $data, $dataName );
22 
23  $this->tablesUsed = array_merge( $this->tablesUsed,
24  array( 'page',
25  'revision',
26  'text',
27 
28  'recentchanges',
29  'logging',
30 
31  'page_props',
32  'pagelinks',
33  'categorylinks',
34  'langlinks',
35  'externallinks',
36  'imagelinks',
37  'templatelinks',
38  'iwlinks' ) );
39  }
40 
41  protected function setUp() {
42  global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang;
43 
44  parent::setUp();
45 
46  $wgExtraNamespaces[12312] = 'Dummy';
47  $wgExtraNamespaces[12313] = 'Dummy_talk';
48 
49  $wgNamespaceContentModels[12312] = 'DUMMY';
50  $wgContentHandlers['DUMMY'] = 'DummyContentHandlerForTesting';
51 
52  MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache
53  $wgContLang->resetNamespaces(); # reset namespace cache
54  if ( !$this->the_page ) {
55  $this->the_page = $this->createPage( 'RevisionStorageTest_the_page', "just a dummy page", CONTENT_MODEL_WIKITEXT );
56  }
57  }
58 
59  protected function tearDown() {
60  global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang;
61 
62  parent::tearDown();
63 
64  unset( $wgExtraNamespaces[12312] );
65  unset( $wgExtraNamespaces[12313] );
66 
67  unset( $wgNamespaceContentModels[12312] );
68  unset( $wgContentHandlers['DUMMY'] );
69 
70  MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache
71  $wgContLang->resetNamespaces(); # reset namespace cache
72  }
73 
74  protected function makeRevision( $props = null ) {
75  if ( $props === null ) {
76  $props = array();
77  }
78 
79  if ( !isset( $props['content'] ) && !isset( $props['text'] ) ) {
80  $props['text'] = 'Lorem Ipsum';
81  }
82 
83  if ( !isset( $props['comment'] ) ) {
84  $props['comment'] = 'just a test';
85  }
86 
87  if ( !isset( $props['page'] ) ) {
88  $props['page'] = $this->the_page->getId();
89  }
90 
91  $rev = new Revision( $props );
92 
93  $dbw = wfgetDB( DB_MASTER );
94  $rev->insertOn( $dbw );
95 
96  return $rev;
97  }
98 
99  protected function createPage( $page, $text, $model = null ) {
100  if ( is_string( $page ) ) {
101  if ( !preg_match( '/:/', $page ) &&
102  ( $model === null || $model === CONTENT_MODEL_WIKITEXT )
103  ) {
104  $ns = $this->getDefaultWikitextNS();
105  $page = MWNamespace::getCanonicalName( $ns ) . ':' . $page;
106  }
107 
108  $page = Title::newFromText( $page );
109  }
110 
111  if ( $page instanceof Title ) {
112  $page = new WikiPage( $page );
113  }
114 
115  if ( $page->exists() ) {
116  $page->doDeleteArticle( "done" );
117  }
118 
119  $content = ContentHandler::makeContent( $text, $page->getTitle(), $model );
120  $page->doEditContent( $content, "testing", EDIT_NEW );
121 
122  return $page;
123  }
124 
125  protected function assertRevEquals( Revision $orig, Revision $rev = null ) {
126  $this->assertNotNull( $rev, 'missing revision' );
127 
128  $this->assertEquals( $orig->getId(), $rev->getId() );
129  $this->assertEquals( $orig->getPage(), $rev->getPage() );
130  $this->assertEquals( $orig->getTimestamp(), $rev->getTimestamp() );
131  $this->assertEquals( $orig->getUser(), $rev->getUser() );
132  $this->assertEquals( $orig->getContentModel(), $rev->getContentModel() );
133  $this->assertEquals( $orig->getContentFormat(), $rev->getContentFormat() );
134  $this->assertEquals( $orig->getSha1(), $rev->getSha1() );
135  }
136 
140  public function testConstructFromRow() {
141  $orig = $this->makeRevision();
142 
143  $dbr = wfgetDB( DB_SLAVE );
144  $res = $dbr->select( 'revision', '*', array( 'rev_id' => $orig->getId() ) );
145  $this->assertTrue( is_object( $res ), 'query failed' );
146 
147  $row = $res->fetchObject();
148  $res->free();
149 
150  $rev = new Revision( $row );
151 
152  $this->assertRevEquals( $orig, $rev );
153  }
154 
158  public function testNewFromRow() {
159  $orig = $this->makeRevision();
160 
161  $dbr = wfgetDB( DB_SLAVE );
162  $res = $dbr->select( 'revision', '*', array( 'rev_id' => $orig->getId() ) );
163  $this->assertTrue( is_object( $res ), 'query failed' );
164 
165  $row = $res->fetchObject();
166  $res->free();
167 
168  $rev = Revision::newFromRow( $row );
169 
170  $this->assertRevEquals( $orig, $rev );
171  }
172 
176  public function testNewFromArchiveRow() {
177  $page = $this->createPage( 'RevisionStorageTest_testNewFromArchiveRow', 'Lorem Ipsum', CONTENT_MODEL_WIKITEXT );
178  $orig = $page->getRevision();
179  $page->doDeleteArticle( 'test Revision::newFromArchiveRow' );
180 
181  $dbr = wfgetDB( DB_SLAVE );
182  $res = $dbr->select( 'archive', '*', array( 'ar_rev_id' => $orig->getId() ) );
183  $this->assertTrue( is_object( $res ), 'query failed' );
184 
185  $row = $res->fetchObject();
186  $res->free();
187 
189 
190  $this->assertRevEquals( $orig, $rev );
191  }
192 
196  public function testNewFromId() {
197  $orig = $this->makeRevision();
198 
199  $rev = Revision::newFromId( $orig->getId() );
200 
201  $this->assertRevEquals( $orig, $rev );
202  }
203 
207  public function testFetchRevision() {
208  $page = $this->createPage( 'RevisionStorageTest_testFetchRevision', 'one', CONTENT_MODEL_WIKITEXT );
209 
210  // Hidden process cache assertion below
211  $page->getRevision()->getId();
212 
213  $page->doEditContent( new WikitextContent( 'two' ), 'second rev' );
214  $id = $page->getRevision()->getId();
215 
216  $res = Revision::fetchRevision( $page->getTitle() );
217 
218  #note: order is unspecified
219  $rows = array();
220  while ( ( $row = $res->fetchObject() ) ) {
221  $rows[$row->rev_id] = $row;
222  }
223 
224  $this->assertEquals( 1, count( $rows ), 'expected exactly one revision' );
225  $this->assertArrayHasKey( $id, $rows, 'missing revision with id ' . $id );
226  }
227 
231  public function testSelectFields() {
232  global $wgContentHandlerUseDB;
233 
234  $fields = Revision::selectFields();
235 
236  $this->assertTrue( in_array( 'rev_id', $fields ), 'missing rev_id in list of fields' );
237  $this->assertTrue( in_array( 'rev_page', $fields ), 'missing rev_page in list of fields' );
238  $this->assertTrue( in_array( 'rev_timestamp', $fields ), 'missing rev_timestamp in list of fields' );
239  $this->assertTrue( in_array( 'rev_user', $fields ), 'missing rev_user in list of fields' );
240 
241  if ( $wgContentHandlerUseDB ) {
242  $this->assertTrue( in_array( 'rev_content_model', $fields ),
243  'missing rev_content_model in list of fields' );
244  $this->assertTrue( in_array( 'rev_content_format', $fields ),
245  'missing rev_content_format in list of fields' );
246  }
247  }
248 
252  public function testGetPage() {
253  $page = $this->the_page;
254 
255  $orig = $this->makeRevision( array( 'page' => $page->getId() ) );
256  $rev = Revision::newFromId( $orig->getId() );
257 
258  $this->assertEquals( $page->getId(), $rev->getPage() );
259  }
260 
264  public function testGetText() {
265  $this->hideDeprecated( 'Revision::getText' );
266 
267  $orig = $this->makeRevision( array( 'text' => 'hello hello.' ) );
268  $rev = Revision::newFromId( $orig->getId() );
269 
270  $this->assertEquals( 'hello hello.', $rev->getText() );
271  }
272 
276  public function testGetContent_failure() {
277  $rev = new Revision( array(
278  'page' => $this->the_page->getId(),
279  'content_model' => $this->the_page->getContentModel(),
280  'text_id' => 123456789, // not in the test DB
281  ) );
282 
283  $this->assertNull( $rev->getContent(),
284  "getContent() should return null if the revision's text blob could not be loaded." );
285 
286  //NOTE: check this twice, once for lazy initialization, and once with the cached value.
287  $this->assertNull( $rev->getContent(),
288  "getContent() should return null if the revision's text blob could not be loaded." );
289  }
290 
294  public function testGetContent() {
295  $orig = $this->makeRevision( array( 'text' => 'hello hello.' ) );
296  $rev = Revision::newFromId( $orig->getId() );
297 
298  $this->assertEquals( 'hello hello.', $rev->getContent()->getNativeData() );
299  }
300 
304  public function testGetRawText() {
305  $this->hideDeprecated( 'Revision::getRawText' );
306 
307  $orig = $this->makeRevision( array( 'text' => 'hello hello raw.' ) );
308  $rev = Revision::newFromId( $orig->getId() );
309 
310  $this->assertEquals( 'hello hello raw.', $rev->getRawText() );
311  }
312 
316  public function testGetContentModel() {
317  global $wgContentHandlerUseDB;
318 
319  if ( !$wgContentHandlerUseDB ) {
320  $this->markTestSkipped( '$wgContentHandlerUseDB is disabled' );
321  }
322 
323  $orig = $this->makeRevision( array( 'text' => 'hello hello.',
324  'content_model' => CONTENT_MODEL_JAVASCRIPT ) );
325  $rev = Revision::newFromId( $orig->getId() );
326 
327  $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContentModel() );
328  }
329 
333  public function testGetContentFormat() {
334  global $wgContentHandlerUseDB;
335 
336  if ( !$wgContentHandlerUseDB ) {
337  $this->markTestSkipped( '$wgContentHandlerUseDB is disabled' );
338  }
339 
340  $orig = $this->makeRevision( array(
341  'text' => 'hello hello.',
342  'content_model' => CONTENT_MODEL_JAVASCRIPT,
343  'content_format' => CONTENT_FORMAT_JAVASCRIPT
344  ) );
345  $rev = Revision::newFromId( $orig->getId() );
346 
347  $this->assertEquals( CONTENT_FORMAT_JAVASCRIPT, $rev->getContentFormat() );
348  }
349 
353  public function testIsCurrent() {
354  $page = $this->createPage( 'RevisionStorageTest_testIsCurrent', 'Lorem Ipsum', CONTENT_MODEL_WIKITEXT );
355  $rev1 = $page->getRevision();
356 
357  # @todo find out if this should be true
358  # $this->assertTrue( $rev1->isCurrent() );
359 
360  $rev1x = Revision::newFromId( $rev1->getId() );
361  $this->assertTrue( $rev1x->isCurrent() );
362 
363  $page->doEditContent( ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ), 'second rev' );
364  $rev2 = $page->getRevision();
365 
366  # @todo find out if this should be true
367  # $this->assertTrue( $rev2->isCurrent() );
368 
369  $rev1x = Revision::newFromId( $rev1->getId() );
370  $this->assertFalse( $rev1x->isCurrent() );
371 
372  $rev2x = Revision::newFromId( $rev2->getId() );
373  $this->assertTrue( $rev2x->isCurrent() );
374  }
375 
379  public function testGetPrevious() {
380  $page = $this->createPage( 'RevisionStorageTest_testGetPrevious', 'Lorem Ipsum testGetPrevious', CONTENT_MODEL_WIKITEXT );
381  $rev1 = $page->getRevision();
382 
383  $this->assertNull( $rev1->getPrevious() );
384 
385  $page->doEditContent( ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ),
386  'second rev testGetPrevious' );
387  $rev2 = $page->getRevision();
388 
389  $this->assertNotNull( $rev2->getPrevious() );
390  $this->assertEquals( $rev1->getId(), $rev2->getPrevious()->getId() );
391  }
392 
396  public function testGetNext() {
397  $page = $this->createPage( 'RevisionStorageTest_testGetNext', 'Lorem Ipsum testGetNext', CONTENT_MODEL_WIKITEXT );
398  $rev1 = $page->getRevision();
399 
400  $this->assertNull( $rev1->getNext() );
401 
402  $page->doEditContent( ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ),
403  'second rev testGetNext' );
404  $rev2 = $page->getRevision();
405 
406  $this->assertNotNull( $rev1->getNext() );
407  $this->assertEquals( $rev2->getId(), $rev1->getNext()->getId() );
408  }
409 
413  public function testNewNullRevision() {
414  $page = $this->createPage( 'RevisionStorageTest_testNewNullRevision', 'some testing text', CONTENT_MODEL_WIKITEXT );
415  $orig = $page->getRevision();
416 
417  $dbw = wfGetDB( DB_MASTER );
418  $rev = Revision::newNullRevision( $dbw, $page->getId(), 'a null revision', false );
419 
420  $this->assertNotEquals( $orig->getId(), $rev->getId(),
421  'new null revision shold have a different id from the original revision' );
422  $this->assertEquals( $orig->getTextId(), $rev->getTextId(),
423  'new null revision shold have the same text id as the original revision' );
424  $this->assertEquals( 'some testing text', $rev->getContent()->getNativeData() );
425  }
426 
427  public static function provideUserWasLastToEdit() {
428  return array(
429  array( #0
430  3, true, # actually the last edit
431  ),
432  array( #1
433  2, true, # not the current edit, but still by this user
434  ),
435  array( #2
436  1, false, # edit by another user
437  ),
438  array( #3
439  0, false, # first edit, by this user, but another user edited in the mean time
440  ),
441  );
442  }
443 
447  public function testUserWasLastToEdit( $sinceIdx, $expectedLast ) {
448  $userA = User::newFromName( "RevisionStorageTest_userA" );
449  $userB = User::newFromName( "RevisionStorageTest_userB" );
450 
451  if ( $userA->getId() === 0 ) {
452  $userA = User::createNew( $userA->getName() );
453  }
454 
455  if ( $userB->getId() === 0 ) {
456  $userB = User::createNew( $userB->getName() );
457  }
458 
459  $ns = $this->getDefaultWikitextNS();
460 
461  $dbw = wfGetDB( DB_MASTER );
462  $revisions = array();
463 
464  // create revisions -----------------------------
466  'RevisionStorageTest_testUserWasLastToEdit', $ns ) );
467  $page->insertOn( $dbw );
468 
469  # zero
470  $revisions[0] = new Revision( array(
471  'page' => $page->getId(),
472  'title' => $page->getTitle(), // we need the title to determine the page's default content model
473  'timestamp' => '20120101000000',
474  'user' => $userA->getId(),
475  'text' => 'zero',
476  'content_model' => CONTENT_MODEL_WIKITEXT,
477  'summary' => 'edit zero'
478  ) );
479  $revisions[0]->insertOn( $dbw );
480 
481  # one
482  $revisions[1] = new Revision( array(
483  'page' => $page->getId(),
484  'title' => $page->getTitle(), // still need the title, because $page->getId() is 0 (there's no entry in the page table)
485  'timestamp' => '20120101000100',
486  'user' => $userA->getId(),
487  'text' => 'one',
488  'content_model' => CONTENT_MODEL_WIKITEXT,
489  'summary' => 'edit one'
490  ) );
491  $revisions[1]->insertOn( $dbw );
492 
493  # two
494  $revisions[2] = new Revision( array(
495  'page' => $page->getId(),
496  'title' => $page->getTitle(),
497  'timestamp' => '20120101000200',
498  'user' => $userB->getId(),
499  'text' => 'two',
500  'content_model' => CONTENT_MODEL_WIKITEXT,
501  'summary' => 'edit two'
502  ) );
503  $revisions[2]->insertOn( $dbw );
504 
505  # three
506  $revisions[3] = new Revision( array(
507  'page' => $page->getId(),
508  'title' => $page->getTitle(),
509  'timestamp' => '20120101000300',
510  'user' => $userA->getId(),
511  'text' => 'three',
512  'content_model' => CONTENT_MODEL_WIKITEXT,
513  'summary' => 'edit three'
514  ) );
515  $revisions[3]->insertOn( $dbw );
516 
517  # four
518  $revisions[4] = new Revision( array(
519  'page' => $page->getId(),
520  'title' => $page->getTitle(),
521  'timestamp' => '20120101000200',
522  'user' => $userA->getId(),
523  'text' => 'zero',
524  'content_model' => CONTENT_MODEL_WIKITEXT,
525  'summary' => 'edit four'
526  ) );
527  $revisions[4]->insertOn( $dbw );
528 
529  // test it ---------------------------------
530  $since = $revisions[$sinceIdx]->getTimestamp();
531 
532  $wasLast = Revision::userWasLastToEdit( $dbw, $page->getId(), $userA->getId(), $since );
533 
534  $this->assertEquals( $expectedLast, $wasLast );
535  }
536 }
RevisionStorageTest\__construct
__construct( $name=null, array $data=array(), $dataName='')
Definition: RevisionStorageTest.php:19
RevisionStorageTest\testNewFromRow
testNewFromRow()
@covers Revision::newFromRow
Definition: RevisionStorageTest.php:157
Revision\getTimestamp
getTimestamp()
Definition: Revision.php:1133
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:189
DB_MASTER
const DB_MASTER
Definition: Defines.php:56
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
Revision\newFromId
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
Definition: Revision.php:88
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:812
Revision\newNullRevision
static newNullRevision( $dbw, $pageId, $summary, $minor)
Create a new null-revision for insertion into a page's history.
Definition: Revision.php:1567
RevisionStorageTest\testNewNullRevision
testNewNullRevision()
@covers Revision::newNullRevision
Definition: RevisionStorageTest.php:412
wfGetDB
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:3659
Revision\getPage
getPage()
Get the page ID.
Definition: Revision.php:795
RevisionStorageTest\createPage
createPage( $page, $text, $model=null)
Definition: RevisionStorageTest.php:98
WikiPage
Class representing a MediaWiki article and history.
Definition: WikiPage.php:37
User\newFromName
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition: User.php:388
RevisionStorageTest\testGetText
testGetText()
@covers Revision::getText
Definition: RevisionStorageTest.php:263
$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
CONTENT_MODEL_WIKITEXT
const CONTENT_MODEL_WIKITEXT
Definition: Defines.php:283
Revision\getSha1
getSha1()
Returns the base36 sha1 of the text in this revision, or null if unknown.
Definition: Revision.php:745
Revision\getId
getId()
Get revision ID.
Definition: Revision.php:699
Revision\getContentModel
getContentModel()
Returns the content model for this revision.
Definition: Revision.php:1077
RevisionStorageTest\testUserWasLastToEdit
testUserWasLastToEdit( $sinceIdx, $expectedLast)
@dataProvider provideUserWasLastToEdit
Definition: RevisionStorageTest.php:446
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
$dbr
$dbr
Definition: testCompression.php:48
Revision
Definition: Revision.php:26
RevisionStorageTest\testConstructFromRow
testConstructFromRow()
@covers Revision::__construct
Definition: RevisionStorageTest.php:139
RevisionStorageTest\testIsCurrent
testIsCurrent()
@covers Revision::isCurrent
Definition: RevisionStorageTest.php:352
WikiPage\factory
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
Definition: WikiPage.php:103
RevisionStorageTest\testNewFromId
testNewFromId()
@covers Revision::newFromId
Definition: RevisionStorageTest.php:195
RevisionStorageTest\testGetRawText
testGetRawText()
@covers Revision::getRawText
Definition: RevisionStorageTest.php:303
RevisionStorageTest\provideUserWasLastToEdit
static provideUserWasLastToEdit()
Definition: RevisionStorageTest.php:426
RevisionStorageTest\testGetContent_failure
testGetContent_failure()
@covers Revision::getContent
Definition: RevisionStorageTest.php:275
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
MediaWikiTestCase\hideDeprecated
hideDeprecated( $function)
Don't throw a warning if $function is deprecated and called later.
Definition: MediaWikiTestCase.php:679
RevisionStorageTest\testGetContentFormat
testGetContentFormat()
@covers Revision::getContentFormat
Definition: RevisionStorageTest.php:332
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
Revision\fetchRevision
static fetchRevision( $title)
Return a wrapper for a series of database rows to fetch all of a given page's revisions in turn.
Definition: Revision.php:339
MediaWikiTestCase\getDefaultWikitextNS
getDefaultWikitextNS()
Returns the ID of a namespace that defaults to Wikitext.
Definition: MediaWikiTestCase.php:903
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
WikitextContent
Content object for wiki text pages.
Definition: WikitextContent.php:33
User\createNew
static createNew( $name, $params=array())
Add a user to the database, return the user object.
Definition: User.php:3458
false
processing should stop and the error should be shown to the user * false
Definition: hooks.txt:188
RevisionStorageTest\testNewFromArchiveRow
testNewFromArchiveRow()
@covers Revision::newFromArchiveRow
Definition: RevisionStorageTest.php:175
RevisionStorageTest\testSelectFields
testSelectFields()
@covers Revision::selectFields
Definition: RevisionStorageTest.php:230
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:144
RevisionStorageTest\tearDown
tearDown()
Definition: RevisionStorageTest.php:58
RevisionStorageTest\testGetPage
testGetPage()
@covers Revision::getPage
Definition: RevisionStorageTest.php:251
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:1731
function
when a variable name is used in a function
Definition: design.txt:93
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
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
RevisionStorageTest\testFetchRevision
testFetchRevision()
@covers Revision::fetchRevision
Definition: RevisionStorageTest.php:206
Revision\newFromArchiveRow
static newFromArchiveRow( $row, $overrides=array())
Make a fake revision object from an archive table row.
Definition: Revision.php:159
Revision\newFromRow
static newFromRow( $row)
Definition: Revision.php:206
RevisionStorageTest\assertRevEquals
assertRevEquals(Revision $orig, Revision $rev=null)
Definition: RevisionStorageTest.php:124
RevisionStorageTest\testGetPrevious
testGetPrevious()
@covers Revision::getPrevious
Definition: RevisionStorageTest.php:378
Revision\getContentFormat
getContentFormat()
Returns the content format for this revision.
Definition: Revision.php:1097
RevisionStorageTest\makeRevision
makeRevision( $props=null)
Definition: RevisionStorageTest.php:73
EDIT_NEW
const EDIT_NEW
Definition: Defines.php:189
$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:1337
RevisionStorageTest\testGetContentModel
testGetContentModel()
@covers Revision::getContentModel
Definition: RevisionStorageTest.php:315
DB_SLAVE
const DB_SLAVE
Definition: Defines.php:55
Title
Represents a title within MediaWiki.
Definition: Title.php:35
in
Prior to maintenance scripts were a hodgepodge of code that had no cohesion or formal method of action Beginning in
Definition: maintenance.txt:1
MWNamespace\getCanonicalNamespaces
static getCanonicalNamespaces( $rebuild=false)
Returns array of all defined namespaces with their canonical (English) names.
Definition: Namespace.php:218
RevisionStorageTest\$the_page
WikiPage $the_page
$the_page
Definition: RevisionStorageTest.php:17
CONTENT_MODEL_JAVASCRIPT
const CONTENT_MODEL_JAVASCRIPT
Definition: Defines.php:284
CONTENT_FORMAT_JAVASCRIPT
const CONTENT_FORMAT_JAVASCRIPT
Definition: Defines.php:299
Revision\selectFields
static selectFields()
Return the list of revision fields that should be selected to create a new revision.
Definition: Revision.php:405
RevisionStorageTest\testGetContent
testGetContent()
@covers Revision::getContent
Definition: RevisionStorageTest.php:293
$res
$res
Definition: database.txt:21
RevisionStorageTest\testGetNext
testGetNext()
@covers Revision::getNext
Definition: RevisionStorageTest.php:395
MWNamespace\getCanonicalName
static getCanonicalName( $index)
Returns the canonical (English) name for a given index.
Definition: Namespace.php:237
RevisionStorageTest
Test class for Revision storage.
Definition: RevisionStorageTest.php:13
if
if(!function_exists('version_compare')||version_compare(phpversion(), '5.3.2')< 0)
Definition: api.php:37