function cdn_exit in CDN 7.2
Same name and namespace in other branches
- 5 cdn.module \cdn_exit()
- 6.2 cdn.module \cdn_exit()
- 6 cdn.module \cdn_exit()
Implements hook_exit().
File
- ./
cdn.module, line 609
Code
function cdn_exit($destination = NULL) {
// When the _cdn_devel_page_stats() function does not exist, there are no
// stats to show, hence we can return immediately.
// This can happen when the stats are disabled (for the current user or
// entirely), or when a cached page is being served.
if (!function_exists('_cdn_devel_page_stats')) {
return;
}
// Try not to break non-HTML pages.
if (function_exists('drupal_get_http_header') && !strstr(drupal_get_http_header('Content-Type'), 'html')) {
return;
}
if (!$destination && variable_get(CDN_STATUS_VARIABLE, CDN_DISABLED) != CDN_DISABLED && variable_get(CDN_STATS_VARIABLE, FALSE) && user_access(CDN_PERM_ACCESS_STATS)) {
list($file_count, $cdn_file_count, $synced_files_per_server_count, $total_time, $synced_files, $unsynced_files, ) = _cdn_devel_page_stats();
print theme('cdn_page_stats', array(
'file_count' => $file_count,
'cdn_file_count' => $cdn_file_count,
'synced_files_per_server_count' => $synced_files_per_server_count,
'total_time' => $total_time,
'synced_files' => $synced_files,
'unsynced_files' => $unsynced_files,
));
}
}