Home arrow PHP arrow Caching Result Sets in PHP: Porting the Code to PHP 5

Caching Result Sets in PHP: Porting the Code to PHP 5

In this part of the series, you will see in detail an updated version of each class that composes the caching system, for a correct implementation in PHP 5. Also, the “Cache” class will be modified to work with an array processor class that handles array operations. It should help refresh your memory of techniques related to object-oriented programming.

  1. Caching Result Sets in PHP: Porting the Code to PHP 5
  2. One step prior to migrating: caching result sets with PHP 4
  3. Taking advantage of an improved object model: updating the caching system to PHP 5
  4. Yet another modified class: updating the “Result” class
  5. The caching system’s core class: updating the “Cache” class
By: Alejandro Gervasio
Rating: starstarstarstarstar / 6
October 31, 2005

print this article



Welcome to the fifth part of the series “Caching result sets in PHP.” If you’ve been a patient reader, and followed the previous articles in this series, then you probably have a decent grounding in the different methods of developing a result set caching system, without the need to scratch your head looking for more complex solutions.

As a matter of fact, storing a complete result set in a cache file for faster data retrieval and reduced server overload is an extremely versatile technique that brings to developers a greater level of flexibility, since it allows single or multiple post processing of the data, while keeping the inherent benefits of having a caching mechanism working transparently in the backend of a website.

Many websites that use a database as a direct way to store contents that don’t change very often (naturally static), such as a product catalog, or a list of articles, to name a few cases, can significantly improve their performance by implementing a caching solution.

Although the concept behind data caching certainly is not new, as modern developing techniques have emerged and found their place in the market, several approaches may be successfully taken.

Particularly, when working with PHP, where either a procedural programming or an object-oriented approach is taken for solving many development issues, the subject is even richer with possibilities. Keeping in mind this concept, after going through the previous articles, we’ve developed a couple of procedural scripts that might be useful for implementing in small applications.

However, we’ve not forgotten all the benefits of developing some classes that can be integrated within an expandable caching system. Indeed, if we step back for a while to the previous article, we’ve built a time expiry triggered caching class, which allows fast implementation in web applications.

As I mentioned previously, the whole set of developed classes that worked in PHP 4, need to be updated to PHP 5, in order to take advantage of the powerful Object Model that was implemented in this version. So, let’s not waste more time in preliminaries and jump straight into the code. You’ll have a good time reading, I promise.

>>> More PHP Articles          >>> More By Alejandro Gervasio

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: