MediaWiki  master
SpecialPage.php
Go to the documentation of this file.
1 <?php
30 
39 class SpecialPage implements MessageLocalizer {
40  // The canonical name of this special page
41  // Also used for the default <h1> heading, @see getDescription()
42  protected $mName;
43 
44  // The local name of this special page
45  private $mLocalName;
46 
47  // Minimum user level required to access this page, or "" for anyone.
48  // Also used to categorise the pages in Special:Specialpages
49  protected $mRestriction;
50 
51  // Listed in Special:Specialpages?
52  private $mListed;
53 
54  // Whether or not this special page is being included from an article
55  protected $mIncluding;
56 
57  // Whether the special page can be included in an article
58  protected $mIncludable;
59 
64  protected $mContext;
65 
69  private $linkRenderer;
70 
72  private $hookContainer;
74  private $hookRunner;
75 
90  public static function getTitleFor( $name, $subpage = false, $fragment = '' ) {
92  self::getTitleValueFor( $name, $subpage, $fragment )
93  );
94  }
95 
105  public static function getTitleValueFor( $name, $subpage = false, $fragment = '' ) {
106  $name = MediaWikiServices::getInstance()->getSpecialPageFactory()->
107  getLocalNameFor( $name, $subpage );
108 
109  return new TitleValue( NS_SPECIAL, $name, $fragment );
110  }
111 
119  public static function getSafeTitleFor( $name, $subpage = false ) {
120  $name = MediaWikiServices::getInstance()->getSpecialPageFactory()->
121  getLocalNameFor( $name, $subpage );
122  if ( $name ) {
123  return Title::makeTitleSafe( NS_SPECIAL, $name );
124  } else {
125  return null;
126  }
127  }
128 
146  public function __construct(
147  $name = '', $restriction = '', $listed = true,
148  $function = false, $file = '', $includable = false
149  ) {
150  $this->mName = $name;
151  $this->mRestriction = $restriction;
152  $this->mListed = $listed;
153  $this->mIncludable = $includable;
154  }
155 
160  public function getName() {
161  return $this->mName;
162  }
163 
168  public function getRestriction() {
169  return $this->mRestriction;
170  }
171 
172  // @todo FIXME: Decide which syntax to use for this, and stick to it
173 
179  public function isListed() {
180  return $this->mListed;
181  }
182 
191  public function setListed( $listed ) {
192  wfDeprecated( __METHOD__, '1.35' );
193  return wfSetVar( $this->mListed, $listed );
194  }
195 
204  public function listed( $x = null ) {
205  wfDeprecated( __METHOD__, '1.35' );
206  return wfSetVar( $this->mListed, $x );
207  }
208 
213  public function isIncludable() {
214  return $this->mIncludable;
215  }
216 
227  public function maxIncludeCacheTime() {
228  return $this->getConfig()->get( 'MiserMode' ) ? $this->getCacheTTL() : 0;
229  }
230 
234  protected function getCacheTTL() {
235  return 60 * 60;
236  }
237 
243  public function including( $x = null ) {
244  return wfSetVar( $this->mIncluding, $x );
245  }
246 
251  public function getLocalName() {
252  if ( !isset( $this->mLocalName ) ) {
253  $this->mLocalName = MediaWikiServices::getInstance()->getSpecialPageFactory()->
254  getLocalNameFor( $this->mName );
255  }
256 
257  return $this->mLocalName;
258  }
259 
268  public function isExpensive() {
269  return false;
270  }
271 
281  public function isCached() {
282  return false;
283  }
284 
292  public function isRestricted() {
293  // DWIM: If anons can do something, then it is not restricted
294  return $this->mRestriction != '' && !MediaWikiServices::getInstance()
295  ->getPermissionManager()
296  ->groupHasPermission( '*', $this->mRestriction );
297  }
298 
307  public function userCanExecute( User $user ) {
308  return MediaWikiServices::getInstance()
309  ->getPermissionManager()
310  ->userHasRight( $user, $this->mRestriction );
311  }
312 
317  protected function displayRestrictionError() {
318  throw new PermissionsError( $this->mRestriction );
319  }
320 
328  public function checkPermissions() {
329  if ( !$this->userCanExecute( $this->getUser() ) ) {
330  $this->displayRestrictionError();
331  }
332  }
333 
341  public function checkReadOnly() {
342  if ( wfReadOnly() ) {
343  throw new ReadOnlyError;
344  }
345  }
346 
358  public function requireLogin(
359  $reasonMsg = 'exception-nologin-text', $titleMsg = 'exception-nologin'
360  ) {
361  if ( $this->getUser()->isAnon() ) {
362  throw new UserNotLoggedIn( $reasonMsg, $titleMsg );
363  }
364  }
365 
373  protected function getLoginSecurityLevel() {
374  return false;
375  }
376 
391  protected function setReauthPostData( array $data ) {
392  }
393 
419  protected function checkLoginSecurityLevel( $level = null ) {
420  $level = $level ?: $this->getName();
421  $key = 'SpecialPage:reauth:' . $this->getName();
422  $request = $this->getRequest();
423 
424  $securityStatus = MediaWikiServices::getInstance()->getAuthManager()
425  ->securitySensitiveOperationStatus( $level );
426  if ( $securityStatus === AuthManager::SEC_OK ) {
427  $uniqueId = $request->getVal( 'postUniqueId' );
428  if ( $uniqueId ) {
429  $key .= ':' . $uniqueId;
430  $session = $request->getSession();
431  $data = $session->getSecret( $key );
432  if ( $data ) {
433  $session->remove( $key );
434  $this->setReauthPostData( $data );
435  }
436  }
437  return true;
438  } elseif ( $securityStatus === AuthManager::SEC_REAUTH ) {
439  $title = self::getTitleFor( 'Userlogin' );
440  $queryParams = $request->getQueryValues();
441 
442  if ( $request->wasPosted() ) {
443  $data = array_diff_assoc( $request->getValues(), $request->getQueryValues() );
444  if ( $data ) {
445  // unique ID in case the same special page is open in multiple browser tabs
446  $uniqueId = MWCryptRand::generateHex( 6 );
447  $key .= ':' . $uniqueId;
448  $queryParams['postUniqueId'] = $uniqueId;
449  $session = $request->getSession();
450  $session->persist(); // Just in case
451  $session->setSecret( $key, $data );
452  }
453  }
454 
455  $query = [
456  'returnto' => $this->getFullTitle()->getPrefixedDBkey(),
457  'returntoquery' => wfArrayToCgi( array_diff_key( $queryParams, [ 'title' => true ] ) ),
458  'force' => $level,
459  ];
460  $url = $title->getFullURL( $query, false, PROTO_HTTPS );
461 
462  $this->getOutput()->redirect( $url );
463  return false;
464  }
465 
466  $titleMessage = wfMessage( 'specialpage-securitylevel-not-allowed-title' );
467  $errorMessage = wfMessage( 'specialpage-securitylevel-not-allowed' );
468  throw new ErrorPageError( $titleMessage, $errorMessage );
469  }
470 
487  public function prefixSearchSubpages( $search, $limit, $offset ) {
488  $subpages = $this->getSubpagesForPrefixSearch();
489  if ( !$subpages ) {
490  return [];
491  }
492 
493  return self::prefixSearchArray( $search, $limit, $subpages, $offset );
494  }
495 
504  protected function getSubpagesForPrefixSearch() {
505  return [];
506  }
507 
515  protected function prefixSearchString( $search, $limit, $offset ) {
516  $title = Title::newFromText( $search );
517  if ( !$title || !$title->canExist() ) {
518  // No prefix suggestion in special and media namespace
519  return [];
520  }
521 
522  $searchEngine = MediaWikiServices::getInstance()->newSearchEngine();
523  $searchEngine->setLimitOffset( $limit, $offset );
524  $searchEngine->setNamespaces( [] );
525  $result = $searchEngine->defaultPrefixSearch( $search );
526  return array_map( function ( Title $t ) {
527  return $t->getPrefixedText();
528  }, $result );
529  }
530 
542  protected static function prefixSearchArray( $search, $limit, array $subpages, $offset ) {
543  $escaped = preg_quote( $search, '/' );
544  return array_slice( preg_grep( "/^$escaped/i",
545  array_slice( $subpages, $offset ) ), 0, $limit );
546  }
547 
551  protected function setHeaders() {
552  $out = $this->getOutput();
553  $out->setArticleRelated( false );
554  $out->setRobotPolicy( $this->getRobotPolicy() );
555  $out->setPageTitle( $this->getDescription() );
556  if ( $this->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
557  $out->addModuleStyles( [
558  'mediawiki.ui.input',
559  'mediawiki.ui.radio',
560  'mediawiki.ui.checkbox',
561  ] );
562  }
563  }
564 
572  final public function run( $subPage ) {
573  if ( !$this->getHookRunner()->onSpecialPageBeforeExecute( $this, $subPage ) ) {
574  return;
575  }
576 
577  if ( $this->beforeExecute( $subPage ) === false ) {
578  return;
579  }
580  $this->execute( $subPage );
581  $this->afterExecute( $subPage );
582 
583  $this->getHookRunner()->onSpecialPageAfterExecute( $this, $subPage );
584  }
585 
595  protected function beforeExecute( $subPage ) {
596  // No-op
597  }
598 
606  protected function afterExecute( $subPage ) {
607  // No-op
608  }
609 
618  public function execute( $subPage ) {
619  $this->setHeaders();
620  $this->checkPermissions();
621  $securityLevel = $this->getLoginSecurityLevel();
622  if ( $securityLevel !== false && !$this->checkLoginSecurityLevel( $securityLevel ) ) {
623  return;
624  }
625  $this->outputHeader();
626  }
627 
636  protected function outputHeader( $summaryMessageKey = '' ) {
637  if ( $summaryMessageKey == '' ) {
638  $msg = MediaWikiServices::getInstance()->getContentLanguage()->lc( $this->getName() ) .
639  '-summary';
640  } else {
641  $msg = $summaryMessageKey;
642  }
643  if ( !$this->msg( $msg )->isDisabled() && !$this->including() ) {
644  $this->getOutput()->wrapWikiMsg(
645  "<div class='mw-specialpage-summary'>\n$1\n</div>", $msg );
646  }
647  }
648 
658  public function getDescription() {
659  return $this->msg( strtolower( $this->mName ) )->text();
660  }
661 
669  public function getPageTitle( $subpage = false ) {
670  return self::getTitleFor( $this->mName, $subpage );
671  }
672 
679  public function setContext( $context ) {
680  $this->mContext = $context;
681  }
682 
689  public function getContext() {
690  if ( $this->mContext instanceof IContextSource ) {
691  return $this->mContext;
692  } else {
693  wfDebug( __METHOD__ . " called and \$mContext is null. " .
694  "Return RequestContext::getMain(); for sanity" );
695 
696  return RequestContext::getMain();
697  }
698  }
699 
706  public function getRequest() {
707  return $this->getContext()->getRequest();
708  }
709 
716  public function getOutput() {
717  return $this->getContext()->getOutput();
718  }
719 
726  public function getUser() {
727  return $this->getContext()->getUser();
728  }
729 
736  public function getSkin() {
737  return $this->getContext()->getSkin();
738  }
739 
746  public function getLanguage() {
747  return $this->getContext()->getLanguage();
748  }
749 
756  protected function getLanguageConverter(): ILanguageConverter {
757  return MediaWikiServices::getInstance()->getLanguageConverterFactory()
758  ->getLanguageConverter();
759  }
760 
766  public function getConfig() {
767  return $this->getContext()->getConfig();
768  }
769 
776  public function getFullTitle() {
777  return $this->getContext()->getTitle();
778  }
779 
787  protected function getRobotPolicy() {
788  return 'noindex,nofollow';
789  }
790 
800  public function msg( $key, ...$params ) {
801  $message = $this->getContext()->msg( $key, ...$params );
802  // RequestContext passes context to wfMessage, and the language is set from
803  // the context, but setting the language for Message class removes the
804  // interface message status, which breaks for example usernameless gender
805  // invocations. Restore the flag when not including special page in content.
806  if ( $this->including() ) {
807  $message->setInterfaceMessageFlag( false );
808  }
809 
810  return $message;
811  }
812 
818  protected function addFeedLinks( $params ) {
819  $feedTemplate = wfScript( 'api' );
820 
821  foreach ( $this->getConfig()->get( 'FeedClasses' ) as $format => $class ) {
822  $theseParams = $params + [ 'feedformat' => $format ];
823  $url = wfAppendQuery( $feedTemplate, $theseParams );
824  $this->getOutput()->addFeedLink( $format, $url );
825  }
826  }
827 
836  public function addHelpLink( $to, $overrideBaseUrl = false ) {
837  if ( $this->including() ) {
838  return;
839  }
840 
841  $msg = $this->msg(
842  MediaWikiServices::getInstance()->getContentLanguage()->lc( $this->getName() ) .
843  '-helppage' );
844 
845  if ( !$msg->isDisabled() ) {
846  $helpUrl = Skin::makeUrl( $msg->plain() );
847  $this->getOutput()->addHelpLink( $helpUrl, true );
848  } else {
849  $this->getOutput()->addHelpLink( $to, $overrideBaseUrl );
850  }
851  }
852 
861  public function getFinalGroupName() {
862  $name = $this->getName();
863 
864  // Allow overriding the group from the wiki side
865  $msg = $this->msg( 'specialpages-specialpagegroup-' . strtolower( $name ) )->inContentLanguage();
866  if ( !$msg->isBlank() ) {
867  $group = $msg->text();
868  } else {
869  // Than use the group from this object
870  $group = $this->getGroupName();
871  }
872 
873  return $group;
874  }
875 
882  public function doesWrites() {
883  return false;
884  }
885 
894  protected function getGroupName() {
895  return 'other';
896  }
897 
902  protected function useTransactionalTimeLimit() {
903  if ( $this->getRequest()->wasPosted() ) {
905  }
906  }
907 
912  public function getLinkRenderer() {
913  if ( $this->linkRenderer ) {
914  return $this->linkRenderer;
915  } else {
916  return MediaWikiServices::getInstance()->getLinkRenderer();
917  }
918  }
919 
925  $this->linkRenderer = $linkRenderer;
926  }
927 
938  protected function buildPrevNextNavigation(
939  $offset,
940  $limit,
941  array $query = [],
942  $atend = false,
943  $subpage = false
944  ) {
945  $title = $this->getPageTitle( $subpage );
946  $prevNext = new PrevNextNavigationRenderer( $this );
947 
948  return $prevNext->buildPrevNextNavigation( $title, $offset, $limit, $query, $atend );
949  }
950 
957  $this->hookContainer = $hookContainer;
958  $this->hookRunner = new HookRunner( $hookContainer );
959  }
960 
965  protected function getHookContainer() {
966  if ( !$this->hookContainer ) {
967  $this->hookContainer = MediaWikiServices::getInstance()->getHookContainer();
968  }
969  return $this->hookContainer;
970  }
971 
978  protected function getHookRunner() {
979  if ( !$this->hookRunner ) {
980  $this->hookRunner = new HookRunner( $this->getHookContainer() );
981  }
982  return $this->hookRunner;
983  }
984 }
ReadOnlyError
Show an error when the wiki is locked/read-only and the user tries to do something that requires writ...
Definition: ReadOnlyError.php:28
SpecialPage\$mIncluding
$mIncluding
Definition: SpecialPage.php:55
SpecialPage\getPageTitle
getPageTitle( $subpage=false)
Get a self-referential title object.
Definition: SpecialPage.php:669
SpecialPage\getFinalGroupName
getFinalGroupName()
Get the group that the special page belongs in on Special:SpecialPage Use this method,...
Definition: SpecialPage.php:861
SpecialPage\msg
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:800
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:329
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:716
SpecialPage\isExpensive
isExpensive()
Is this page expensive (for some definition of expensive)? Expensive pages are disabled or cached in ...
Definition: SpecialPage.php:268
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:152
SpecialPage\maxIncludeCacheTime
maxIncludeCacheTime()
How long to cache page when it is being included.
Definition: SpecialPage.php:227
SpecialPage\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialPage.php:894
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:1546
MediaWiki\Linker\LinkRenderer
Class that generates HTML links for pages.
Definition: LinkRenderer.php:43
UserNotLoggedIn
Redirect a user to the login page.
Definition: UserNotLoggedIn.php:53
SpecialPage\$mIncludable
$mIncludable
Definition: SpecialPage.php:58
SpecialPage\checkPermissions
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
Definition: SpecialPage.php:328
SpecialPage\setReauthPostData
setReauthPostData(array $data)
Record preserved POST data after a reauthentication.
Definition: SpecialPage.php:391
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:146
SpecialPage\displayRestrictionError
displayRestrictionError()
Output an error message telling the user what access level they have to have.
Definition: SpecialPage.php:317
SpecialPage\setListed
setListed( $listed)
Set whether this page is listed in Special:Specialpages, at run-time.
Definition: SpecialPage.php:191
$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:1128
SpecialPage\getLocalName
getLocalName()
Get the localised name of the special page.
Definition: SpecialPage.php:251
wfMessage
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Definition: GlobalFunctions.php:1222
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:90
SpecialPage\getHookContainer
getHookContainer()
Definition: SpecialPage.php:965
SpecialPage\$mContext
IContextSource $mContext
Current request context.
Definition: SpecialPage.php:64
SpecialPage\getSkin
getSkin()
Shortcut to get the skin being used for this instance.
Definition: SpecialPage.php:736
SpecialPage\useTransactionalTimeLimit
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition: SpecialPage.php:902
PermissionsError
Show an error when a user tries to do something they do not have the necessary permissions for.
Definition: PermissionsError.php:30
SpecialPage\getLanguage
getLanguage()
Shortcut to get user's language.
Definition: SpecialPage.php:746
SpecialPage\getName
getName()
Get the name of this Special Page.
Definition: SpecialPage.php:160
SpecialPage\isListed
isListed()
Whether this special page is listed in Special:SpecialPages.
Definition: SpecialPage.php:179
MessageLocalizer
Interface for localizing messages in MediaWiki.
Definition: MessageLocalizer.php:27
SpecialPage\getRestriction
getRestriction()
Get the permission that a user must have to execute this page.
Definition: SpecialPage.php:168
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:119
SpecialPage\$mRestriction
$mRestriction
Definition: SpecialPage.php:49
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:658
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:836
SpecialPage\prefixSearchString
prefixSearchString( $search, $limit, $offset)
Perform a regular substring search for prefixSearchSubpages.
Definition: SpecialPage.php:515
SpecialPage\getHookRunner
getHookRunner()
Definition: SpecialPage.php:978
SpecialPage\getConfig
getConfig()
Shortcut to get main config object.
Definition: SpecialPage.php:766
SpecialPage\addFeedLinks
addFeedLinks( $params)
Adds RSS/atom links.
Definition: SpecialPage.php:818
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
Definition: GlobalFunctions.php:1029
SpecialPage\getCacheTTL
getCacheTTL()
Definition: SpecialPage.php:234
wfScript
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
Definition: GlobalFunctions.php:2531
SpecialPage\checkLoginSecurityLevel
checkLoginSecurityLevel( $level=null)
Verifies that the user meets the security level, possibly reauthenticating them in the process.
Definition: SpecialPage.php:419
SpecialPage\$mLocalName
$mLocalName
Definition: SpecialPage.php:45
SpecialPage\getTitleValueFor
static getTitleValueFor( $name, $subpage=false, $fragment='')
Get a localised TitleValue object for a specified special page name.
Definition: SpecialPage.php:105
wfTransactionalTimeLimit
wfTransactionalTimeLimit()
Set PHP's time limit to the larger of php.ini or $wgTransactionalTimeLimit.
Definition: GlobalFunctions.php:2689
SpecialPage\getFullTitle
getFullTitle()
Return the full title, including $par.
Definition: SpecialPage.php:776
SpecialPage\isRestricted
isRestricted()
Can be overridden by subclasses with more complicated permissions schemes.
Definition: SpecialPage.php:292
$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:551
SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition: SpecialPage.php:726
SpecialPage\isIncludable
isIncludable()
Whether it's allowed to transclude the special page via {{Special:Foo/params}}.
Definition: SpecialPage.php:213
SpecialPage\afterExecute
afterExecute( $subPage)
Gets called after.
Definition: SpecialPage.php:606
SpecialPage\beforeExecute
beforeExecute( $subPage)
Gets called before.
Definition: SpecialPage.php:595
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:912
PROTO_HTTPS
const PROTO_HTTPS
Definition: Defines.php:209
SpecialPage\$hookContainer
HookContainer null $hookContainer
Definition: SpecialPage.php:72
SpecialPage\getContext
getContext()
Gets the context this SpecialPage is executed in.
Definition: SpecialPage.php:689
SpecialPage\requireLogin
requireLogin( $reasonMsg='exception-nologin-text', $titleMsg='exception-nologin')
If the user is not logged in, throws UserNotLoggedIn error.
Definition: SpecialPage.php:358
SpecialPage\setLinkRenderer
setLinkRenderer(LinkRenderer $linkRenderer)
Definition: SpecialPage.php:924
Title\makeTitleSafe
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:618
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:307
SpecialPage\getRobotPolicy
getRobotPolicy()
Return the robot policy.
Definition: SpecialPage.php:787
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:542
SpecialPage
Parent class for all special pages.
Definition: SpecialPage.php:39
SpecialPage\listed
listed( $x=null)
Get or set whether this special page is listed in Special:SpecialPages.
Definition: SpecialPage.php:204
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:938
SpecialPage\isCached
isCached()
Is this page cached? Expensive pages are cached or disabled in miser mode.
Definition: SpecialPage.php:281
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:706
SpecialPage\getLoginSecurityLevel
getLoginSecurityLevel()
Tells if the special page does something security-sensitive and needs extra defense against a stolen ...
Definition: SpecialPage.php:373
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:451
Title\newFromLinkTarget
static newFromLinkTarget(LinkTarget $linkTarget, $forceClone='')
Returns a Title given a LinkTarget.
Definition: Title.php:281
SpecialPage\run
run( $subPage)
Entry point.
Definition: SpecialPage.php:572
SpecialPage\execute
execute( $subPage)
Default execute method Checks user permissions.
Definition: SpecialPage.php:618
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:53
SpecialPage\$mName
$mName
Definition: SpecialPage.php:42
SpecialPage\getLinkRenderer
getLinkRenderer()
Definition: SpecialPage.php:912
Title
Represents a title within MediaWiki.
Definition: Title.php:42
Skin\makeUrl
static makeUrl( $name, $urlaction='')
Definition: Skin.php:1229
SpecialPage\$hookRunner
HookRunner null $hookRunner
Definition: SpecialPage.php:74
SpecialPage\getSubpagesForPrefixSearch
getSubpagesForPrefixSearch()
Return an array of subpages that this special page will accept for prefix searches.
Definition: SpecialPage.php:504
SpecialPage\$mListed
$mListed
Definition: SpecialPage.php:52
SpecialPage\prefixSearchSubpages
prefixSearchSubpages( $search, $limit, $offset)
Return an array of subpages beginning with $search that this special page will accept.
Definition: SpecialPage.php:487
SpecialPage\setContext
setContext( $context)
Sets the context this SpecialPage is executed in.
Definition: SpecialPage.php:679
MediaWiki\HookContainer\HookContainer
HookContainer class.
Definition: HookContainer.php:44
SpecialPage\setHookContainer
setHookContainer(HookContainer $hookContainer)
Definition: SpecialPage.php:956
SpecialPage\getLanguageConverter
getLanguageConverter()
Shortcut to get language's converter.
Definition: SpecialPage.php:756
MediaWiki\HookContainer\HookRunner
This class provides an implementation of the core hook interfaces, forwarding hook calls to HookConta...
Definition: HookRunner.php:571
SpecialPage\doesWrites
doesWrites()
Indicates whether this special page may perform database writes.
Definition: SpecialPage.php:882
SpecialPage\checkReadOnly
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
Definition: SpecialPage.php:341
$t
$t
Definition: testCompression.php:74
SpecialPage\$linkRenderer
MediaWiki Linker LinkRenderer null $linkRenderer
Definition: SpecialPage.php:69
ErrorPageError
An error page which can definitely be safely rendered using the OutputPage.
Definition: ErrorPageError.php:27
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:54
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:636
SpecialPage\including
including( $x=null)
Whether the special page is being evaluated via transclusion.
Definition: SpecialPage.php:243
TitleValue
Represents a page (or page fragment) title within MediaWiki.
Definition: TitleValue.php:37
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