#10 PHP Session caching (part 2)

Chris Thomas

Hi again

this patch is the final part of the php session caching
patch, it basically cleans everything up before I compact
the class layout to remove RSSCache completely,
basically the rss_fetch() function will create the cache
storage object directly, it'll clean up the layers and
remove a stupid proxy class.

the check_cache() method has been generalised to the
point where it is in fact, generic across cache types, the
idea I had was I would use methods to hide how you
check the cache item exists and the timestamp, then I
can move the check_cache method into the
CacheStorage base class and then abstract it....oh
wait, php has *ONLY JUST* got this functionality in 5,
unless someone can tell me I'm wrong. Anyway, it's
generalised and waiting, I guess it's always better
regardless of whether I had my way in the end

I fixed the issue with "where" you store your cache,
$base now is the location of the cached items, in the
FileStore, it's a directory, in the SessionStore, it's in the
$_SESSION superglobal. The alterations are so that
you cannot put a pathname as a array identifier, it'll
chop off the last part of the path and use that,
so ./cache, will become just 'cache' which avoids some
issues with people not reading the docs and wondering
why it doesnt work when they leave the default ./cache
and use session caching


  • Chris Thomas
    Chris Thomas

    drop into magpierss, patch -p1 < patchname.diff