);
}
- wfRunHooks( 'WebRequestPathInfoRouter', array( $router ) );
+ Hooks::run( 'WebRequestPathInfoRouter', array( $router ) );
$matches = $router->parse( $path );
}
}
# Allow extensions to improve our guess
- wfRunHooks( 'GetIP', array( &$ip ) );
+ Hooks::run( 'GetIP', array( &$ip ) );
if ( !$ip ) {
throw new MWException( "Unable to determine IP." );
class FauxRequest extends WebRequest {
private $wasPosted = false;
private $session = array();
+ private $requestUrl;
/**
* @param array $data Array of *non*-urlencoded key => value pairs, the
return false;
}
+ public function setRequestURL( $url ) {
+ $this->requestUrl = $url;
+ }
+
public function getRequestURL() {
- $this->notImplemented( __METHOD__ );
+ if ( $this->requestUrl === null ) {
+ throw new MWException( 'Request URL not set' );
+ }
+ return $this->requestUrl;
}
public function getProtocol() {