3 $basepath = dirname(__FILE__);
5 function get_file($path) {
7 if ( function_exists('realpath') )
8 $path = realpath($path);
10 if ( ! $path || ! @is_file($path) )
13 return @file_get_contents($path);
16 $expires_offset = 31536000;
18 header('Content-Type: application/x-javascript; charset=UTF-8');
19 header('Vary: Accept-Encoding'); // Handle proxies
20 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
21 header("Cache-Control: public, max-age=$expires_offset");
23 if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {
24 header('Content-Encoding: gzip');
27 echo get_file($basepath . '/wp-tinymce.js');