PHP Classes
elePHPant
Icontem

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: 439 All time: 5,939 This week: 853Up
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

Details
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
      require_once('classes/cache.class.php');
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  
 0%
Total:439
This week:0
All time:5,939
This week:853Up
User Comments (2)
small class but great usability
6 years ago (André Luis)
75%StarStarStarStar
Why not using the functions that PHP suggest? APC - http://www.
7 years ago (Ralf Mike Pretzlaw)
37%StarStar