48 $session =
null, $protocol =
'http'
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" );
84 public function getText( $name, $default =
'' ) {
85 # Override; don't recode since we're using internal data
108 return $this->
wasPosted ?
'POST' :
'GET';
115 return $this->wasPosted;
118 public function getCookie( $key, $prefix =
null, $default =
null ) {
119 if ( $prefix ===
null ) {
123 $name = $prefix . $key;
124 return $this->cookies[
$name] ?? $default;
143 if ( $prefix ===
null ) {
148 $name = $prefix . $key;
158 $this->requestUrl = $url;
167 if ( $this->requestUrl ===
null ) {
170 return $this->requestUrl;
174 return $this->protocol;
192 $this->headers[
$name] = $val;
200 if ( $this->sessionId !==
null ) {
201 return iterator_to_array( $this->
getSession() );
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
$wgCookiePrefix
Cookies generated by MediaWiki have names starting with this prefix.
WebRequest clone which takes values from a provided array.
setCookie( $key, $value, $prefix=null)
getText( $name, $default='')
getRawPostString()
FauxRequests shouldn't depend on raw request data (but that could be implemented here)
initHeaders()
Initialise the header list.
checkUrlExtension( $extWhitelist=[])
getRawInput()
FauxRequests shouldn't depend on raw request data (but that could be implemented here)
setCookies( $cookies, $prefix=null)
getProtocol()
Get the current URL protocol (http or https)
getMethod()
Get the HTTP method used for this request.
__construct( $data=[], $wasPosted=false, $session=null, $protocol='http')
getCookie( $key, $prefix=null, $default=null)
Get a cookie from the $_COOKIE jar.
getRawQueryString()
FauxRequests shouldn't depend on raw request data (but that could be implemented here)
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
string $protocol
Cached URL protocol.
getSession()
Return the session for this request.
getVal( $name, $default=null)
Fetch a scalar from the input or return $default if it's not set.
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
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
Allows to change the fields on the form that will be generated $name
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
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN boolean columns are always mapped to as the code does not always treat the column as a and VARBINARY columns should simply be TEXT The only exception is when VARBINARY is used to store true binary data