ar() . $_REQUEST['path']; } /* * Redirect to the given URL and die */ function redirectTo($url) { header("Location: " . $url); exit; } /* * Get or create the app's database connection object (this is a singleton object and dependent on system-level config) */ function getDbConnection() { global $_SCROTT; if (self::$dbobj != null) return self::$dbobj; switch ($_SCROTT['dbEngine']) { case "mysql": $host = $_SCROTT['dbAddress']; $username = $_SCROTT['dbUser']; $password = $_SCROTT['dbPass']; $dbName = $_SCROTT['dbName']; self::$dbobj = new Mysql($host, $username, $password, $dbName); break; default: throw new Exception("Problem with Scrott Configuration. Invalid database engine specified."); break; } return self::$dbobj; } } ?>