Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of chema garrido  >  Smart File Cache  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: usage example
Class: Smart File Cache
Store and retrieve variable values in cache files
Author: By
Last change:
Date: 2010-10-17 13:05
Size: 650 bytes
 

Contents

Class file image Download
<?
include 'fileCache.php';

$cache fileCache::GetInstance(30,'cache/');//creating new instance singleton
 
$cache->setDebug(true);//this runs the debug and in destruct prints it
 
//normal usage
$cache->cache('test','test values for the var!!!!');
echo 
$cache->cache('test');//get
 
//overloads
$cache->anyvar='tes asd asd aasdasdasda sada ast';//overload of set and get methods
echo $cache->anyvar;//get overload
var_dump(isset($cache->anyvar));//isset and unset are overloaded
unset($cache->anyvar);
 
//clear
$cache->deleteCache();//deletes all the cache
$cache->deleteCache(60);//deletes any cache older than X seconds

?>