Re: A patch to keep cache directory out of webroot

"Jason Judge" <[email protected]> Mon, 4 Oct 2004 10:44:31 +0100
Newsgroups gmane.comp.cms.xaraya.patches
Organization Xaraya
Message-ID <[email protected]>
"mikespub" <[email protected]> wrote in message
news:[email protected]...
> In article <[email protected]>, Chris Dudley
<[email protected]>
> wrote:
> >...
> >There seems to be a need for both an area in the webroot and one that
> >isnt. e.g. imho the config files should not be in the webroot.
> >
> >Maybe some kind of definition of what the areas are and what
> >information/files should go where?
> >
> >miko
>
> Indeed - in most cases, we can use a var outside the webroot, and
therefore
> all references to var/ should make use of that xarCoreGetVarDirPath()
> function. The few exceptions mentioned here can then be dealt with
> separately.

What is xarCoreGetVarDirPath() were to accept a flag parameter, so a module
can ask it to return either the public or the private var directory? For the
public directory, there are also two forms: as seen from the web server, and
as seen from a web browser. The public var directory could also be organised
by module (also passed in as a parameter to xarCoreGetVarDirPath()) so that
modules don't stamp on each other. We have no such directory-naming rules
for the privide var directory at the moment - perhaps we should, because its
use is likely to expand over time.

> Note that it should still be possible to have both var/ directories
"overlap"
> in case e.g. web servers do not allow any access outside the webroot.
> That was in fact the original purpose :-)

For most practical purposes, 'outside the webroot' would often just involve
protecting the whole directory tree from web access through a .htaccess
file. (I have no idea what Windows users would do though.) So yes, both an
'internal/private' and an 'external/public' var directory could sit
alongside each other. What I think we want to avoid is mixing the two
together, so that we have a complex structure of protected and unprotected
directories.

-- JJ