[PHPTAL] Template name hashes

2012-08-15 Thread Robert Goldsmith
Hi all, We're implementing a deployment system using phars and pre-compiled templates from phptal and things are mostly going well but we've noticed that the template file hashes appear to be based on the full path of the template when it is initially compiled. Obviously if we then move the

Re: [PHPTAL] Template name hashes

2012-08-15 Thread Kornel Lesi��ski
The fact there are protected methods is historical. There can be interactions between base class and subclasses via overridden protected methods, so protected methods are de-facto a public interface. Subclassing may cause Fragile Base Class Problem (the non-C++ kind), so I prefer to mark

Re: [PHPTAL] Template name hashes

2012-08-15 Thread Robert Goldsmith
The private methods used in the PHPTAL class effectively prevent subclassing to extend / replace the hashing. I can see your argument because the PHPTAL class is still very 'generic' and large despite all the work to have support classes and subclassing it could cause problems in future

Re: [PHPTAL] Template name hashes

2012-08-15 Thread Kornel Lesi��ski
I don't understand why do you need to patch anything else other than getFunctionName and cleanUpGarbage. Change those two and configure temp dir to be your template dir. Unless you want temp dir for phptal:cache separate from template dir? -- regards, Kornel On 15 sie 2012, at 15:56,

Re: [PHPTAL] Template name hashes

2012-08-15 Thread Robert Goldsmith
We actually have 5 template directories so it is easiest to keep the cache dir separate. It also keeps the live environment similar to the dev environment so easier for debugging etc. However, even just subclassing getFunctionName is a problem because we actually need to change a couple of

Re: [PHPTAL] Template name hashes

2012-08-15 Thread Kornel Lesi��ski
I think copypaste of whole getFunctionName is fine. I'm not sure whether it's responsibility of sources to compute the hash. You could however create and set your own template repository class that returns sources that use fake paths. Compile ahead of time is a good use-case. That's