@@ 63-77 (lines=15) @@ | ||
60 | ||
61 | $output = file_get_contents($file); |
|
62 | ||
63 | if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) |
|
64 | { |
|
65 | // Check whether a client's browser support gzip-compression. |
|
66 | if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE) |
|
67 | { |
|
68 | $output = gzencode($output); |
|
69 | header('Content-Encoding: gzip'); |
|
70 | } |
|
71 | // Check whether a client's browser support deflate-compression. |
|
72 | elseif (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') !== FALSE) |
|
73 | { |
|
74 | $output = gzdeflate($output); |
|
75 | header('Content-Encoding: deflate'); |
|
76 | } |
|
77 | } |
|
78 | ||
79 | header('Content-Type: text/javascript'); |
|
80 | header('Content-Length: ' . strlen($output)); |
@@ 69-79 (lines=11) @@ | ||
66 | if (extension_loaded('zlib') && !ini_get('zlib.output_compression') && !ini_get('output_handler')) |
|
67 | { |
|
68 | // Check whether a client's browser support gzip-compression. |
|
69 | if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE) |
|
70 | { |
|
71 | $output = gzencode($output); |
|
72 | header('Content-Encoding: gzip'); |
|
73 | } |
|
74 | // Check whether a client's browser support deflate-compression. |
|
75 | elseif (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') !== FALSE) |
|
76 | { |
|
77 | $output = gzdeflate($output); |
|
78 | header('Content-Encoding: deflate'); |
|
79 | } |
|
80 | } |
|
81 | } |
|
82 |