setPath($url); } $parts = parse_url($url); $self->setBasePath($request->getBaseUrl()); if (isset($parts['path'])) { $self->setPath($parts['path']); } if (isset($urlParts['query'])) { $params = UrlParams::fromQueryString($urlParts['query'])->mergeValues($params); } if (isset($parts['fragment'])) { $self->setAnchor($parts['fragment']); } $self->setParams($params); return $self; } public function setBasePath($basePath) { if (property_exists($this, 'basePath')) { parent::setBasePath($basePath); } else { return $this->setBaseUrl($basePath); } } protected static function getRequest() { $app = Icinga::app(); if ($app->isCli()) { return new FakeRequest(); } else { return $app->getRequest(); } } }