Re: Vardirlayout scenario
jojodee <jojodee-8nna1qhvBBM9QQeoy3GH/[email protected]> Wed, 22 Jul 2009 20:01:56 +0930
| Newsgroups | gmane.comp.cms.xaraya.devel |
|---|---|
| Organization | Xaraya |
| Message-ID | <[email protected]> |
Hi Marc We have also been working on this for some time and back at the beginning of July posted a version of the docs/devDirlayout.txt on the web for better accessibility for those that wanted to comment on this prior to our work on the scenario in our cirrus branch. http://xarigami.com/devnote/cirrus_directory_restructure In relation to your description and questions: First, the current 1x setup is the most convenient for the specific case of multisite setup where you have multiple sites running off one code base for one or more instances and ease of modules and theme directories (see http://xarigami.com/resources/Multiple_sites-single_code_base). The new dir layout actually complicates this, not simplifies it as you suggest, but the new layout has other positives in relation to one place for libraries, reduction in code duplication across modules, better sharing of common items etc. We have found the current dirlayout proposed limiting in some respects and also from a maintenance and 'neatness' point of view the directories such as library and modules are best all put as subdirectories in a directory out of the web root or parallel to an instance of a site (eg html). We found this better than having multiple directories related to xaraya running out of the web root. The library (lib) directory was to be used for xaraya and other 3rd party libraries and as such the 'code' directory you suggested is specifically used for xaraya modules in our setup keeping it easier for upgrades/installations/distributions. We have found this structure to be most useful for our current needs for xaraya and multisite setups, although we are still working on this in some areas where features are not complete. I was going to put the layout here but due to my unsureness about the resulting display in this newsgroup I posted it here: http://xarigami.com/devnote/cirrus_directory_restructure_2 Of particular note is that we only need the one 'xarigami' directory configurable here in addition to where the specific site is located (html) as the other main directories are fixed in name and relative to this. This change in directory structure does pose problems for those that do not have access to directories above the web root and they would need their hoster to install it for them. Thus the configurable 'xarigami' directory (or whatever name you want to call it) makes this easier for them. The structure also aims to make theme and module installation as simple as we can given the additional problems we expect to encounter with this restructure. I would like to think that jamaica does not have code that puts the bootstrap file in each of the 'html' site directories. It doesn't have to be. Cheers Jo [email protected] wrote: > I recently uploaded the vardirlayout scenario > (com.xaraya.core.jamaica.vardirlayout). The purpose of the scenario is > to make the main Xaraya directories configurable. > It is a step along the road delineated by the text in > docs/devDirlayout.txt. > > The scenario focuses mainly on 2 directories that can be moved outside a > particular instance of Xaraya to a central place > > Conceptually the scenario has the following underpinnings: > > - In all installations the known point of departure is the location of > index.php, where the browser points. It is from this "constant" location > that we can set up the configuration for a given instance. > > - The root directory of Xaraya can be defined with respect to index.php. > This directory is the central point relative to which the main > directories of the instance are set. The root directory is often thought > of as sitting at the top of a hierarchy of directories (Xaraya and/or > others). In the default setup it sits one level up from the html > directory, for instance. But this not need be so. The root directory is > simply a convenient central reference point for the instance. > > That the root directory's usefulness as a construct comes from the fact > that it is distinct from index.php. In a single website installation the > Xaraya configuration could in theory use index.php as its reference > point. But in a multi-site setup, where different instances share the > same code, the root directory becomes a common reference point for all > installs. > > - From the root directory we can then go on to define relative locations > to the main components of Xaraya. The file devDirLayout.txt makes some > proposals as to what these can be. The vardirlayout focuses on three > main components: > - html directory and its subdirectories, which contain the things that > need to be accessible to the web server. > - lib directory and its subdirectories, which contain the libraries > Xaraya uses. > - code directory and its subdirectories, which contain the code for > the Xaraya modules (and what more ?). > > By making the last 2 of these configurable for each instance we can > greatly simplify multi-site setups. In the scenario's "default" setup > both the lib and code directories are on the same level as the html > directory. The layout paths to these directories are defined in a new > file var/layout.system.php. > > Questions > > 1. Is the code directory needed (or should "modules" replace "code")? > 2. The price we pay in the scenario is to move the bootstrap.php file > into the html directory. In fact the only thing needed for the above > concept to work is to have the sys class (and its parent class) live > next to index.php, but rather than taking that out of bootstrap.php it > seems easier to just move the whole file. Is there a better solution? > 3. What other directories could be moved out from below the webroot in > the short term? It would make sense to make as many of these moves > before a final 2.0.0 release. > 4. Two new static methods in sys appear: lib() and code() that return > the relative paths to the respective directories. Perhaps roll them > along with root() and varpath() into a single method? > > On a side note, increasing the flexibility of the configuration layout > will likely lead to complications (or at least potentially more > complexity) of module and theme installations, increasing the need for a > smarter installer/component manager. -- http://xarigami.com :: Creative web development with Xaraya http://2skies.com :: Open source hosting and development