Go to the documentation of this file.
27 'access' =>
'ControlledAccessDummyAction',
28 'unblock' =>
'RequiresUnblockDummyAction',
29 'string' =>
'NamedDummyAction',
30 'declared' =>
'NonExistingClassName',
31 'callable' => [ $this,
'dummyActionCallback' ],
52 [
'dummy',
'DummyAction' ],
53 [
'string',
'NamedDummyAction' ],
54 [
'callable',
'CalledDummyAction' ],
55 [
'object',
'InstantiatedDummyAction' ],
58 [
'DUMMY',
'DummyAction' ],
59 [
'STRING',
'NamedDummyAction' ],
63 [
'undeclared',
null ],
77 $this->assertSame( $expected !==
null, $exists );
84 $this->assertTrue( $exists );
96 $this->assertEquals( $expected ?:
'nosuchaction', $actionName );
104 $this->assertEquals(
'edit', $actionName );
112 $this->assertEquals(
'view', $actionName );
118 $context->getRequest()->setVal(
'revisiondelete',
true );
121 $this->assertEquals(
'revisiondelete', $actionName );
130 $this->assertEquals(
'view', $actionName );
142 $this->
assertType( $expected ?:
'null', $action );
148 $this->assertFalse( $exists );
155 $this->assertEquals(
'view', $actionName );
162 $this->assertNull( $action );
168 $this->assertTrue( $exists );
175 $this->assertEquals(
'nosuchaction', $actionName );
182 $this->assertFalse( $action );
192 $user->mRights = [
'access' ];
194 $this->assertNull( $action->canExecute(
$user ) );
203 $action->canExecute(
$user );
204 }
catch ( Exception
$e ) {
216 $block =
new Block( [
219 'expiry' =>
'infinity',
222 $block->setRestrictions( [
229 $action->canExecute(
$user );
230 }
catch ( Exception
$e ) {
static getActionName(IContextSource $context)
Get the action that will be executed, not necessarily the one passed passed through the "action" requ...
return true to allow those checks to and false if checking is done & $user
WebRequest clone which takes values from a provided array.
testActionFactory( $requestedAction, $expected)
actionProvider
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
getName()
Return the name of the action this object responds to.
testGetActionName_historysubmitWorkaround()
testDisabledAction_factoryReturnsFalse()
testGetActionName( $requestedAction, $expected)
actionProvider
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
Actions are things which can be done to pages (edit, delete, rollback, etc).
testGetActionName_editredlinkWorkaround()
An IContextSource implementation which will inherit context from another source but allow individual ...
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
testActionExists_doesNotRequireInstantiation()
checkCanExecute(User $user)
Checks if the given user (identified by an object) can perform this action.
testNull_canNotBeInstantiated()
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
testActionExists( $requestedAction, $expected)
actionProvider
testGetActionName_whenCanNotUseWikiPage_defaultsToView()
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
testGetActionName_revisiondeleteWorkaround()
getRestriction()
Get the permission required to perform this action.
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
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
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
requiresUnblock()
Whether this action can still be executed by a blocked user.
getContext( $requestedAction=null)
testDisabledAction_exists()
testCanExecuteRequiresUnblock()
static getMain()
Get the RequestContext object associated with the main request.
testDisabledAction_isNotResolved()
static exists( $name)
Check if a given action is recognised, even if it's disabled.
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
show()
The main action entry point.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static factory( $action, Page $page, IContextSource $context=null)
Get an appropriate Action subclass for the given action.
testNull_defaultsToView()