singleton: (pseudostatic) Include this file right after include of the config file (that holds the path to ) to this file: e.g. require_once($APP['path']['core'] . 'Bs_RelativeEnvironment.lib.php'); IMPORTENT !!: The 'startup'-script that includes this file *must* be positioned under /<some path>/<site name>/<on- or offline>/_bs/. See below for details INTRO: This script is intended to set up an environment hash ($GLOBALS['bsEnv']) that enables the following scripts to access the physical BS-file-structure. E.g.
/ <- root of the system
:
-/www <- Here is where we want to organize some sites: site_1 and site_2
|-/site_1 <- This will contain our site_1 (*NOT* webroot yet)
| |-/online <- This is the webroot of site_1. The online version.
| | :.. You may set up your non BS site (orignal site) as befor.
| | :.. BS-can coexist with 'normal' site
| | :..
| | |-/_bs <- BS only needs 1 subdir (_bs) for itself
| |
| |-/offline <- This is the offline version of the site.
| | :..
| | |-/_bs
| |
| |-/protected <- BS needs a place that is not directly accessable by
| the server
|-/site_2 <- This will contain our site_2. Same structure as site_1.
: :..
In the above sample we would have 4 sites. site_1: online and offline and site_2: online and offline The abs. pathes vary depending on in which site we currently work in. That's were this script hangs in. It sets up the an environment hash ($GLOBALS['bsEnv']) that has the importent info. HOW IT WORS: This script *must* be included in one of the _bs-dirs! We're able to determin that dir with a call to getAbsolutePath() and with the knowledge of the BS-file-structure we're able to determin the rest. Thus: webroot is 1 dir-leval above our current possition. The config-files 2 dir-levels above our current possition. a.s.o. ************************************************************************************ |