. ************************************************************************ */ /** * * global.php, TSM Monitor * * This file defines global configuration variables, includes * generic code and external libraries, initializes the PHP * session and establishes the database connection. * * @author Frank Fegert * @package tsmmonitor */ /* !!! WARNING !!! The defaults in this file are not meant to be altered by users! See include/config.php for user configurable database settings. */ // ** Default database settings ** // $db_type = 'mysql'; $db_name = 'tsmmonitor'; $db_user = 'tsmmonitor'; $db_password = 'tsmmonitor'; $db_host = 'localhost'; $db_port = '3306'; $db_charset = 'utf8'; $db_collate = ''; // ** Include user configureable definitions ** // include(dirname(__FILE__) . "/config.php"); // ** Global configuration array ** // $config = array(); // ** Current TSM Monitor version ** // $config["tsm_monitor_version"] = '0.1.0'; // ** Set TSM Monitor server OS to a general value (only 'unix' or 'win32') ** // $config["server_os"] = (strstr(PHP_OS, "WIN")) ? "win32" : "unix"; // ** Search paths for external programs (dsmadmc, php, ...) ** // if ($config["server_os"] == "win32") { $config["search_path"] = array('c:/php', 'c:/progra~1/php', 'd:/php', 'd:/progra~1/php', 'c:/progra~1/tivoli/tsm/baclient', 'd:/progra~1/tivoli/tsm/baclient'); } elseif ($config["server_os"] == "unix") { $config["search_path"] = array('/bin', '/sbin', '/usr/bin', '/usr/sbin', '/usr/local/bin', '/usr/local/sbin', '/usr/tivoli/tsm/client/admin/bin', '/opt/tivoli/tsm/client/ba/bin'); } // ** Paths (libraries, includes, ...) ** // $config["base_path"] = ereg_replace("(.*[\\\/])includes", "\\1", dirname(__FILE__)); $config["library_path"] = ereg_replace("(.*[\\\/])includes", "\\1extlib", dirname(__FILE__)); $config["include_path"] = dirname(__FILE__); // ** Try to convince browsers not to cache any pages ** // header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // ** Display ALL PHP errors ** // //error_reporting(E_ALL); // ** Include generic code and external libraries ** // include ($config["library_path"] . "/adodb5/adodb.inc.php"); include_once($config["include_path"] . "/adodb.php"); include_once($config["include_path"] . "/tsmmonitor.php"); include_once($config["include_path"] . "/polld.php"); // ** Connect to the database ** // $adodb = new ADOdb($db_host, $db_port, $db_user, $db_password, $db_name, $db_type); // ** instantiate TSMMonitor Class ** // $tsmmonitor = new TSMMonitor($adodb); // check to see if this is a new installation $version = $adodb->fetchCellDB("select confval from cfg_config where confkey='version'", ''); if ($version != $config["tsm_monitor_version"] && basename($_SERVER['REQUEST_URI']) != 'install.php') { header("Location: install.php"); exit; } // ** Include generic code and external libraries ** // // ... more includes here ?>