[PHPTAL] Two sites with two identically named templates on one server?

James Davies phptal at foomatic.net
Thu May 10 01:32:57 CEST 2007


I had had the same problem between a dev and live site- Experimental code on
a dev site was showing up on a heavily laden live site with rather
disasterous results.

The problem is the algorithm used to hash the template names into /tmp - It
essentially just md5's the relative path. If you have two projects with
/index.zpt, they will conflict.

The solution was to modify the hashing algorithm to use the full path. In my
case I had a constant defined with my projects path, so I just prepened that
to the  string to be hashed.

I believe there are two locations you'll need to do this, both in
PHPTAL.php- Just grep for 'md5' and you should find the relevant code.

-James.


On 5/9/07, .: smilelover :. <smilelover at centrum.cz> wrote:
>
> Hi,
> I built 2 websites using my web engine that uses PHPTAL. Both sites have a
> template called "index.zpt" and are served by one Apache, from two
> different VirtualHosts. The problem is, that PHPTAL assumes both index.zptfiles to be one file and data in the template cache (in /tmp) get mixed. I
> have content of one site in a template from the other site. Is it possible
> to solve this by something else than renaming one of the templates?
>
> Thanks,
> Dan
>
>
> _______________________________________________
> PHPTAL mailing list
> PHPTAL at lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/phptal/attachments/20070510/4d42cf31/attachment.htm


More information about the PHPTAL mailing list