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    
Ratings Unique User Downloads Download Rankings
StarStarStar 50%Total: 443 All time: 6,231 This week: 455Up
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: 342124 in Bulgaria Bulgaria
Week rank: 270 Up2 in Bulgaria Bulgaria Up

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:443
This week:0
All time:6,231
This week:455Up
User Ratings User Comments (2)
 All time
Utility:66%StarStarStarStar
Consistency:58%StarStarStar
Documentation:58%StarStarStar
Examples:58%StarStarStar
Tests:-
Videos:-
Overall:50%StarStarStar
Rank:2621
 
small class but great usability
14 years ago (Andre Luis)
75%StarStarStarStar
Why not using the functions that PHP suggest? APC - http://www.
15 years ago (Ralf Mike Pretzlaw)
37%StarStar