MediaWiki REL1_28
SpecialMyRedirectPages.php
Go to the documentation of this file.
1<?php
33 public function __construct() {
34 parent::__construct( 'Mypage' );
35 }
36
41 public function getRedirect( $subpage ) {
42 if ( $subpage === null || $subpage === '' ) {
43 return Title::makeTitle( NS_USER, $this->getUser()->getName() );
44 }
45
46 return Title::makeTitle( NS_USER, $this->getUser()->getName() . '/' . $subpage );
47 }
48
55 public function personallyIdentifiableTarget() {
56 return true;
57 }
58}
59
66 public function __construct() {
67 parent::__construct( 'Mytalk' );
68 }
69
74 public function getRedirect( $subpage ) {
75 if ( $subpage === null || $subpage === '' ) {
76 return Title::makeTitle( NS_USER_TALK, $this->getUser()->getName() );
77 }
78
79 return Title::makeTitle( NS_USER_TALK, $this->getUser()->getName() . '/' . $subpage );
80 }
81
88 public function personallyIdentifiableTarget() {
89 return true;
90 }
91}
92
99 public function __construct() {
100 parent::__construct( 'Mycontributions' );
101 $this->mAllowedRedirectParams = [ 'limit', 'namespace', 'tagfilter',
102 'offset', 'dir', 'year', 'month', 'feed', 'deletedOnly',
103 'nsInvert', 'associated', 'newOnly', 'topOnly' ];
104 }
105
110 public function getRedirect( $subpage ) {
111 return SpecialPage::getTitleFor( 'Contributions', $this->getUser()->getName() );
112 }
113
121 return true;
122 }
123}
124
131 public function __construct() {
132 parent::__construct( 'Myuploads' );
133 $this->mAllowedRedirectParams = [ 'limit', 'ilshowall', 'ilsearch' ];
134 }
135
140 public function getRedirect( $subpage ) {
141 return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() );
142 }
143
151 return true;
152 }
153}
154
161 public function __construct() {
162 parent::__construct( 'AllMyUploads' );
163 $this->mAllowedRedirectParams = [ 'limit', 'ilsearch' ];
164 }
165
170 public function getRedirect( $subpage ) {
171 $this->mAddedRedirectParams['ilshowall'] = 1;
172
173 return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() );
174 }
175
183 return true;
184 }
185}
Superclass for any RedirectSpecialPage which redirects the user to a particular article (as opposed t...
Shortcut to construct a special page alias.
Special page pointing to current user's uploaded files (including old versions).
personallyIdentifiableTarget()
Target identifies a specific User.
Special page pointing to current user's contributions.
personallyIdentifiableTarget()
Target identifies a specific User.
Special page pointing to current user's user page.
personallyIdentifiableTarget()
Target identifies a specific User.
Special page pointing to current user's talk page.
personallyIdentifiableTarget()
Target identifies a specific User.
Special page pointing to current user's uploaded files.
personallyIdentifiableTarget()
Target identifies a specific User.
getName()
Get the name of this Special Page.
getUser()
Shortcut to get the User executing this instance.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
const NS_USER
Definition Defines.php:58
const NS_USER_TALK
Definition Defines.php:59
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:37