public static function getUrl()
    {
        static $uri = null;

        if (null === $uri) {
            $uri = (true === isset($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : '';

            if (strlen($uri) > 0) {
                $uri = ((true === is_ssl()) ? 'https://' : 'http://') . $uri;
            }

            if (true === isset($_SERVER['SERVER_PORT'])) {
                if ($_SERVER['SERVER_PORT'] !== '80' && $_SERVER['SERVER_PORT'] !== '443') {
                    $uri .= ':'.$_SERVER['SERVER_PORT'];
                }
            }

            $uri .= $_SERVER['REQUEST_URI'];
        }

        return $uri;
    }