PHP Classes

File: example.php

Recommend this page to a friend!
  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: 13 years ago
Size: 650 bytes


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!!!!');
$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
$cache->deleteCache();//deletes all the cache
$cache->deleteCache(60);//deletes any cache older than X seconds