/** * Initialize the database connection. */ public static function init() { if (GlobalProperties::$DATABASE_TYPE == "mysql") { $db = new MyConnection(); } if (GlobalProperties::$DATABASE_TYPE == "pgsql") { $db = new PgConnection(); } $db->setServer(GlobalProperties::$DATABASE_SERVER); $db->setPort(GlobalProperties::$DATABASE_PORT); $db->setUser(GlobalProperties::$DATABASE_USER); $db->setPassword(GlobalProperties::$DATABASE_PASSWORD); $db->setDatabase(GlobalProperties::$DATABASE_NAME); $db->connect(); self::$connection = $db; self::$idBroker = new IdBroker(); }