WordPress.org

Make WordPress Core

Ticket #6965: gears-manifest.patch

File gears-manifest.patch, 1.2 KB (added by azaozz, 11 years ago)

Speed-up gears-manifest.php, no need to load all of WordPress

  • gears-manifest.php

     
    11<?php
    2 @ require('../wp-config.php');
    32
    4 if ( ! defined('WP_ADMIN') )
    5         define('WP_ADMIN', true);
     3define( 'ABSPATH', dirname(dirname(__FILE__)) );
    64
    7 if ( ! is_a($wp_scripts, 'WP_Scripts') )
    8         $wp_scripts = new WP_Scripts();
     5function __() {}
     6function add_filter() {}
     7function attribute_escape() {}
     8function apply_filters() {}
     9function get_option() {}
     10function is_lighttpd_before_150() {}
     11function is_admin() {return true;}
    912
     13require(ABSPATH . '/wp-includes/script-loader.php');
     14
     15$wp_scripts = new WP_Scripts();
     16
    1017$default_js = $version = '';
    1118foreach ( $wp_scripts->scripts as $script ) {
    1219        if ( empty($script->src) || strpos($script->src, 'tiny_mce_config.php') ) continue;
     
    1825
    1926$version = md5($version);
    2027
    21 nocache_headers();
     28header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
     29header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
     30header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
     31header( 'Pragma: no-cache' );
    2232header( 'Content-Type: application/x-javascript; charset=UTF-8' ); // application/json text/plain ?
    2333?>
    2434{