News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
Cache Data in RAM with PHP
June 08, 2011 @ 10:48:23

DevShed has posted a new article in their series looking at storage interfaces and how to use them. In this latest article they show how to create a caching layer that will allow you to work with any sort of caching backend you'd like.

As with other elements of object-oriented programming, it's possible to use segregated interfaces in a great variety of scenarios and conditions and, therefore, enjoy the benefits that they provide right out of the box. [...] My goal in this article is to create an extendable caching system based on the contract defined by a segregated interface. To achieve this, the first step we need to take is to create the interface in question.

He shows how to create the "CacheableInterface" that provides the structure for the child interfaces to follow. It provides methods for setting, getting, deleting and checking to see if a key exists. They illustrate its use with an interface to an APC cache, a file caching and a class that uses dependency injection to define the interface to use.

0 comments voice your opinion now!
caching data ram tutorial apc filesystem interface


blog comments powered by Disqus

Similar Posts

Richard Thomas' Blog: Pjq becomes jQPie - jQuery PHP interface extension

DevShed: Accessing Attributes and Cloning Nodes with the DOM XML Extension in PHP 5

IBM developerWorks: What's new in PHP V5.2, Part 4: Using the new ZIP extension

SANIsoft Blog: The longer Lithium Blog tutorial using MySQL – Part 1

PHP-GTK Community Site: GtkToolbar, GtkMenubar, and PEAR XML-RPC for geo-nick


Community Events





Don't see your event here?
Let us know!


list tool community laravel composer conference introduction opinion interview symfony voicesoftheelephpant framework library version language podcast example series release security

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework