Go to the documentation of this file.
248 if ( !is_array( $this->
list ) ) {
251 if ( !$this->config->get(
'DisableInternalSearch' ) ) {
255 if ( $this->config->get(
'EmailAuthentication' ) ) {
260 if ( $this->config->get(
'EnableEmail' ) ) {
264 if ( $this->config->get(
'EnableJavaScriptTest' ) ) {
268 if ( $this->config->get(
'PageLanguageUseDB' ) ) {
271 if ( $this->config->get(
'ContentHandlerUseDB' ) ) {
276 $this->
list = array_merge( $this->
list, $this->config->get(
'SpecialPages' ) );
294 if ( is_null( $this->aliases ) ) {
295 $aliases = $this->contLang->getSpecialPageAliases();
302 foreach ( $pageList
as $name => $stuff ) {
303 $caseFoldedAlias = $this->contLang->caseFold(
$name );
304 $this->aliases[$caseFoldedAlias] =
$name;
305 $keepAlias[$caseFoldedAlias] =
'canonical';
310 foreach (
$aliases as $realName => $aliasList ) {
311 $aliasList = array_values( $aliasList );
312 foreach ( $aliasList
as $i => $alias ) {
313 $caseFoldedAlias = $this->contLang->caseFold( $alias );
315 if ( isset( $this->aliases[$caseFoldedAlias] ) &&
316 $realName === $this->aliases[$caseFoldedAlias]
322 if ( !isset( $keepAlias[$caseFoldedAlias] ) ) {
323 $this->aliases[$caseFoldedAlias] = $realName;
325 $keepAlias[$caseFoldedAlias] =
'first';
328 wfWarn(
"First alias '$alias' for $realName conflicts with " .
329 "{$keepAlias[$caseFoldedAlias]} alias for " .
330 $this->aliases[$caseFoldedAlias]
350 $bits = explode(
'/', $alias, 2 );
352 $caseFoldedAlias = $this->contLang->caseFold( $bits[0] );
353 $caseFoldedAlias = str_replace(
' ',
'_', $caseFoldedAlias );
355 if ( isset(
$aliases[$caseFoldedAlias] ) ) {
358 return [
null, null ];
361 if ( !isset( $bits[1] ) ) {
367 return [
$name, $par ];
380 return isset( $specialPageList[
$title] );
394 if ( isset( $specialPageList[$realName] ) ) {
395 $rec = $specialPageList[$realName];
397 if ( is_callable( $rec ) ) {
400 } elseif ( is_string( $rec ) ) {
402 $page =
new $className;
415 wfLogWarning(
"Cannot instantiate special page $realName: bad spec!" );
435 if ( $page->isListed()
436 && ( !$page->isRestricted() || $page->userCanExecute(
$user ) )
438 $pages[
$name] = $page;
455 if ( $page && $page->isListed() && !$page->isRestricted() ) {
456 $pages[
$name] = $page;
476 && $page->isRestricted()
477 && $page->userCanExecute(
$user )
479 $pages[
$name] = $page;
505 $bits = explode(
'/',
$title->getDBkey(), 2 );
507 if ( !isset( $bits[1] ) ) {
513 $page = $this->
getPage( $name );
523 $context->
getOutput()->showErrorPage(
'nosuchspecialpage',
'nospecialpagetext' );
533 $trxProfiler->setExpectations( $trxLimits[
'POST-nonwrite'], __METHOD__ );
550 $title = $page->getPageTitle( $par );
557 $context->setTitle( $page->getPageTitle( $par ) );
558 } elseif ( !$page->isIncludable() ) {
562 $page->including( $including );
603 'title' => $main->getTitle(),
604 'output' => $main->getOutput(),
605 'request' => $main->getRequest(),
606 'user' => $main->getUser(),
607 'language' => $main->getLanguage(),
616 $main->setTitle(
$title );
629 $wgUser = $glob[
'user'];
631 $main->setTitle( $ctx[
'title'] );
632 $main->setOutput( $ctx[
'output'] );
633 $main->setRequest( $ctx[
'request'] );
634 $main->setUser( $ctx[
'user'] );
635 $main->setLanguage( $ctx[
'language'] );
648 $aliases = $this->contLang->getSpecialPageAliases();
655 $caseFoldedAlias = $this->contLang->caseFold( $alias );
656 $caseFoldedAlias = str_replace(
' ',
'_', $caseFoldedAlias );
657 if ( isset( $aliasList[$caseFoldedAlias] ) &&
658 $aliasList[$caseFoldedAlias] ===
$name
666 wfWarn(
"Did not find a usable alias for special page '$name'. " .
667 "It seems all defined aliases conflict?" );
673 if ( strcasecmp(
$name, $n ) === 0 ) {
674 wfWarn(
"Found alias defined for $n when searching for " .
675 "special page aliases for $name. Case mismatch?" );
681 wfWarn(
"Did not find alias for special page '$name'. " .
682 "Perhaps no aliases are defined for it?" );
685 if ( $subpage !==
false && !is_null( $subpage ) ) {
687 $subpage = str_replace(
' ',
'_', $subpage );
688 $name =
"$name/$subpage";
691 return $this->contLang->ucfirst(
$name );
702 if (
$name !=
null ) {
$wgSend404Code
Some web hosts attempt to rewrite all responses with a 404 (not found) status code,...
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
getAliasList()
Initialise and return the list of special page aliases.
__construct(Config $config, Language $contLang)
static instance()
Singleton.
getRegularPages()
Return categorised listable special pages for all users.
getNames()
Returns a list of canonical special page names.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form before processing starts Return false to skip default processing and return $ret $linkRenderer
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,...
getPageList()
Get the special page list as an array.
wfLogWarning( $msg, $callerOffset=1, $level=E_USER_WARNING)
Send a warning as a PHP error and the debug log.
if(! $wgRequest->checkUrlExtension()) if(isset( $_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] !='') $wgTitle
getUsablePages(User $user)
Return categorised listable special pages which are available for the current user,...
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
null for the wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
Interface for configuration instances.
getTitleForAlias( $alias)
Get a title for a given alias.
namespace and then decline to actually register it file or subcat img or subcat $title
array $list
Special page name => class name.
Profiler base class that defines the interface and some trivial functionality.
executePath(Title &$title, IContextSource &$context, $including=false, LinkRenderer $linkRenderer=null)
Execute a special page path.
getLocalNameFor( $name, $subpage=false)
Get the local name for a specified canonical name.
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
Group all the pieces relevant to the context of a request into one instance.
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Allows to change the fields on the form that will be generated $name
Factory for handling the special page list and generating SpecialPage objects.
Parent class for all special pages.
getRestrictedPages(User $user)
Return categorised listable special pages which are available for the current user,...
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
getPage( $name)
Find the object with a given name and return it (or NULL)
static getMain()
Get the RequestContext object associated with the main request.
Interface for objects which can provide a MediaWiki context on request.
Represents a title within MediaWiki.
resolveAlias( $alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
getConfig()
Get the site configuration.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
capturePath(Title $title, IContextSource $context, LinkRenderer $linkRenderer=null)
Just like executePath() but will override global variables and execute the page in "inclusion" mode.
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
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
if(! $wgDBerrorLogTZ) $wgRequest
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
static $coreList
List of special page names to the subclass of SpecialPage which handles them.
Internationalisation code.
exists( $name)
Check if a given name exist as a special page or as a special page alias.