* GLOBAL VARIABLES AND CONSTANTS * $GLOBALS[]: define(): contains/meaning: * ----------------------------------------------------------------------------- * $_DOC_ROOT DOCROOT $HTTP_SERVER_VARS["DOCUMENT_ROOT"] * $_INCLUDE_PATH INCLUDEPATH system-path to "server.inc" and all *superglobal* scripts * $_LOCAL_INC - DOCROOT/include/, path to site specific modules * $_FULL_URL FULLURL URL to current script built of prot://hostname/script * $imgDir - common graphics, URL used as src pointing to their folder * $jsDir - common javascripts, URL used as src pointing to their folder * $cssDir - common stylesheets, URL used as src pointing to their folder * $imagesDir !DEPRECTED! since 1.8 */ /** * Turn off magic_quotes */ ini_set("magic_quotes_gpc", "off"); ini_set("magic_quotes_runtime","off"); ini_set("magic_quotes_sybase","off"); ini_set("default_charset","ISO-8859-1"); /** * Takes a path-string and appends(!) it to PHP's include_path. * NOTE: if $path was already present, it will become the last entry in * include_path even if it was first. * * @access public * @param String $path filesystem path to be added to the existing include_path setting * @see DOCROOT, INCLUDEDIR, $_FULL_URL, $imagesDir */ function set_path($path) { if (!$inc = ini_get("include_path")) $inc="."; // set list seperator for *nix/win. macs will get : $sep = (getenv("windir")===false) ? ":" : ";"; // append new path, make it an array and remove duplicates $plist = array_unique(explode($sep, $inc . $sep . $path)); @ini_set("include_path", implode($sep, array_unique($plist) )); } /** * This will fix wrong settings in Apache's DocumentRoot-directive * under Windows, which unlike Unix may return the last / in the path * @const string DOCROOT Full-path to document-root always ending with a slash. * @access public * @see INCLUDEDIR, $_FULL_URL, $imagesDir */ $_DOC_ROOT = $_SERVER["DOCUMENT_ROOT"]."/"; define("DOCROOT", $_DOC_ROOT); /** * Define the global include directory and make it part of include_path. * If getenv("ENTWICKLUNG") is set (e.g. via httpd.conf), the path points * to a local directory on the development machine. Make sure to deploy all * modules to the production server. * * @const string INCLUDEDIR Full-path to the major modules directory used on this site * @see DOCROOT */ $_INCLUDE_PATH = (getenv("ENTWICKLUNG")===false) ? dirname(__FILE__)."/" : "f:/web/luder_phase3/web/include/"; define("INCLUDEPATH", $_INCLUDE_PATH); set_path(INCLUDEPATH); /** * URL-Path to the default images- and/or graphics directory used in src * in <IMG> tags. * NOTE: the old variable $imagesDir is deprecated. * @var $imgDir string * @access public * @see $cssDir, $jsDir, $_FULL_URL */ $imgDir = "/img/"; /** * @var string global Full-path to the default images-directory * @access public * @see $docRoot, $includeDir */ $imagesDir = DOCROOT."/img/"; $contentDir = DOCROOT."/"; /** * URL-Path to the default JavaScript directory uses in the src attribute * in <SCRIPT> tags. * @var $jsDir string * @access public * @see $cssDir, $imgDir, $_FULL_URL */ $jsDir = "/js/"; /** * URL-Path to the default Stylesheets directory used in href attribute * in <LINK rel="StyleSheet"> tags. * You may want to define a seperate directory for XSL stylesheets. * @var $cssDir string * @access public * @see $imgDir, $jsDir, $_FULL_URL */ $cssDir = "/css/"; /** * Create the global _FULL_URL variable. * @const string _FULL_URL Full-path to prot://host/script * @access public * @see $PHP_SELF, DOCROOT */ // if(isset($HTTP_SERVER_VARS["HTTPS"])) { $_FULL_URL = 'https://'.$HTTP_SERVER_VARS['SERVER_NAME'].$HTTP_SERVER_VARS['PHP_SELF']; } else { $_FULL_URL = 'http://'.$HTTP_SERVER_VARS['SERVER_NAME'].$HTTP_SERVER_VARS['PHP_SELF']; } // define the variable to make it accessable throughout your script define('FULLURL', $_FULL_URL); /** * Fix $PHP_SELF on Windows. * The win32 binaries are not compiled with --enable-force-cgi-redirect * which will cause $PHP_SELF containing the path to PHP.EXE instead of * the script. Use PATH_INFO as a workaround. * * @access public * @var $PHP_SELF string */ if (""!=getenv("windir")) { $HTTP_SERVER_VARS['PHP_SELF']=getenv("PATH_INFO"); } /** * Now load modules.inc for the current website. This will come from * inside the current DOCROOT/includes/. If the file cannot be found, the one * located in the same directory as server.inc will be used instead - if present. * modules.inc Will load other prepend files needed for the website * (PHPlib, ADODB, BCr1..) and may create other $GLOBALS, defines() and the * $modules[] Array. */ $_LOCAL_INC = DOCROOT."include/"; if (file_exists($_LOCAL_INC."modules.inc")) { include_once($_LOCAL_INC."modules.inc"); } elseif (file_exists(INCLUDEPATH."modules.inc")) { include_once(INCLUDEPATH."modules.inc"); } ?>