3 * Disable error reporting
5 * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging
9 $basepath = dirname(__FILE__);
11 function get_file($path) {
13 if ( function_exists('realpath') )
14 $path = realpath($path);
16 if ( ! $path || ! @is_file($path) )
19 return @file_get_contents($path);
22 $expires_offset = 31536000;
24 header('Content-Type: application/x-javascript; charset=UTF-8');
25 header('Vary: Accept-Encoding'); // Handle proxies
26 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
27 header("Cache-Control: public, max-age=$expires_offset");
29 if ( isset($_GET['c']) && 1 == $_GET['c'] && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
30 && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {
32 header('Content-Encoding: gzip');
35 echo get_file($basepath . '/tiny_mce.js');