15 $page_table = $dbw->tableName(
'page' );
16 $revision_table = $dbw->tableName(
'revision' );
17 $archive_table = $dbw->tableName(
'archive' );
19 if ( $dbw->fieldExists( $page_table,
'page_content_model' ) ) {
20 $dbw->query(
"alter table $page_table drop column page_content_model" );
21 $dbw->query(
"alter table $revision_table drop column rev_content_model" );
22 $dbw->query(
"alter table $revision_table drop column rev_content_format" );
23 $dbw->query(
"alter table $archive_table drop column ar_content_model" );
24 $dbw->query(
"alter table $archive_table drop column ar_content_format" );
36 $this->assertTrue( in_array(
'rev_id', $fields ),
'missing rev_id in list of fields' );
37 $this->assertTrue( in_array(
'rev_page', $fields ),
'missing rev_page in list of fields' );
39 in_array(
'rev_timestamp', $fields ),
40 'missing rev_timestamp in list of fields'
42 $this->assertTrue( in_array(
'rev_user', $fields ),
'missing rev_user in list of fields' );
45 in_array(
'rev_content_model', $fields ),
46 'missing rev_content_model in list of fields'
49 in_array(
'rev_content_format', $fields ),
50 'missing rev_content_format in list of fields'
62 $this->fail(
"Creating JavaScript content on a wikitext page should fail with "
63 .
"\$wgContentHandlerUseDB disabled" );
65 $this->assertTrue(
true );
81 'content_format' =>
'text/javascript' ] );
83 $this->fail(
"Creating JavaScript content on a wikitext page should fail with "
84 .
"\$wgContentHandlerUseDB disabled" );
86 $this->assertTrue(
true );
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
Test class for Revision storage.
testSelectFields()
Revision::selectFields.
testGetContentFormat()
Revision::getContentFormat.
static selectFields()
Return the list of revision fields that should be selected to create a new revision.
CONTENT_MODEL_JAVASCRIPT
Uploads have to be specially set up to be secure.
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
makeRevision($props=null)
ContentHandler Database ^— important, causes temporary tables to be used instead of the real databas...
testGetContentModel()
Revision::getContentModel.