blueshoes php application framework and cms            core
[ class tree: core ] [ index: core ] [ all elements ]

Procedural File: Bs_RelativeEnvironment.lib.php

Source Location: /core/Bs_RelativeEnvironment.lib.php



Classes:



Page Details:

********************************************************************************

Initialize the Relative Environment ********************************************************************************** ------------------------- Ground Zero Initialisation ------------------------




Tags:

pattern:  

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.

************************************************************************************

access:  public
version:  4.3.$Revision: 1.2 $ $Date: 2003/08/09 15:17:44 $
author:  Sam Blum <at blueshoes dot org>, andrej arn <andrej at blueshoes dot org>








setupRelativeEnvironment [line 75]

void setupRelativeEnvironment( [string $useThis_bsSubDir = NULL], [string $useThisUri = NULL])

Setup Relative Environment

For a general explanation see text in header.

Special Case: When working with tools we sometimes would like to have the relative environment set up too without having the possibility to include this script at the required starting point, thus the _bs-subdir. So it's possible to pass parameters to overcome the problem.




Parameters

string   $useThis_bsSubDir   (optional) A substitute to use as the _bs-subdir.
string   $useThisUri   (optional) A substitute to use as the $HTTP_SERVER_VARS['REQUEST_URI'].
[ Top ]



Documentation generated on Mon, 29 Dec 2003 21:12:33 +0100 by phpDocumentor 1.2.3