PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Dmitry Stroganov   PHP Simple Cache   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Sample usage
Class: PHP Simple Cache
Retrieve the current page from a cache file
Author: By
Last change: Minor change
Date: 8 years ago
Size: 348 bytes
 

Contents

Class file image Download
<?php

require_once ('cache/cache.php');

class
main {

    function
main() {
   
        ...
       
       
$this->cache = new cache();
   
    }

    ...
   
    function
show() {
   
       
$html = $this->cache->return_cache();
           
        if (
$html == false) {
           
$html = this->render_site();
        }
       
       
$this->cache->make_cache($html);
   
        echo
$html;
    }

}

?>