PHP Classes

CachClass: Store and retrieve cached data in files

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 509 All time: 5,771 This week: 455Up
Version License PHP version Categories
cachclass 1.01GNU General Publi...7.4PHP 5, Files and Folders, Cache
Description 

Author

This class can store and retrieve cached data in files.

It can store an arbitrary data string in a cache file with a given name.

The class can also check if the cache file did not expire and in that case retrieve the cached data.

The directory where cache files are stored, the cache file name extension and the cache expiry time are configurable parameters.

The code and the comments are in German.

In German:

Mit dieser Classe können Sie ausgaben von Programmteilen in ein Textfile speichern um eine neuausfuehrung des Programmteil für eine bestimmte Zeit zu unterbinden.

Picture of Nico Schubert
  Performance   Level  
Name: Nico Schubert <contact>
Classes: 1 package by
Country: Germany Germany
Age: 41
All time rank: 3254186 in Germany Germany
Week rank: 216 Up9 in Germany Germany Up

Example

<?php
include(dirname(__FILE__).'/cachen.class.php');
$cache=new cachen(dirname(__FILE__),'testfile', 300);
if(
$cache->cachen_check()){
   
$text='Das ist mein Text';
   
$ausgabe=$cache->cach_load($text);
    echo
$ausgabe;
}else {
   
$ausgabe=$cache->cach_load();
    echo
$ausgabe;
}
?>


  Files folder image Files (3)  
File Role Description
Accessible without login Plain text file cachen.class.php Class Die Class...
Accessible without login Plain text file example_cachen.php Example Beispiel
Accessible without login Plain text file LICENSE.txt Lic. 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:509
This week:0
All time:5,771
This week:455Up