On 02-03-2010 at 10:13:15 Robert Goldsmith <rgoldsm...@names.co.uk> wrote:
A big hello from Namesco :)
We've been busy integrating PHPTal into our Zend framework workflow for
a few months now and I'm very happy with what we've been able to do so
far - I hope we will also soon have some cool sources to release back
into the world :)
However, I'm now investigating the ability to use memcache for the
compiled templates and while I can see it would be easy to create a
memcache resolver for loading templates it seems that the prepare()
function is still hard-coded for file-based access.
It is hardcoded, because with APC (or any opcode cache) this is the
fastest option – files are loaded in pre-compiled form from shared memory.
To load file from memcached AFAIK you'd have to eval() the source, and
that cannot be touched by opcode accelerators.
If you don't want to touch spinning platters at all, then perhaps you
could use local, RAM-based filesystem for PHPTAL's template cache?
Template cache directory doesn't have to be shared between servers (the
only caveat is that you'll have to clean it up sometime:
Is there a plan to change this or does anyone have any thoughts or
suggestions on how to deal with this? Worst case, I could subclass the
phptal class and re-write the method but this seems very incompatible
with an easy upgrade path :)
I haven't planned it, but if you have good reason to use memcached I might
consider it or add an extension point to make this easier to customize.
I do have plan to change phptal:cache attribute to use different backends,
because that one doesn't benefit from being on disk at all.
PHPTAL mailing list