MediaWiki  master
SpecialPage.php
Go to the documentation of this file.
1 <?php
30 
41 class SpecialPage implements MessageLocalizer {
42  // The canonical name of this special page
43  // Also used for the default <h1> heading, @see getDescription()
44  protected $mName;
45 
46  // The local name of this special page
47  private $mLocalName;
48 
49  // Minimum user level required to access this page, or "" for anyone.
50  // Also used to categorise the pages in Special:Specialpages
51  protected $mRestriction;
52 
53  // Listed in Special:Specialpages?
54  private $mListed;
55 
56  // Whether or not this special page is being included from an article
57  protected $mIncluding;
58 
59  // Whether the special page can be included in an article
60  protected $mIncludable;
61 
66  protected $mContext;
67 
71  private $linkRenderer;
72 
74  private $hookContainer;
76  private $hookRunner;
77 
92  public static function getTitleFor( $name, $subpage = false, $fragment = '' ) {
94  self::getTitleValueFor( $name, $subpage, $fragment )
95  );
96  }
97 
107  public static function getTitleValueFor( $name, $subpage = false, $fragment = '' ) {
108  $name = MediaWikiServices::getInstance()->getSpecialPageFactory()->
109  getLocalNameFor( $name, $subpage );
110 
111  return new TitleValue( NS_SPECIAL, $name, $fragment );
112  }
113 
121  public static function getSafeTitleFor( $name, $subpage = false ) {
122  $name = MediaWikiServices::getInstance()->getSpecialPageFactory()->
123  getLocalNameFor( $name, $subpage );
124  if ( $name ) {
125  return Title::makeTitleSafe( NS_SPECIAL, $name );
126  } else {
127  return null;
128  }
129  }
130 
150  public function __construct(
151  $name = '', $restriction = '', $listed = true,
152  $function = false, $file = '', $includable = false
153  ) {
154  $this->mName = $name;
155  $this->mRestriction = $restriction;
156  $this->mListed = $listed;
157  $this->mIncludable = $includable;
158  }
159 
164  public function getName() {
165  return $this->mName;
166  }
167 
172  public function getRestriction() {
173  return $this->mRestriction;
174  }
175 
176  // @todo FIXME: Decide which syntax to use for this, and stick to it
177 
184  public function isListed() {
185  return $this->mListed;
186  }
187 
196  public function setListed( $listed ) {
197  wfDeprecated( __METHOD__, '1.35' );
198  return wfSetVar( $this->mListed, $listed );
199  }
200 
209  public function listed( $x = null ) {
210  wfDeprecated( __METHOD__, '1.35' );
211  return wfSetVar( $this->mListed, $x );
212  }
213 
219  public function isIncludable() {
220  return $this->mIncludable;
221  }
222 
234  public function maxIncludeCacheTime() {
235  return $this->getConfig()->get( 'MiserMode' ) ? $this->getCacheTTL() : 0;
236  }
237 
242  protected function getCacheTTL() {
243  return 60 * 60;
244  }
245 
251  public function including( $x = null ) {
252  return wfSetVar( $this->mIncluding, $x );
253  }
254 
260  public function getLocalName() {
261  if ( !isset( $this->mLocalName ) ) {
262  $this->mLocalName = MediaWikiServices::getInstance()->getSpecialPageFactory()->
263  getLocalNameFor( $this->mName );
264  }
265 
266  return $this->mLocalName;
267  }
268 
278  public function isExpensive() {
279  return false;
280  }
281 
292  public function isCached() {
293  return false;
294  }
295 
304  public function isRestricted() {
305  // DWIM: If anons can do something, then it is not restricted
306  return $this->mRestriction != '' && !MediaWikiServices::getInstance()
307  ->getPermissionManager()
308  ->groupHasPermission( '*', $this->mRestriction );
309  }
310 
320  public function userCanExecute( User $user ) {
321  return MediaWikiServices::getInstance()
322  ->getPermissionManager()
323  ->userHasRight( $user, $this->mRestriction );
324  }
325 
331  protected function displayRestrictionError() {
332  throw new PermissionsError( $this->mRestriction );
333  }
334 
343  public function checkPermissions() {
344  if ( !$this->userCanExecute( $this->getUser() ) ) {
345  $this->displayRestrictionError();
346  }
347  }
348 
356  public function checkReadOnly() {
357  if ( wfReadOnly() ) {
358  throw new ReadOnlyError;
359  }
360  }
361 
373  public function requireLogin(
374  $reasonMsg = 'exception-nologin-text', $titleMsg = 'exception-nologin'
375  ) {
376  if ( $this->getUser()->isAnon() ) {
377  throw new UserNotLoggedIn( $reasonMsg, $titleMsg );
378  }
379  }
380 
389  protected function getLoginSecurityLevel() {
390  return false;
391  }
392 
408  protected function setReauthPostData( array $data ) {
409  }
410 
436  protected function checkLoginSecurityLevel( $level = null ) {
437  $level = $level ?: $this->getName();
438  $key = 'SpecialPage:reauth:' . $this->getName();
439  $request = $this->getRequest();
440 
441  $securityStatus = MediaWikiServices::getInstance()->getAuthManager()
442  ->securitySensitiveOperationStatus( $level );
443  if ( $securityStatus === AuthManager::SEC_OK ) {
444  $uniqueId = $request->getVal( 'postUniqueId' );
445  if ( $uniqueId ) {
446  $key .= ':' . $uniqueId;
447  $session = $request->getSession();
448  $data = $session->getSecret( $key );
449  if ( $data ) {
450  $session->remove( $key );
451  $this->setReauthPostData( $data );
452  }
453  }
454  return true;
455  } elseif ( $securityStatus === AuthManager::SEC_REAUTH ) {
456  $title = self::getTitleFor( 'Userlogin' );
457  $queryParams = $request->getQueryValues();
458 
459  if ( $request->wasPosted() ) {
460  $data = array_diff_assoc( $request->getValues(), $request->getQueryValues() );
461  if ( $data ) {
462  // unique ID in case the same special page is open in multiple browser tabs
463  $uniqueId = MWCryptRand::generateHex( 6 );
464  $key .= ':' . $uniqueId;
465  $queryParams['postUniqueId'] = $uniqueId;
466  $session = $request->getSession();
467  $session->persist(); // Just in case
468  $session->setSecret( $key, $data );
469  }
470  }
471 
472  $query = [
473  'returnto' => $this->getFullTitle()->getPrefixedDBkey(),
474  'returntoquery' => wfArrayToCgi( array_diff_key( $queryParams, [ 'title' => true ] ) ),
475  'force' => $level,
476  ];
477  $url = $title->getFullURL( $query, false, PROTO_HTTPS );
478 
479  $this->getOutput()->redirect( $url );
480  return false;
481  }
482 
483  $titleMessage = wfMessage( 'specialpage-securitylevel-not-allowed-title' );
484  $errorMessage = wfMessage( 'specialpage-securitylevel-not-allowed' );
485  throw new ErrorPageError( $titleMessage, $errorMessage );
486  }
487 
505  public function prefixSearchSubpages( $search, $limit, $offset ) {
506  $subpages = $this->getSubpagesForPrefixSearch();
507  if ( !$subpages ) {
508  return [];
509  }
510 
511  return self::prefixSearchArray( $search, $limit, $subpages, $offset );
512  }
513 
523  protected function getSubpagesForPrefixSearch() {
524  return [];
525  }
526 
534  protected function prefixSearchString( $search, $limit, $offset ) {
535  $title = Title::newFromText( $search );
536  if ( !$title || !$title->canExist() ) {
537  // No prefix suggestion in special and media namespace
538  return [];
539  }
540 
541  $searchEngine = MediaWikiServices::getInstance()->newSearchEngine();
542  $searchEngine->setLimitOffset( $limit, $offset );
543  $searchEngine->setNamespaces( [] );
544  $result = $searchEngine->defaultPrefixSearch( $search );
545  return array_map( function ( Title $t ) {
546  return $t->getPrefixedText();
547  }, $result );
548  }
549 
561  protected static function prefixSearchArray( $search, $limit, array $subpages, $offset ) {
562  $escaped = preg_quote( $search, '/' );
563  return array_slice( preg_grep( "/^$escaped/i",
564  array_slice( $subpages, $offset ) ), 0, $limit );
565  }
566 
571  protected function setHeaders() {
572  $out = $this->getOutput();
573  $out->setArticleRelated( false );
574  $out->setRobotPolicy( $this->getRobotPolicy() );
575  $out->setPageTitle( $this->getDescription() );
576  if ( $this->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
577  $out->addModuleStyles( [
578  'mediawiki.ui.input',
579  'mediawiki.ui.radio',
580  'mediawiki.ui.checkbox',
581  ] );
582  }
583  }
584 
592  final public function run( $subPage ) {
593  if ( !$this->getHookRunner()->onSpecialPageBeforeExecute( $this, $subPage ) ) {
594  return;
595  }
596 
597  if ( $this->beforeExecute( $subPage ) === false ) {
598  return;
599  }
600  $this->execute( $subPage );
601  $this->afterExecute( $subPage );
602 
603  $this->getHookRunner()->onSpecialPageAfterExecute( $this, $subPage );
604  }
605 
616  protected function beforeExecute( $subPage ) {
617  // No-op
618  }
619 
628  protected function afterExecute( $subPage ) {
629  // No-op
630  }
631 
642  public function execute( $subPage ) {
643  $this->setHeaders();
644  $this->checkPermissions();
645  $securityLevel = $this->getLoginSecurityLevel();
646  if ( $securityLevel !== false && !$this->checkLoginSecurityLevel( $securityLevel ) ) {
647  return;
648  }
649  $this->outputHeader();
650  }
651 
662  protected function outputHeader( $summaryMessageKey = '' ) {
663  if ( $summaryMessageKey == '' ) {
664  $msg = MediaWikiServices::getInstance()->getContentLanguage()->lc( $this->getName() ) .
665  '-summary';
666  } else {
667  $msg = $summaryMessageKey;
668  }
669  if ( !$this->msg( $msg )->isDisabled() && !$this->including() ) {
670  $this->getOutput()->wrapWikiMsg(
671  "<div class='mw-specialpage-summary'>\n$1\n</div>", $msg );
672  }
673  }
674 
686  public function getDescription() {
687  return $this->msg( strtolower( $this->mName ) )->text();
688  }
689 
697  public function getPageTitle( $subpage = false ) {
698  return self::getTitleFor( $this->mName, $subpage );
699  }
700 
707  public function setContext( $context ) {
708  $this->mContext = $context;
709  }
710 
717  public function getContext() {
718  if ( $this->mContext instanceof IContextSource ) {
719  return $this->mContext;
720  } else {
721  wfDebug( __METHOD__ . " called and \$mContext is null. " .
722  "Return RequestContext::getMain(); for sanity" );
723 
724  return RequestContext::getMain();
725  }
726  }
727 
734  public function getRequest() {
735  return $this->getContext()->getRequest();
736  }
737 
744  public function getOutput() {
745  return $this->getContext()->getOutput();
746  }
747 
754  public function getUser() {
755  return $this->getContext()->getUser();
756  }
757 
764  public function getSkin() {
765  return $this->getContext()->getSkin();
766  }
767 
774  public function getLanguage() {
775  return $this->getContext()->getLanguage();
776  }
777 
784  protected function getLanguageConverter(): ILanguageConverter {
785  return MediaWikiServices::getInstance()->getLanguageConverterFactory()
786  ->getLanguageConverter();
787  }
788 
794  public function getConfig() {
795  return $this->getContext()->getConfig();
796  }
797 
804  public function getFullTitle() {
805  return $this->getContext()->getTitle();
806  }
807 
815  protected function getRobotPolicy() {
816  return 'noindex,nofollow';
817  }
818 
828  public function msg( $key, ...$params ) {
829  $message = $this->getContext()->msg( $key, ...$params );
830  // RequestContext passes context to wfMessage, and the language is set from
831  // the context, but setting the language for Message class removes the
832  // interface message status, which breaks for example usernameless gender
833  // invocations. Restore the flag when not including special page in content.
834  if ( $this->including() ) {
835  $message->setInterfaceMessageFlag( false );
836  }
837 
838  return $message;
839  }
840 
846  protected function addFeedLinks( $params ) {
847  $feedTemplate = wfScript( 'api' );
848 
849  foreach ( $this->getConfig()->get( 'FeedClasses' ) as $format => $class ) {
850  $theseParams = $params + [ 'feedformat' => $format ];
851  $url = wfAppendQuery( $feedTemplate, $theseParams );
852  $this->getOutput()->addFeedLink( $format, $url );
853  }
854  }
855 
864  public function addHelpLink( $to, $overrideBaseUrl = false ) {
865  if ( $this->including() ) {
866  return;
867  }
868 
869  $lang = MediaWikiServices::getInstance()->getContentLanguage();
870  $msg = $this->msg( $lang->lc( $this->getName() ) . '-helppage' );
871 
872  if ( !$msg->isDisabled() ) {
873  $title = Title::newFromText( $msg->plain() );
874  if ( $title instanceof Title ) {
875  $this->getOutput()->addHelpLink( $title->getLocalURL(), true );
876  }
877  } else {
878  $this->getOutput()->addHelpLink( $to, $overrideBaseUrl );
879  }
880  }
881 
890  public function getFinalGroupName() {
891  $name = $this->getName();
892 
893  // Allow overriding the group from the wiki side
894  $msg = $this->msg( 'specialpages-specialpagegroup-' . strtolower( $name ) )->inContentLanguage();
895  if ( !$msg->isBlank() ) {
896  $group = $msg->text();
897  } else {
898  // Than use the group from this object
899  $group = $this->getGroupName();
900  }
901 
902  return $group;
903  }
904 
913  public function doesWrites() {
914  return false;
915  }
916 
927  protected function getGroupName() {
928  return 'other';
929  }
930 
935  protected function useTransactionalTimeLimit() {
936  if ( $this->getRequest()->wasPosted() ) {
938  }
939  }
940 
945  public function getLinkRenderer() {
946  if ( $this->linkRenderer ) {
947  return $this->linkRenderer;
948  } else {
949  return MediaWikiServices::getInstance()->getLinkRenderer();
950  }
951  }
952 
958  $this->linkRenderer = $linkRenderer;
959  }
960 
971  protected function buildPrevNextNavigation(
972  $offset,
973  $limit,
974  array $query = [],
975  $atend = false,
976  $subpage = false
977  ) {
978  $title = $this->getPageTitle( $subpage );
979  $prevNext = new PrevNextNavigationRenderer( $this );
980 
981  return $prevNext->buildPrevNextNavigation( $title, $offset, $limit, $query, $atend );
982  }
983 
990  $this->hookContainer = $hookContainer;
991  $this->hookRunner = new HookRunner( $hookContainer );
992  }
993 
998  protected function getHookContainer() {
999  if ( !$this->hookContainer ) {
1000  $this->hookContainer = MediaWikiServices::getInstance()->getHookContainer();
1001  }
1002  return $this->hookContainer;
1003  }
1004 
1011  protected function getHookRunner() {
1012  if ( !$this->hookRunner ) {
1013  $this->hookRunner = new HookRunner( $this->getHookContainer() );
1014  }
1015  return $this->hookRunner;
1016  }
1017 }
ReadOnlyError
Show an error when the wiki is locked/read-only and the user tries to do something that requires writ...
Definition: ReadOnlyError.php:29
SpecialPage\$mIncluding
$mIncluding
Definition: SpecialPage.php:57
SpecialPage\getPageTitle
getPageTitle( $subpage=false)
Get a self-referential title object.
Definition: SpecialPage.php:697
SpecialPage\getFinalGroupName
getFinalGroupName()
Get the group that the special page belongs in on Special:SpecialPage Use this method,...
Definition: SpecialPage.php:890
SpecialPage\msg
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:828
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:328
Linker
Some internal bits split of from Skin.php.
Definition: Linker.php:36
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:744
SpecialPage\isExpensive
isExpensive()
Is this page expensive (for some definition of expensive)? Expensive pages are disabled or cached in ...
Definition: SpecialPage.php:278
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:160
$lang
if(!isset( $args[0])) $lang
Definition: testCompression.php:37
SpecialPage\maxIncludeCacheTime
maxIncludeCacheTime()
How long to cache page when it is being included.
Definition: SpecialPage.php:234
SpecialPage\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialPage.php:927
wfSetVar
wfSetVar(&$dest, $source, $force=false)
Sets dest to source and returns the original value of dest If source is NULL, it just returns the val...
Definition: GlobalFunctions.php:1550
MediaWiki\Linker\LinkRenderer
Class that generates HTML links for pages.
Definition: LinkRenderer.php:41
UserNotLoggedIn
Redirect a user to the login page.
Definition: UserNotLoggedIn.php:54
SpecialPage\$mIncludable
$mIncludable
Definition: SpecialPage.php:60
SpecialPage\checkPermissions
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
Definition: SpecialPage.php:343
SpecialPage\setReauthPostData
setReauthPostData(array $data)
Record preserved POST data after a reauthentication.
Definition: SpecialPage.php:408
SpecialPage\__construct
__construct( $name='', $restriction='', $listed=true, $function=false, $file='', $includable=false)
Default constructor for special pages Derivative classes should call this from their constructor Note...
Definition: SpecialPage.php:150
SpecialPage\displayRestrictionError
displayRestrictionError()
Output an error message telling the user what access level they have to have Stable to override.
Definition: SpecialPage.php:331
SpecialPage\setListed
setListed( $listed)
Set whether this page is listed in Special:Specialpages, at run-time.
Definition: SpecialPage.php:196
$file
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
Definition: router.php:42
wfReadOnly
wfReadOnly()
Check whether the wiki is in read-only mode.
Definition: GlobalFunctions.php:1126
SpecialPage\getLocalName
getLocalName()
Get the localised name of the special page Stable to override.
Definition: SpecialPage.php:260
wfMessage
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Definition: GlobalFunctions.php:1220
MediaWiki\Navigation\PrevNextNavigationRenderer
Helper class for generating prev/next links for paging.
Definition: PrevNextNavigationRenderer.php:33
SpecialPage\getTitleFor
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,...
Definition: SpecialPage.php:92
SpecialPage\getHookContainer
getHookContainer()
Definition: SpecialPage.php:998
SpecialPage\$mContext
IContextSource $mContext
Current request context.
Definition: SpecialPage.php:66
SpecialPage\getSkin
getSkin()
Shortcut to get the skin being used for this instance.
Definition: SpecialPage.php:764
SpecialPage\useTransactionalTimeLimit
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition: SpecialPage.php:935
PermissionsError
Show an error when a user tries to do something they do not have the necessary permissions for.
Definition: PermissionsError.php:31
SpecialPage\getLanguage
getLanguage()
Shortcut to get user's language.
Definition: SpecialPage.php:774
SpecialPage\getName
getName()
Get the name of this Special Page.
Definition: SpecialPage.php:164
SpecialPage\isListed
isListed()
Whether this special page is listed in Special:SpecialPages Stable to override.
Definition: SpecialPage.php:184
MessageLocalizer
Interface for localizing messages in MediaWiki.
Definition: MessageLocalizer.php:29
SpecialPage\getRestriction
getRestriction()
Get the permission that a user must have to execute this page.
Definition: SpecialPage.php:172
wfAppendQuery
wfAppendQuery( $url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
Definition: GlobalFunctions.php:438
SpecialPage\getSafeTitleFor
static getSafeTitleFor( $name, $subpage=false)
Get a localised Title object for a page name with a possibly unvalidated subpage.
Definition: SpecialPage.php:121
SpecialPage\$mRestriction
$mRestriction
Definition: SpecialPage.php:51
SpecialPage\getDescription
getDescription()
Returns the name that goes in the <h1> in the special page itself, and also the name that will be l...
Definition: SpecialPage.php:686
NS_SPECIAL
const NS_SPECIAL
Definition: Defines.php:58
SpecialPage\addHelpLink
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Definition: SpecialPage.php:864
SpecialPage\prefixSearchString
prefixSearchString( $search, $limit, $offset)
Perform a regular substring search for prefixSearchSubpages.
Definition: SpecialPage.php:534
SpecialPage\getHookRunner
getHookRunner()
Definition: SpecialPage.php:1011
SpecialPage\getConfig
getConfig()
Shortcut to get main config object.
Definition: SpecialPage.php:794
SpecialPage\addFeedLinks
addFeedLinks( $params)
Adds RSS/atom links.
Definition: SpecialPage.php:846
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
Definition: GlobalFunctions.php:1027
SpecialPage\getCacheTTL
getCacheTTL()
Stable to override.
Definition: SpecialPage.php:242
wfScript
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
Definition: GlobalFunctions.php:2542
SpecialPage\checkLoginSecurityLevel
checkLoginSecurityLevel( $level=null)
Verifies that the user meets the security level, possibly reauthenticating them in the process.
Definition: SpecialPage.php:436
SpecialPage\$mLocalName
$mLocalName
Definition: SpecialPage.php:47
SpecialPage\getTitleValueFor
static getTitleValueFor( $name, $subpage=false, $fragment='')
Get a localised TitleValue object for a specified special page name.
Definition: SpecialPage.php:107
wfTransactionalTimeLimit
wfTransactionalTimeLimit()
Set PHP's time limit to the larger of php.ini or $wgTransactionalTimeLimit.
Definition: GlobalFunctions.php:2650
SpecialPage\getFullTitle
getFullTitle()
Return the full title, including $par.
Definition: SpecialPage.php:804
SpecialPage\isRestricted
isRestricted()
Can be overridden by subclasses with more complicated permissions schemes.
Definition: SpecialPage.php:304
$title
$title
Definition: testCompression.php:38
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!...
Definition: SpecialPage.php:571
SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition: SpecialPage.php:754
SpecialPage\isIncludable
isIncludable()
Whether it's allowed to transclude the special page via {{Special:Foo/params}} Stable to override.
Definition: SpecialPage.php:219
SpecialPage\afterExecute
afterExecute( $subPage)
Gets called after.
Definition: SpecialPage.php:628
SpecialPage\beforeExecute
beforeExecute( $subPage)
Gets called before.
Definition: SpecialPage.php:616
wfDebug
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:910
PROTO_HTTPS
const PROTO_HTTPS
Definition: Defines.php:209
SpecialPage\$hookContainer
HookContainer null $hookContainer
Definition: SpecialPage.php:74
SpecialPage\getContext
getContext()
Gets the context this SpecialPage is executed in.
Definition: SpecialPage.php:717
SpecialPage\requireLogin
requireLogin( $reasonMsg='exception-nologin-text', $titleMsg='exception-nologin')
If the user is not logged in, throws UserNotLoggedIn error.
Definition: SpecialPage.php:373
SpecialPage\setLinkRenderer
setLinkRenderer(LinkRenderer $linkRenderer)
Definition: SpecialPage.php:957
Title\makeTitleSafe
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:617
SpecialPage\userCanExecute
userCanExecute(User $user)
Checks if the given user (identified by an object) can execute this special page (as defined by $mRes...
Definition: SpecialPage.php:320
SpecialPage\getRobotPolicy
getRobotPolicy()
Return the robot policy.
Definition: SpecialPage.php:815
ILanguageConverter
The shared interface for all language converters.
Definition: ILanguageConverter.php:28
SpecialPage\prefixSearchArray
static prefixSearchArray( $search, $limit, array $subpages, $offset)
Helper function for implementations of prefixSearchSubpages() that filter the values in memory (as op...
Definition: SpecialPage.php:561
SpecialPage
Parent class for all special pages.
Definition: SpecialPage.php:41
SpecialPage\listed
listed( $x=null)
Get or set whether this special page is listed in Special:SpecialPages.
Definition: SpecialPage.php:209
SpecialPage\buildPrevNextNavigation
buildPrevNextNavigation( $offset, $limit, array $query=[], $atend=false, $subpage=false)
Generate (prev x| next x) (20|50|100...) type links for paging.
Definition: SpecialPage.php:971
SpecialPage\isCached
isCached()
Is this page cached? Expensive pages are cached or disabled in miser mode.
Definition: SpecialPage.php:292
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:734
SpecialPage\getLoginSecurityLevel
getLoginSecurityLevel()
Tells if the special page does something security-sensitive and needs extra defense against a stolen ...
Definition: SpecialPage.php:389
MWCryptRand\generateHex
static generateHex( $chars)
Generate a run of cryptographically random data and return it in hexadecimal string format.
Definition: MWCryptRand.php:36
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition: RequestContext.php:454
Title\newFromLinkTarget
static newFromLinkTarget(LinkTarget $linkTarget, $forceClone='')
Returns a Title given a LinkTarget.
Definition: Title.php:280
SpecialPage\run
run( $subPage)
Entry point.
Definition: SpecialPage.php:592
SpecialPage\execute
execute( $subPage)
Default execute method Checks user permissions.
Definition: SpecialPage.php:642
MediaWiki\Auth\AuthManager
This serves as the entry point to the authentication system.
Definition: AuthManager.php:88
IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition: IContextSource.php:55
SpecialPage\$mName
$mName
Definition: SpecialPage.php:44
SpecialPage\getLinkRenderer
getLinkRenderer()
Definition: SpecialPage.php:945
Title
Represents a title within MediaWiki.
Definition: Title.php:41
SpecialPage\$hookRunner
HookRunner null $hookRunner
Definition: SpecialPage.php:76
SpecialPage\getSubpagesForPrefixSearch
getSubpagesForPrefixSearch()
Return an array of subpages that this special page will accept for prefix searches.
Definition: SpecialPage.php:523
SpecialPage\$mListed
$mListed
Definition: SpecialPage.php:54
SpecialPage\prefixSearchSubpages
prefixSearchSubpages( $search, $limit, $offset)
Return an array of subpages beginning with $search that this special page will accept.
Definition: SpecialPage.php:505
SpecialPage\setContext
setContext( $context)
Sets the context this SpecialPage is executed in.
Definition: SpecialPage.php:707
MediaWiki\HookContainer\HookContainer
HookContainer class.
Definition: HookContainer.php:45
SpecialPage\setHookContainer
setHookContainer(HookContainer $hookContainer)
Definition: SpecialPage.php:989
SpecialPage\getLanguageConverter
getLanguageConverter()
Shortcut to get language's converter.
Definition: SpecialPage.php:784
MediaWiki\HookContainer\HookRunner
This class provides an implementation of the core hook interfaces, forwarding hook calls to HookConta...
Definition: HookRunner.php:562
SpecialPage\doesWrites
doesWrites()
Indicates whether this special page may perform database writes.
Definition: SpecialPage.php:913
SpecialPage\checkReadOnly
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
Definition: SpecialPage.php:356
$t
$t
Definition: testCompression.php:74
SpecialPage\$linkRenderer
MediaWiki Linker LinkRenderer null $linkRenderer
Definition: SpecialPage.php:71
ErrorPageError
An error page which can definitely be safely rendered using the OutputPage.
Definition: ErrorPageError.php:30
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:56
SpecialPage\outputHeader
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Definition: SpecialPage.php:662
SpecialPage\including
including( $x=null)
Whether the special page is being evaluated via transclusion.
Definition: SpecialPage.php:251
TitleValue
Represents a page (or page fragment) title within MediaWiki.
Definition: TitleValue.php:39
wfArrayToCgi
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes one or two arrays as input, and returns a CGI-style string, e....
Definition: GlobalFunctions.php:346
MediaWiki
The MediaWiki class is the helper class for the index.php entry point.
Definition: MediaWiki.php:36