Mail Index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ApacheGallery] Text::Template instead of CGI::FastTemplate patch

As CGI::FastTemplate seems to have been abandoned upstream, and it has
been removed from Debian unstable, the following patch converts A::G
to use Text::Template instead of CGI::FastTemplate.

I'm not sure about the speed hit (if any) of doing this, but I doubt
it'll be noticeable over the time it takes to serve the image.

The changes to the templates are minimal, basically all variable
interpolation has to be surrounded by braces '{}' and you get the
added benifit of being able to use a perl interpreter directly in the
templates. [I've written this patch as directly as possible, but if it
gets incorporated upstream, the whole templating scheme should
probably be tweaked slightly to better utilize Text::Template's

For those of you with pre-existing templates, a simple 

   cd templates; perl -pi -e 's/(?<!\\)(\$[\w\_\d]+)/\{ $1 \}/g'

should get your templates working correctly. is currently running using this patch
as well. [Although, this patch's effects should be totally hidden.]

Don Armstrong

N: Why should I believe that?"
B: Because it's a fact."
N: Fact?"
B: F, A, C, T... fact"
N: So you're saying that I should believe it because it's true. 
   That's your argument?
B: It IS true.
-- "Ploy"

Attachment: text_template_patch.diff.gz
Description: Binary data

Attachment: signature.asc
Description: Digital signature