MediaWiki REL1_32
ProxySpecialPage.php
Go to the documentation of this file.
1<?php
23abstract class ProxySpecialPage extends SpecialPage {
27 private $target = null;
28
37 abstract protected function getTargetPage();
38
42 private function init() {
43 if ( $this->target === null ) {
44 $this->target = $this->getTargetPage();
45 }
46 }
47
56 public function __call( $method, $args ) {
57 $this->init();
58 return call_user_func_array( [ $this->target, $method ], $args );
59 }
60
64 function getName() {
65 $this->init();
66 return $this->target->getName();
67 }
68
73 function getPageTitle( $subpage = false ) {
74 $this->init();
75 return $this->target->getPageTitle( $subpage );
76 }
77
81 function getLocalName() {
82 $this->init();
83 return $this->target->getLocalName();
84 }
85
89 function getRestriction() {
90 $this->init();
91 return $this->target->getRestriction();
92 }
93
97 function isListed() {
98 $this->init();
99 return $this->target->isListed();
100 }
101
106 function setListed( $listed ) {
107 $this->init();
108 return $this->target->setListed( $listed );
109 }
110
115 function listed( $x = null ) {
116 $this->init();
117 return $this->target->listed( $x );
118 }
119
123 public function isIncludable() {
124 $this->init();
125 return $this->target->isIncludable();
126 }
127
132 function including( $x = null ) {
133 $this->init();
134 return $this->target->including( $x );
135 }
136
140 public function isRestricted() {
141 $this->init();
142 return $this->target->isRestricted();
143 }
144
149 public function userCanExecute( User $user ) {
150 $this->init();
151 return $this->target->userCanExecute( $user );
152 }
153
158 $this->init();
159 $this->target->displayRestrictionError();
160 }
161
166 public function checkPermissions() {
167 $this->init();
168 $this->target->checkPermissions();
169 }
170
174 protected function beforeExecute( $subPage ) {
175 $this->init();
176 $this->target->beforeExecute( $subPage );
177 }
178
182 protected function afterExecute( $subPage ) {
183 $this->init();
184 $this->target->afterExecute( $subPage );
185 }
186
190 public function execute( $subPage ) {
191 $this->init();
192 $this->target->execute( $subPage );
193 }
194
198 function getDescription() {
199 $this->init();
200 return $this->target->getDescription();
201 }
202
206 public function setContext( $context ) {
207 $this->init();
208 $this->target->setContext( $context );
209 parent::setContext( $context );
210 }
211
215 protected function getRobotPolicy() {
216 $this->init();
217 return $this->target->getRobotPolicy();
218 }
219
223 protected function getGroupName() {
224 $this->init();
225 return $this->target->getGroupName();
226 }
227}
if( $line===false) $args
Definition cdb.php:64
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...
SpecialPage null $target
Target page to execute.
__call( $method, $args)
Magic function that proxies function calls to the target object.
init()
Helper function that initializes the target SpecialPage object.
getPageTitle( $subpage=false)
getTargetPage()
Instantiate a SpecialPage based on request parameters.
userCanExecute(User $user)
Parent class for all special pages.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition User.php:47
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
Definition hooks.txt:2885