public static function getSecuredUrl($url, $user = '', $password = '')
    {
        /*
         * Url is not provided?
         * Nothing to do
         */
        if (empty($url)) {
            return '';
        }

        $protocol = self::getProtocolName();
        $host = self::getServerNameOrIp();

        if (!Regex::startsWith($url, '/')) {
            $url = sprintf('/%s', $url);
        }

        $url = $host . $url;

        if (!empty($user) && !empty($password)) {
            $url = sprintf('%s:%s@%s', $user, $password, $url);
        }

        return sprintf('%s://%s', $protocol, $url);
    }