including a file on on-rev
Andre Garzia
andre at andregarzia.com
Tue Nov 3 21:11:29 EST 2009
Hi Folks,
The defaultfolder is always the folder that the requested script is (unless
you change it yourself). So what I do is on top of my scripts, I include a
specific include file that changes the defaultfolder to some root place like
/public_html/ and then all the other includes are in reference to that,
makes easier to maintain.
We need to have a mental map of the division between Apache and RevServer.
Apache sees a url with a path and it will use all it's configuration
madness, virtual server stuff, aliases and who knows what to pinpoint where
it should actually find the resource. When using RevServer people tend to
keep that Apache resolution in mind and think that a URL
"binfile:/images/logo.png" will be pointing to the same place a <img
src="/images/logo.png"> would point. This is misleading, RevServer is Rev,
and Rev will work with the filesystem and it will all be relative to the
defaultfolder. When we use "include" we're asking for a file in the file
system not a network resource. This means that we can hop to parent folder
with "../" or access hard drive root at "/" and that file & user permissions
are in effect.
Another thing that trick users is line endings. RevServer is running on
Linux, so you might need to convert line endings before trying to upload a
file or it will give you execution errors. FTP clients such as interarchy
can do it automatically for you.
cheers, I am talkative due to sleeplessness :D
More information about the use-livecode
mailing list