public function getUri($url, $sessionId = true)
{
if (is_string($url) && preg_match('/^http/is', $url)) {
return $url;
}
if (empty($_SERVER['HTTPS'])) {
$protocol = 'http';
} else {
$protocol = 'https';
}
return $protocol . '://' . $_SERVER['HTTP_HOST'] . $this->getUrl($url, false, $sessionId);
}