MediaWiki  master
DerivativeRequest.php
Go to the documentation of this file.
1 <?php
35  private $base;
36  private $ip;
37 
44  public function __construct( WebRequest $base, $data, $wasPosted = false ) {
45  $this->base = $base;
46  parent::__construct( $data, $wasPosted );
47  }
48 
49  public function getCookie( $key, $prefix = null, $default = null ) {
50  return $this->base->getCookie( $key, $prefix, $default );
51  }
52 
53  public function getHeader( $name, $flags = 0 ) {
54  return $this->base->getHeader( $name, $flags );
55  }
56 
57  public function getAllHeaders() {
58  return $this->base->getAllHeaders();
59  }
60 
61  public function getSession() {
62  return $this->base->getSession();
63  }
64 
65  public function getSessionData( $key ) {
66  return $this->base->getSessionData( $key );
67  }
68 
69  public function setSessionData( $key, $data ) {
70  $this->base->setSessionData( $key, $data );
71  }
72 
73  public function getAcceptLang() {
74  return $this->base->getAcceptLang();
75  }
76 
77  public function getIP() {
78  return $this->ip ?: $this->base->getIP();
79  }
80 
81  public function setIP( $ip ) {
82  $this->ip = $ip;
83  }
84 
85  public function getProtocol() {
86  return $this->base->getProtocol();
87  }
88 
89  public function getElapsedTime() {
90  return $this->base->getElapsedTime();
91  }
92 }
getCookie( $key, $prefix=null, $default=null)
Similar to FauxRequest, but only fakes URL parameters and method (POST or GET) and use the base reque...
setSessionData( $key, $data)
getHeader( $name, $flags=0)
array $data
The parameters from $_GET, $_POST and the path router.
Definition: WebRequest.php:47
__construct(WebRequest $base, $data, $wasPosted=false)