wp/wp-admin/load-scripts.php
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
equal deleted inserted replaced
4:346c88efed21 5:5e2f62d02dcd
     1 <?php
     1 <?php
     2 
     2 
     3 /**
     3 /**
     4  * Disable error reporting
     4  * Disable error reporting
     5  *
     5  *
     6  * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging
     6  * Set this to error_reporting( -1 ) for debugging.
     7  */
     7  */
     8 error_reporting(0);
     8 error_reporting(0);
     9 
     9 
    10 /** Set ABSPATH for execution */
    10 /** Set ABSPATH for execution */
    11 define( 'ABSPATH', dirname(dirname(__FILE__)) . '/' );
    11 define( 'ABSPATH', dirname(dirname(__FILE__)) . '/' );
   141 
   141 
   142 	$path = ABSPATH . $wp_scripts->registered[$handle]->src;
   142 	$path = ABSPATH . $wp_scripts->registered[$handle]->src;
   143 	$out .= get_file($path) . "\n";
   143 	$out .= get_file($path) . "\n";
   144 }
   144 }
   145 
   145 
   146 header('Content-Type: application/x-javascript; charset=UTF-8');
   146 header('Content-Type: application/javascript; charset=UTF-8');
   147 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
   147 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
   148 header("Cache-Control: public, max-age=$expires_offset");
   148 header("Cache-Control: public, max-age=$expires_offset");
   149 
   149 
   150 if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
   150 if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
   151 	header('Vary: Accept-Encoding'); // Handle proxies
   151 	header('Vary: Accept-Encoding'); // Handle proxies