[PHPTAL] Two sites with two identically named templates on one
server?
Levi Stanley
levi at eneservices.com
Fri May 11 14:37:28 CEST 2007
Well, I guess you could have a setCodePath("/somewhere") since there is a method called getCodePath(), but Laurent Bedubourg only gave that method for cleanup, or debugging purposes.
Oh yeah, in my previous email I forgot to mention, instead of having to include that core.php file everytime, you can also add this line into your .htaccess file:
php_value auto_prepend_file /core.php
Best regards,
Levi
>> Whishlist:
>>
>> Why isn't it possible to be able to change this value through a method
>> on the object?
>>
>> I.e.
>>
>> $view = new PHPTAL();
>> $view->setCodeDestination("/somewhere");
>>
>> Kind regards,
>> Tarjei
tarjei wrote:
> Levi Stanley wrote:
>
>> Don't understand the issue, you are always allowed to change
>> PHPTAL_PHP_CODE_DESTINATION. I am noticing a lot of people instead of
>> putting the definition of the PHPTAL_PHP_CODE_DESTINATION in their own
>> code, they actually are going in PHPTAL.php and editing it there. The
>> problem in doing this is, you have to keep updating the PHPTAL.php file
>> everytime you upgrade it, also, like Al says, you might not have the
>> ability to access the PHPTAL file at all. My suggestion would be to
>> integrate it in an include file that you use everywhere like so:
>>
>> core.php:
>>
>> <?php
>>
>> define('PHPTAL_PHP_CODE_DESTIONATION','./cache');
>> include_once('PHPTAL.php');
>> include_once('utilities/Session_Handler.obj'); // my session
>> handler class
>>
>> ?>
>>
>> So instead of using PHPTAL directly, you just call core.php in your
>> programs, and it sets the destination and whatever else you may need.
>> The code in PHPTAL should never be touched...
>>
>>
>
>
>
>
>> Hope that has helped, best regards,
>> Levi
>>
>>
>> al wrote:
>>
>>
>>> I had this problem a couple of months back - I solved it at the time
>>> after a bit of poking and changing the tmp folder to
>>> define('PHPTAL_PHP_CODE_DESTINATION', 'tmp');
>>> and creating a local folder called tmp.
>>>
>>> At the time I thought the way the tmp file names were calculated was a
>>> bit weak.
>>> Would it not be possible to work out a tmp file name based on the
>>> location of the main executing script or something like that.
>>> What happens in this situation if PHPTAL is installed as a pear
>>> library on shared server and you are unable to change the
>>> define('PHPTAL_PHP_CODE_DESTINATION', 'tmp');
>>>
>>> Dagfinn Reiersøl wrote:
>>>
>>>
>>>> Just be careful, check whether the operating system deletes the
>>>> contents of /tmp at reboot. PHPTAL won't re-create the directories
>>>> for you, and you'll get a fatal error when PHPTAL tries to create
>>>> files in a non-existent directory.
>>>>
>>>> David Schneider-Joseph wrote:
>>>>
>>>>
>>>>> You can do:
>>>>>
>>>>> /* site 1's index.zpt */
>>>>> define('PHPTAL_PHP_CODE_DESTINATION', '/tmp/site_1');
>>>>>
>>>>> /* site 2's index.zpt */
>>>>> define('PHPTAL_PHP_CODE_DESTINATION', '/tmp/site_2');
>>>>>
>>>>> On May 9, 2007, at 9:09 AM, .: smilelover :. 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.zpt files 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
>>>>>>
>>>>>>
>>>>>>
>>>>> _______________________________________________
>>>>> PHPTAL mailing list
>>>>> PHPTAL at lists.motion-twin.com
>>>>> http://lists.motion-twin.com/mailman/listinfo/phptal
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>> _______________________________________________
>>>> PHPTAL mailing list
>>>> PHPTAL at lists.motion-twin.com
>>>> http://lists.motion-twin.com/mailman/listinfo/phptal
>>>>
>>>>
>>>>
>>> _______________________________________________
>>> PHPTAL mailing list
>>> PHPTAL at lists.motion-twin.com
>>> http://lists.motion-twin.com/mailman/listinfo/phptal
>>>
>>>
>>>
>>>
>>>
>> _______________________________________________
>> PHPTAL mailing list
>> PHPTAL at lists.motion-twin.com
>> http://lists.motion-twin.com/mailman/listinfo/phptal
>>
>>
>
>
> _______________________________________________
> PHPTAL mailing list
> PHPTAL at lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>
> !DSPAM:1,4644210f111081580982557!
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/phptal/attachments/20070511/510e9e3a/attachment.htm
More information about the PHPTAL
mailing list