Helper function to build an URL for asynchronous requests.

Paramètres

$filepath: Path to a URI excluding everything to the left and including the base path.

5 calls to _advagg_build_url()
advagg_check_missing_handler dans ./advagg.install
Check to see if the CSS/JS generator is working.
advagg_css_js_file_builder dans ./advagg.module
Aggregate CSS/JS files, putting them in the files directory.
advagg_install_test_async_stream dans ./advagg.install
Test if STREAM_CLIENT_ASYNC_CONNECT can be used.
advagg_js_compress_test_compression dans advagg_js_compress/advagg_js_compress.module
Run various theme functions so the cache is primed.
_advagg_admin_settings_information dans includes/admin.inc

Fichier

./advagg.module, line 3387

Code

function _advagg_build_url($filepath = '') {
    global $base_path;
    // Server auth.
    $auth = '';
    if (isset($_SERVER['AUTH_TYPE']) && $_SERVER['AUTH_TYPE'] == 'Basic') {
        $auth = $_SERVER['PHP_AUTH_USER'] . ':' . $_SERVER['PHP_AUTH_PW'] . '@';
    }
    // Host.
    $ip = variable_get('advagg_server_addr', FALSE);
    if ($ip == -1) {
        $ip = $_SERVER['HTTP_HOST'];
    }
    elseif (empty($ip)) {
        $ip = empty($_SERVER['SERVER_ADDR']) ? '127.0.0.1' : $_SERVER['SERVER_ADDR'];
    }
    // Port.
    $port = '';
    //   if (   isset($_SERVER['SERVER_PORT'])
    //       && is_numeric($_SERVER['SERVER_PORT'])
    //       && ($_SERVER['SERVER_PORT'] != 80 || $_SERVER['SERVER_PORT'] != 443)
    //         ) {
    //     $port = ':' . $_SERVER['SERVER_PORT'];
    //   }
    return 'http://' . $auth . $ip . $port . $base_path . $filepath;
}