PHP Classes

File Cache: Store and retrieve generic data in cache files

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2009-02-26 (7 years ago) RSS 2.0 feedNot enough user ratingsTotal: 438 All time: 5,909 This week: 1,082Up
Version License PHP version Categories
cache_class 1.0GNU General Publi...4.0PHP 5, Cache
Description Author

This class can be used to store and retrieve generic data in cache files.

It can check if a given variable is already stored in a cache file and retrieve its value if it exists and the cache file did not expire.

Otherwise the class can create a new cache file to store a newly computed cache variable value.

Picture of Stanislav Chervenkov
Name: Stanislav Chervenkov <contact>
Classes: 1 package by
Country: Bulgaria Bulgaria
Age: ???
All time rank: 320522 in Bulgaria Bulgaria
Week rank: 1490 Up8 in Bulgaria Bulgaria Up

Using the class:
1. upload the file "cache.class.php" somewhere at your server.
2. create new directory at the server and make it writable.
3. in the file where you'll use the class, include the class
4. make an instance of the class
      $cache = new cache();
5. setup the cache dir:
      $cache->cache_dir = './others/cache'; // the default is ./cache
6. follow the steps from the example (example.php).
  Files folder image Files  
File Role Description
Plain text file cache.class.php Class The main class
Accessible without login Plain text file example.php Example An example using the class
Accessible without login Plain text file README.txt Doc. README file
Accessible without login Plain text file The.GNU.General.Public.License.txt Lic. the GNU license

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:5,909
This week:1,082Up
User Comments (2)
small class but great usability
6 years ago (André Luis)
Why not using the functions that PHP suggest? APC - http://www.
7 years ago (Ralf Mike Pretzlaw)