Re: A patch to keep cache directory out of webroot

"jojodee" <jojodee-8nna1qhvBBM9QQeoy3GH/[email protected]> Wed, 13 Oct 2004 09:19:51 +0930
Newsgroups gmane.comp.cms.xaraya.patches
Organization Xaraya
Message-ID <[email protected]>
"Jason Judge" <[email protected]> wrote in message 
news:[email protected]...
>
>
> If ownership of var data is handed out to modules, then we only need to
> consider the directory structure for handling that. Modules can chose what
> they do themselves within their own var space.

I suppose i see /var path as only for minimal configuration and really any 
data should be taken out to a separate site specific (that could be shared) 
data directory tree.

> An API for managing the data areas should allow each module to set up 
> their
> own space in the var directories. They should be able to specify in their
> setup script "give me some var space please" - and it will be created for
> them with appropriate permissions. It does not need to complicate the
> initial setup though. Perhaps if there is default data (i.e. defaulf 
> files)
> that should be placed into a module's var area, then those defaults should
> be kept in the module itself, and copied in during module installation. It
> would mean an installation could be shipped with a vitually empty var
> directory, and therefore nothing to be overwritten when an upgrade is
> performed.

I agree to some extent, although I suppose where we differ is the use of the 
/var directory not necessarily the way we use an API to handle it. Maybe 
that is just a matter of semantics.  I call it a site directory - and within 
that there could be a sitespecific /var directory and so on.

>> xarCoreGetVarDirPath () should default to /var where it is, but also 
>> maybe
> a
>> param:
>> xarCoreGetVarDirPath('site')...
>
> Would each site not run in the context of a single site - i.e. would there
> really be a need to access the data in other sites? The idea of separate 
> var
> directories for separate sites, is to keep them separate.
>
I think each site needs a 'site' directory. That can be shared if necessary 
or components of it (eg theme dir is configurable). The best way to explain 
it would be for you to look also at my post on "category images" on the 
committer list. I'd appreciate your comments there.

I raised that issue as I felt there were a lot that needs to be considered 
when looking at the /var dir and access. Originally a lot of these related 
issues were post 1.0, including multisites, but as this cache dir and /var 
dir issue has now been raised - I believe a more comprehensive look at the 
full requirements for file and data directories needs to be done. If 
something is put in place, then it needs to be comprehensive else it the 
potential to cause more problems later especially in respect to upgrade 
(once in, harder to take out) not to mention a feeling of unplanned 
development.

With the Category Image thread i came to the conclusion that we only really 
needed a xarCoreGetVarDirPath() that pointed to the directory where 
requirements for installation and boot were located. Anything other that 
those needed to go in a specific 'site' directory tree with appropriate 
theme, data and var directories for the site (which could be shared or 
other) and which we need even for one primary site installation.

I ended quote: "However, if we settled on something like the above 
structure, then we wouldn't need it. A xarCoreGetSiteDir('site') call might 
be more useful if we are guaranteed the above type of strucutre. Then we can 
leave xarCoreGetVarDir() to itself :) "

Jo



>
>
> -- JJ
>
>