X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=blobdiff_plain;f=includes%2Fcontext%2FRequestContext.php;h=36c644aa082b9696b31af76054fc6382e70b1e92;hb=174f34a86de3162bc673fd3bc6bed815cccf0edc;hp=9b6e1f3a787f5dc295dbc72648bea39b88b7c7d8;hpb=b59ca1b44cab5f114cb4f12501e1278c2413a716;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index 9b6e1f3a78..36c644aa08 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -123,8 +123,13 @@ class RequestContext implements IContextSource, MutableContext { */ public function getRequest() { if ( $this->request === null ) { - global $wgRequest; # fallback to $wg till we can improve this - $this->request = $wgRequest; + global $wgCommandLineMode; + // create the WebRequest object on the fly + if ( $wgCommandLineMode ) { + $this->request = new FauxRequest( array() ); + } else { + $this->request = new WebRequest(); + } } return $this->request;