PHP Classes
elePHPant
Icontem

Cache output and objects: Cache the output of PHP scripts in files

Recommend this page to a friend!
  Info   View files View files (11)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2007-03-28 (9 years ago) RSS 2.0 feedStarStarStarStar 69%Total: 3,480 All time: 938 This week: 1,088Down
Version License PHP version Categories
cache 1.0Custom (specified...4.2Cache, Templates
Description Author

This class can be used to cache the output of PHP scripts in files.

It checks if a given cache file exists and is updated. If it is updated, it outputs the cached content. Otherwise it starts capturing the output of the current script.

When the script is done outputting the content to be cached, it should call the class again to check the cache. Then the class updates the captured output.

The class may cache nested scripts that output several blocks of content stored in different cached files and with eventually different expiration times.

This package also comes with a plug-in to cache output of pages generated with Smarty templates.

The class may also cache the serialized values of objects and other types of variables.

Picture of n/a
Name: n/a <contact>
Classes: 2 packages by
Country: Croatia Croatia
Age: 33
All time rank: 6491 in Croatia Croatia
Week rank: 1399 Down2 in Croatia Croatia Down

Details
Cache - cache php output and objects

This class can cache php text output and objects to files.
Constructor for cache blocks is very simple and it requires only one
  "where" loop (see examples for details).
You can also nest multiple blocks, with different expiration times.
Cache class also includes easy to use Smarty plugin.

Basic PHP syntax:
  
  while($cache->save("cache.sample.tmp",60))
  {
    echo("put some code here!");
  }

Basic Smarty syntax:

  {cache file="cache.sample.tmp" time="60"}
    put some code here!
  {/cache}

Dragan Bosnjak
http://wreza.bloger.hr
  Files folder image Files  
File Role Description
Files folder imagesmarty (2 files)
Plain text file cache.php Class Main file
Accessible without login Plain text file test_01_hello_world.php Example Hello World
Accessible without login Plain text file test_02_nested.php Example Example of nested blocks
Accessible without login Plain text file test_03_objects.php Example Caching objects
Accessible without login Plain text file test_04_quotes.php Example Test of serialization with special characters
Accessible without login Plain text file test_05_benchmark.php Example Benchmark example
Accessible without login Plain text file test_06_smarty.php Example Smarty plugin example
Accessible without login Plain text file license.txt Lic. License file
Accessible without login Plain text file readme.txt Doc. Read me

  Files folder image Files  /  smarty  
File Role Description
  Accessible without login Plain text file block.cache.php Aux. Smarty plugin
  Accessible without login Plain text file test_06_smarty.tpl Data Templage for smarty plugin example

 Version Control Unique User Downloads Download Rankings  
 0%
Total:3,480
This week:0
All time:938
This week:1,088Down
User Ratings User Comments (1)
 All time
Utility:89%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:75%StarStarStarStar
Examples:81%StarStarStarStarStar
Tests:-
Videos:-
Overall:69%StarStarStarStar
Rank:298
 
does not work anymore
5 years ago (Alexander Garzon)
25%StarStar