PHP Classes

sqlCache API Library: Cache database query results in files

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   Screenshots Screenshots   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2005-10-24 (10 years ago) RSS 2.0 feedStarStarStarStar 75%Total: 1,246 This week: 2All time: 2,913 This week: 642Up
Version License Categories  
sqlcache 1.0.0GNU General Publi...Databases, Cache
Description Author  

This package can be used to cache the results of SQL database query results in files.

The idea is to increase database application performance by avoided to access databases to retrieve the results of queries being executed repeatedly.

This package provides an API that encapsulates the execution and caching of SQL database queries that maybe executed by several types of database APIs. Currently it supports supports AdoDB and PHPBB DAL.

The package stores cached result sets in files and one table of the database for indexing.

Picture of Dmitry Sheiko
Name: Dmitry Sheiko <contact>
Classes: 9 packages by
Country: Belarus Belarus
Age: 41
All time rank: 671 in Belarus Belarus
Week rank: 139 Down1 in Belarus Belarus Equal
Innovation award
Innovation award
Nominee: 5x

Winner: 1x

SQL Caching API Library

Are there troubles with your DB performance? Use SQL Caching API Library.
This library extends a DB Abstract Layer API up to SQL Caching ability. SQL Caching API Library 1.0 supports AdoDB ( and PHPBB DAL ( 
As far as you see in the examples you have to initiate a DB connection by means of the sqlAPI class constructor. You can use the getFetchListing() method of this class for any SQL query, which returns a set of data rows. If you wish to use caching, you suffice to add APPLYCACHE parameter. Also you must apply modify method for every modifying SQL query.  You may get the trace log from TraceInfo array. The cleanCache method allows to clean cache.
The library uses files for cache storage and one table of DB for indexing. You can rewrite this API in order to cache is kept in server shared memory (see 

How install?
Restore test.sql dump into your DB. Create /cache/ folder and set up 777 permission to it. Copy into /adodb/ folder AdoDB files or copy into /phpbb_dbapi/ folder PHPBB DAL files. If you don’t use any DAL API copy into /phpbb_dbapi/ folder mysql.php and execute phpbb_sample.php.
  • sqlCacheModel2.gif
  • sqlCacheModel1.gif
  Files folder image Files  
File Role Description
Files folder imagecache (1 file)
Files folder imagephpbb_dbapi (1 file)
Plain text file adodb.sqlapi.lib Class SQL API Extension of AdoDB
Plain text file adodb_sample.php Example Sample of ADODB SQL Caching extension
Plain text file phpbb.sqlapi.lib.php Class SQL API Extension of PHPBB DAL
Plain text file phpbb_sample.php Example Sample of PHPBB DAL SQL Caching extension
Plain text file readme.txt Doc. Short documentation
Plain text file sqlcache.lib.php Class SQL Cache Class Library
Plain text file test.sql Data Sample of DB

  Files folder image Files  /  cache  
File Role Description
  Plain text file index.php Example Cache folder (it needs 777 permission)

  Files folder image Files  /  phpbb_dbapi  
File Role Description
  Plain text file mysql.php Example PHPBB MySQL Layer for example

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,246All time:2,913
 This week:2This week:642Up
User Ratings User Comments (1)  
 All time
6 years ago (kishore kumar)