setAppPath(getcwd()); $bugsys->setApplication('Bugdar'); $bugsys->setAppVersion(BUGDAR_VERSION); if (!file_exists('./includes/config.php')) { echo 'includes/config.php needs to be present!'; exit; } require_once('./includes/config.php'); $bugsys->setDebug($debug); define('DEVDEBUG', $debug); unset($debug); // ################################################################### // init the big three $bugsys->options = array(); $bugsys->userinfo = array(); class Bugdar { /*! @var \PDO The database connection instance. */ static $db = NULL; /*! @var \hoplite\http\Input Input filter for the new stack. */ static $input = NULL; static $options = array(); static $user = array(); static $datastore = array(); } // ################################################################### // Hoplite early initialization. define('HOPLITE_ROOT', dirname(__FILE__) . '/hoplite'); if (DEVDEBUG) { require_once HOPLITE_ROOT . '/base/profiling.php'; \hoplite\base\Profiling::EnableProfiling(); } // ################################################################### // Connect to the database. $pdo_class = '\\PDO'; if (DEVDEBUG) { require_once HOPLITE_ROOT . '/data/profiling_pdo.php'; $pdo_class = '\\hoplite\\data\\ProfilingPDO'; } Bugdar::$db = new $pdo_class("mysql:dbname=$database;host=$servername", $username, $password); unset($database, $servername, $username, $password); // Let ISSO handle the database connection failure message. $bugsys->load('db_mysql_pdo', 'db', true); $db->connect(Bugdar::$db); Bugdar::$db->SetAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_WARNING); if ($utf8) { $db->query("SET NAMES utf8"); } // don't use sql strict mode $db->query("SET sql_mode = ''"); $bugsys->load('functions', 'funct', true); $bugsys->load('xml', 'xml', true); // change cookie expiration to one hour $funct->cookieexp = 3600; define('TABLE_PREFIX', $tableprefix); define('COOKIE_PREFIX', $cookieprefix); unset($usepconnect, $tableprefix, $cookieprefix); require_once('./includes/functions_datastore.php'); require_once('./includes/functions.php'); require_once('./includes/language.php'); // ################################################################### // Hoplite late initialization. require_once HOPLITE_ROOT . '/data/model.php'; \hoplite\data\Model::set_db(Bugdar::$db); require_once HOPLITE_ROOT . '/http/input.php'; Bugdar::$input = new \hoplite\http\Input(\hoplite\http\Input::TYPE_HTML); // ################################################################### // send nocache 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); if ($utf8) { header("Content-Type: text/html; charset=\"utf8\""); } header("Pragma: no-cache"); // ################################################################### // populate our caches $db->showerrors = false; $datastoretemp = $db->query("SELECT * FROM " . TABLE_PREFIX . "datastore"); $db->showerrors = true; if (!$datastoretemp) { echo '