PHP Classes

File Cache: Store and retrieve generic data in cache files

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 50%Total: 443 All time: 6,237 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

 

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 (4)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:443
This week:0
All time:6,237
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:2660
 
small class but great usability
15 years ago (Andre Luis)
75%StarStarStarStar
Why not using the functions that PHP suggest? APC - http://www.
16 years ago (Ralf Mike Pretzlaw)
37%StarStar