23 'revisiondelete' => SpecialPageAction::class,
25 'string' =>
'NamedDummyAction',
26 'declared' =>
'NonExistingClassName',
27 'callable' => [ $this,
'dummyActionCallback' ],
33 return WikiPage::factory( Title::makeTitle( 0,
'Title' ) );
48 [
'dummy',
'DummyAction' ],
49 [
'string',
'NamedDummyAction' ],
50 [
'callable',
'CalledDummyAction' ],
51 [
'object',
'InstantiatedDummyAction' ],
54 [
'DUMMY',
'DummyAction' ],
55 [
'STRING',
'NamedDummyAction' ],
59 [
'undeclared', null ],
73 $this->assertSame( $expected !==
null, $exists );
80 $this->assertTrue( $exists );
92 $this->assertEquals( $expected ?:
'nosuchaction', $actionName );
100 $this->assertEquals(
'edit', $actionName );
108 $this->assertEquals(
'view', $actionName );
114 $context->getRequest()->setVal(
'revisiondelete',
true );
117 $this->assertEquals(
'revisiondelete', $actionName );
126 $this->assertEquals(
'view', $actionName );
138 $this->
assertType( $expected ?:
'null', $action );
144 $this->assertFalse( $exists );
151 $this->assertEquals(
'view', $actionName );
158 $this->assertNull( $action );
164 $this->assertTrue( $exists );
171 $this->assertEquals(
'nosuchaction', $actionName );
178 $this->assertFalse( $action );
191 return static::class;
testActionExists_doesNotRequireInstantiation()
testDisabledAction_exists()
testGetActionName_revisiondeleteWorkaround()
testGetActionName( $requestedAction, $expected)
actionProvider
testGetActionName_editredlinkWorkaround()
testGetActionName_whenCanNotUseWikiPage_defaultsToView()
testDisabledAction_factoryReturnsFalse()
testActionFactory( $requestedAction, $expected)
actionProvider
testGetActionName_historysubmitWorkaround()
getContext( $requestedAction=null)
testNull_defaultsToView()
testDisabledAction_isNotResolved()
testActionExists( $requestedAction, $expected)
actionProvider
testNull_canNotBeInstantiated()
Actions are things which can be done to pages (edit, delete, rollback, etc).
static factory( $action, Page $page, IContextSource $context=null)
Get an appropriate Action subclass for the given action.
static getActionName(IContextSource $context)
Get the action that will be executed, not necessarily the one passed passed through the "action" requ...
static exists( $name)
Check if a given action is recognised, even if it's disabled.
An IContextSource implementation which will inherit context from another source but allow individual ...
getName()
Return the name of the action this object responds to.
show()
The main action entry point.
WebRequest clone which takes values from a provided array.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
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