MediaWiki  1.33.0
Go to the documentation of this file.
1 <?php
20  protected function getContentHandlerUseDB() {
21  return true;
22  }
24  public function provideGetTextId() {
25  yield [ [], null ];
27  $row = (object)[
28  'rev_id' => 7,
29  'rev_page' => 1, // should match actual page id
30  'rev_text_id' => 789,
31  'rev_timestamp' => '20180101000000',
32  'rev_len' => 7,
33  'rev_minor_edit' => 0,
34  'rev_deleted' => 0,
35  'rev_parent_id' => 0,
36  'rev_sha1' => 'deadbeef',
37  'rev_comment' => 'some comment',
38  'rev_comment_text' => 'some comment',
39  'rev_comment_data' => '{}',
40  'rev_user' => 17,
41  'rev_user_text' => 'some user',
42  ];
44  yield [ $row, 789 ];
45  }
47 }
Tests Revision against the pre-MCR DB schema.
Definition: RevisionPreMcrDbTest.php:16
trait PreMcrSchemaOverride
Trait providing schema overrides that allow tests to run against the pre-MCR database schema.
Definition: PreMcrSchemaOverride.php:10
Definition: RevisionPreMcrDbTest.php:20
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
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
RevisionDbTestBase contains test cases for the Revision class that have Database interactions.
Definition: RevisionDbTestBase.php:15
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
Definition: hooks.txt:780
Definition: RevisionPreMcrDbTest.php:24
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest object
Definition: globals.txt:25