[TxMt] web preview and PHP include_paths

kumar mcmillan kmcmillan at leapfrogonline.com
Wed Feb 2 17:53:48 UTC 2005


On Feb 2, 2005, at 9:25 AM, max at machinate.org wrote:

> Another thing that I'm not sure if any one has mentioned is that when 
> you pipe it through the PHP binary, require() and include() don't work 
> when the files have a relative path to the script.
> Any apache server env variables are also bypassed so you can't 
> reference 'SCRIPT_URI' etc.
> I don't really want to change every script to have absolute paths, as 
> that becomes rather inflexible.
>  would be glad to hear any solutions anyone might have.

from my noodling, it appears that commands in textmate run from :
/private/tmp/502/TemporaryItems

you may be able to alter your command to something like this:

cd `dirname $TM_FILEPATH`
cat $TM_FILEPATH > php

(just a guess, haven't tested)


k

>
> thanks, max
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate




More information about the textmate mailing list