function advagg_generate_location_uri in Advanced CSS/JS Aggregation 7.2
Given the filename, type, and settings, create absolute URL for 307 redirect.
Due to url inbound alter we can not trust that the redirect will work if using $GLOBALS['base_path'] . $_GET['q']. Generate the uri as if it was going to be embedded in the html.
Parameters
string $filename: Just the filename no path information.
string $type: String: css or js.
array $aggregate_settings: Array of settings.
Return value
string String pointing to the URI of the file.
3 calls to advagg_generate_location_uri()
- advagg_missing_fatal_handler in ./
advagg.missing.inc - Given a filename create that file; usually works if PHP goes fatal.
- advagg_missing_generate in ./
advagg.missing.inc - Generates a missing CSS/JS file and send it to client.
- advagg_missing_send_saved_file in ./
advagg.missing.inc - Send the css/js file to the client.
File
- ./
advagg.missing.inc, line 187 - Advanced CSS/JS aggregation module.
Code
function advagg_generate_location_uri($filename, $type, array $aggregate_settings = array()) {
list($css_path, $js_path) = advagg_get_root_files_dir();
if ($type === 'css') {
$uri_307 = $css_path[0] . '/' . $filename;
}
elseif ($type === 'js') {
$uri_307 = $js_path[0] . '/' . $filename;
}
if (empty($aggregate_settings)) {
$aggregate_settings = advagg_current_hooks_hash_array();
}
// 307s need to be absolute. RFC 2616 14.30.
$aggregate_settings['variables']['advagg_convert_absolute_to_relative_path'] = FALSE;
$aggregate_settings['variables']['advagg_convert_absolute_to_protocol_relative_path'] = FALSE;
// Make advagg_context_switch available.
module_load_include('inc', 'advagg', 'advagg');
advagg_context_switch($aggregate_settings, 0);
$uri_307 = advagg_file_create_url($uri_307, $aggregate_settings);
advagg_context_switch($aggregate_settings, 1);
return $uri_307;
}