public static function getInstance($aDbConfig) { extract($aDbConfig); $oDb = new DbMysql(); $oDb->connect($host, $user, $password, $dbname, $charset); return $oDb; }
public function doRetrieve() { $mysql = new DbMysql(); if (!$mysql->connect()) { return "ERROR: Sql server connect error!\n"; } $ret = $mysql->getList(); return $ret; }
$BenchmarkTimer->start(); // Start benchmarking immediately //Now, include the configuration. require_once "library.php"; if ($debug === true) { include_once "includes/benchmark.class.php"; $benchmark = new DebugLib(); $benchmark->scratch_dir = $scratch_dir; } if ($debug) { $benchmark->memory_checkpoint(__LINE__, __FILE__); } include_once 'includes/mysql.class.php'; $db = new DbMysql(); //instantiate the database object $db->connect($db_server, $db_user, $db_pass, $db_name, $db_persistent); $db->prefix = $prefix; if ($debug) { $benchmark->memory_checkpoint(__LINE__, __FILE__); } # Include Configs & Variables ################################################################################################# //TODO: main.php 32 Eliminate this cookie shit, use sessions for logged in users, track what they have viewed or not //TODO: this is where we would check user login , and if logged in set up their specific page views needs. //TODO: we want to build a cache of the core, and only need to dynamically write the stuff "around" it.. some pages can be fully cached as html if (!empty($_COOKIE["checkviewed"]) && $_COOKIE["checkviewed"] != "1") { setcookie("checkcookie", "1", $cookietime, "{$cookiepath}"); if ($_COOKIE["checkviewed"] == "1") { $cookietime = time() + 24 * 3600 * 365; setcookie("checkviewed", "1", $cookietime, "{$cookiepath}"); $firsttimeuser = true;