| 
 
I want to write a new storage type...

It's simple!  All you need to do is create a new file, name it pagecache.method.php (where method is the name of your backend), and put it in the /components/com_pagecache/backends folder.  PageCache will automatically recognize it!  Now, there are a few things that the file MUST have.

First, it must have a class called pagecache_backend which extends pagecace.

Second, the pagecache_backend class must have a few methods.  Those methods are as follows

  • get($pagename) - returns array(0=>$page_body, 1=>$info_array) or false on failure
  • save($page_body, $info_array) - returns true on success, false on failure
  • delete($name) - returns true on success, false on failure
  • clear() - returns true on success, false on failure
  • getLock($name) - returns true on success, false on failure
  • releaseLock($name) - returns true on success, false on failure
  • getList() - returns array of all items active in cache (and the info of each item)

And it's as easy as that!  Check out some of the backends to see how they work in more detail!

Tags
0% of 0 voters found this FAQ useful,  I found this FAQ  useful useful  not useful not useful
< Prev   Next >
feed image
Copyright 2007 Anthony Ferrara, All Rights Reserved