template_dir = TEMPLATE_DIR; $this->compile_dir = COMPILE_DIR; $this->cache_dir = CACHE_DIR; $this->config_dir = CONFIG_DIR; // Pass config variables to Smarty object. $this->assign('config', array( 'webpath' => WEB_PATH, 'rootpath' => ROOT_PATH, 'repo' => REPO_DIR) ); } } // Database configuration. class AMO_SQL extends SQL { function AMO_SQL() { $dsn = array ( 'phptype' => 'mysql', 'dbsyntax' => 'mysql', 'username' => DB_USER, 'password' => DB_PASS, 'hostspec' => DB_HOST, 'database' => DB_NAME ); $this->connect($dsn); // Test connection; display "gone fishing" on failure. if (DB::isError($this->db)) { $tpl =& new AMO_Smarty(); $tpl->assign( array( 'content'=>'site-down.tpl', 'error'=>$this->error ) ); $tpl->display('inc/wrappers/nonav.tpl'); exit; } } } // Global template object. $tpl = new AMO_Smarty(); // Global DB object. $db = new AMO_SQL(); ?>