50 $this->requestTime = microtime(
true );
52 if ( is_array(
$data ) ) {
55 throw new MWException(
"FauxRequest() got bogus data" );
58 if ( $session instanceof
MediaWiki\Session\Session ) {
59 $this->sessionId = $session->getSessionId();
60 } elseif ( is_array( $session ) ) {
61 $mwsession = SessionManager::singleton()->getEmptySession( $this );
62 $this->sessionId = $mwsession->getSessionId();
63 foreach ( $session
as $key =>
$value ) {
64 $mwsession->set( $key,
$value );
66 } elseif ( $session !== null ) {
67 throw new MWException(
"FauxRequest() got bogus session" );
85 # Override; don't recode since we're using internal data
108 return $this->
wasPosted ?
'POST' :
'GET';
118 public function getCookie( $key, $prefix = null, $default = null ) {
119 if ( $prefix === null ) {
123 $name = $prefix . $key;
143 if ( $prefix === null ) {
148 $name = $prefix . $key;
157 $this->requestUrl = $url;
165 if ( $this->requestUrl === null ) {
198 if ( $this->sessionId !== null ) {
199 return iterator_to_array( $this->
getSession() );
and how to run hooks for an and one after Each event has a preferably in CamelCase For ArticleDelete hook A clump of code and data that should be run when an event happens This can be either a function and a chunk of data
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
getRawInput()
FauxRequests shouldn't depend on raw request data (but that could be implemented here) ...
getRawPostString()
FauxRequests shouldn't depend on raw request data (but that could be implemented here) ...
string $protocol
Cached URL protocol.
getCookie($key, $prefix=null, $default=null)
getSession()
Return the session for this request.
getRawQueryString()
FauxRequests shouldn't depend on raw request data (but that could be implemented here) ...
when a variable name is used in a it is silently declared as a new local masking the global
__construct($data=[], $wasPosted=false, $session=null, $protocol= 'http')
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add headers
getText($name, $default= '')
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
checkUrlExtension($extWhitelist=[])
getVal($name, $default=null)
Fetch a scalar from the input or return $default if it's not set.
setCookies($cookies, $prefix=null)
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
if($wgLocalInterwiki) if($wgSharedPrefix===false) if($wgSharedSchema===false) if(!$wgCookiePrefix) $wgCookiePrefix
setCookie($key, $value, $prefix=null)
initHeaders()
Initialise the header list.
it sets a lot of them automatically from cookies
Allows to change the fields on the form that will be generated $name