PHP Classes

File: example_with_buffers.php

Recommend this page to a friend!
  Classes of Pablo Albrecht  >  Powerful Caching Class  >  example_with_buffers.php  >  Download  
File: example_with_buffers.php
Role: Example script
Content type: text/plain
Description: Example of the class using buffers
Class: Powerful Caching Class
Cache arbitrary content in files
Author: By
Last change:
Date: 5 years ago
Size: 908 bytes


Class file image Download
* for more coding tuts, snippets and help
* @author: Pablo Albrecht
* @date: 30 January 2011, 04:56 PM

require_once 'CodeLikePandas_final.php';


// Load the caching engine with a simple config array
$config = array(

    // !IMPORTANT: trailing slash's required
    'caching_path' => './cache/',
    // We want to cache only components that have a priority of 50 and above.
    'priority_required' => 50


// Load the caching engine with the config file
$config = './configuration.php';

$cache = new CacheHandler($config);

// start the buffer

// Generate all the content as usual
"This is my content";

// stop the buffer & save the result
$cache->cache_buffer('homepage buffer',1000);

/* End of file */