/** * Gives an instance of dbLayer * @param string $driver * @param string $host * @param string $database * @param string $user * @param string $password * @param boolean $persistent * @return instance du driver */ public static function getInstance($driver, $host, $database, $user = '', $password = '', $persistent = false) { if (!isset(self::$instance)) { self::$instance = self::init($driver, $host, $database, $user, $password, $persistent); } return self::$instance; }
public static function accessFactory() { $db = ''; if (defined("DATABASE_TRANSACTIONAL") && DATABASE_TRANSACTIONAL) { $db = DbLayerTransSingleton::getInstance(DATABASE_DRIVER, DATABASE_URL, DATABASE_NAME, DATABASE_LOGIN, DATABASE_PASS, false); } else { $db = dbLayerSingleton::getInstance(DATABASE_DRIVER, DATABASE_URL, DATABASE_NAME, DATABASE_LOGIN, DATABASE_PASS, false); } return $db; }