/** * Gets the uri for the request, keeping the base uri into consideration * * @return string */ public function getRequestUri() { return $this->calculateUri($this->httpRequest->getUri()); }
/** * returns protocol + hostname * * @return string */ public static function getHostname() { $hostname = self::get('HOSTNAME'); if (!$hostname) { $request = new Sabre\HTTP\Request(); $hostname = strlen($request->getUri()) > 1 ? str_replace($request->getUri(), '', $request->getAbsoluteUri()) : $request->getAbsoluteUri(); self::set('HOSTNAME', $hostname); } return $hostname; }
function testGetUri() { $this->assertEquals('/testuri/', $this->request->getUri(), 'We got an invalid uri back'); }