Configuration functions for the framework.
$Id: config.php 610 2006-06-29 10:04:36Z stijn $
Make sure that a string ends in a slash.
Determine the path to the framework wide configuration files.
The return value of this function can be used to prefix framework wide configuration values in cookies or sessions.
Determine the correct SWS vhost for a request.
Returns the computed base URL for a subsite.
This function tries to determine the base URL for a subsite, in case no base URL was configured. This is done by repeatedly stripping pathname components from both the URL and the request directory, in order to find the common request basis.
Currently, in the following cases, the base URL can be computed.
Site definition Request directory Request URL Base URL /site1 /site1 / / /site1 /site1/foo /foo/ / /site1/site2 /site1/site2 /site2/ /site2/ /site1/site2 /site1/site2/bar /site2/bar/ /site2/ /subsites/[^/]+ /subsites/site3 /site3/ /site3/ /subsites/[^/]+ /subsites/site3/baz /site3/baz/ /site3/ /subsites/[^/]+/s /subsites/site3/s /site3/s/ /site3/s/ /subsites/[^/]+/s /subsites/site3/s/2 /site3/s/2/ /site3/s/ /foo /foo /xyzzy/ /xyzzy/ /foo /foo/bar /xyzzy/bar/ /xyzzy/
The function will not be able to determine base URLs in case of multiple Alias'es. Those subsites need to explicitly define the base URL in their configuration file.
Parse a configuration file into a hash.
The configuration file is expected to look like this:
# Line comments key=1 # number value string="foo" # string value
This function will return a hash with key 'key', value 1 and key 'string' value "foo" in this case.
Process the configuration for a specific page request.
This function is called on every page view to set the configuration variables for that request. It makes sure that $_SESSION["conf-$config"]['sws'] points to the correct configuration hash for the requested vhost/site combination.
The static configuration for the framework install is read on startup and everytime we detect that the main configuration file has changed. Note that this means that changes in the vhost configuration files will NOT be detected unless a user restarts the browser, or the main configuration file is rewritten also.
Notable keys in the $_SESSION["conf-$config"]['sws'] configuration hash:
Make sure that a string does not end in a slash.
Documentation generated on Fri, 30 Jun 2006 10:31:37 +0200 by phpDocumentor 1.3.0RC3