Alt to http_build_url().

Paramètres

array $parsed: Array from parse_url().

bool $strip_query_and_fragment: If set to TRUE the query and fragment will be removed from the output.

Return value

string URI is returned.

Voir aussi

http://php.net/parse-url#85963

7 calls to advagg_glue_url()
advagg_add_dns_prefetch dans ./advagg.module
Add in the dns-prefetch header for CSS and JS external files.
advagg_file_create_url dans ./advagg.module
Wrapper around file_create_url() to do post-processing on the created url.
advagg_install_check_via_http dans ./advagg.install
Make sure http requests to css/js files work correctly.
advagg_install_url_mod dans ./advagg.install
Modify $url and $options before making the HTTP request.
advagg_load_css_stylesheet dans ./advagg.inc
Loads the stylesheet and resolves all @import commands.

... See full list

Fichier

./advagg.module, line 5477

Code

function advagg_glue_url(array $parsed, $strip_query_and_fragment = FALSE) {
    $uri = '';
    if (isset($parsed['scheme'])) {
        switch (strtolower($parsed['scheme'])) {
            // Mailto uri.
            case 'mailto':
                $uri .= $parsed['scheme'] . ':';
                break;
            // Protocol relative uri.
            case '//':
                $uri .= $parsed['scheme'];
                break;
            // Standard uri.
            default:
                $uri .= $parsed['scheme'] . '://';
        }
    }
    $uri .= isset($parsed['user']) ? $parsed['user'] . (isset($parsed['pass']) ? ':' . $parsed['pass'] : '') . '@' : '';
    $uri .= isset($parsed['host']) ? $parsed['host'] : '';
    $uri .= !empty($parsed['port']) ? ':' . $parsed['port'] : '';
    if (isset($parsed['path'])) {
        $uri .= substr($parsed['path'], 0, 1) === '/' ? $parsed['path'] : (!empty($uri) ? '/' : '') . $parsed['path'];
    }
    if (!$strip_query_and_fragment) {
        $uri .= isset($parsed['query']) ? '?' . $parsed['query'] : '';
        $uri .= isset($parsed['fragment']) ? '#' . $parsed['fragment'] : '';
    }
    return $uri;
}