includes/staticwp.class.php
public function load()
    {
        // We only care about GET requests at the moment
        if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
            return;
        }

        $file = $_SERVER['REQUEST_URI'] . 'index.html';
        if (is_file($this->destination . $file)) {
            $contents = file_get_contents($this->destination . $file);
            do_action('staticwp_pre_cache_hit', $_SERVER['REQUEST_URI']);
            echo apply_filters('staticwp_cache_hit_contents', $contents);
            do_action('staticwp_post_cache_hit', $_SERVER['REQUEST_URI']);
            exit();
        } else {
            do_action('staticwp_cache_miss', $_SERVER['REQUEST_URI']);
        }
    }
public function load()
    {
        // We only care about GET requests at the moment
        if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
            return;
        }

        $file = $_SERVER['REQUEST_URI'] . 'index.html';
        if (is_file($this->destination . $file)) {
            $contents = file_get_contents($this->destination . $file);
            do_action('staticwp_pre_cache_hit', $_SERVER['REQUEST_URI']);
            echo apply_filters('staticwp_cache_hit_contents', $contents);
            do_action('staticwp_post_cache_hit', $_SERVER['REQUEST_URI']);
            exit();
        } else {
            do_action('staticwp_cache_miss', $_SERVER['REQUEST_URI']);
        }
    }
public function load ( ) { // We only care about GET requests at the moment if ( $ _SERVER [ 'REQUEST_METHOD' ] !== 'GET' ) { return ; } $ file = $ _SERVER [ 'REQUEST_URI' ] . 'index.html' ; if ( is_file ( $ this -> destination . $ file ) ) { $ contents = file_get_contents ( $ this -> destination . $ file ) ; do_action ( 'staticwp_pre_cache_hit' , $ _SERVER [ 'REQUEST_URI' ] ) ; echo apply_filters ( 'staticwp_cache_hit_contents' , $ contents ) ; do_action ( 'staticwp_post_cache_hit' , $ _SERVER [ 'REQUEST_URI' ] ) ; exit ( ) ; } else { do_action ( 'staticwp_cache_miss' , $ _SERVER [ 'REQUEST_URI' ] ) ; } }
Presents a compiled static HTML file when present.

@since 1.0.0

@return void
Presents a compiled static HTML file when present .