self::$db_type . ':host=' . self::$db_server . ';dbname=' . self::$db_name . ';port=' . self::$db_port, 'host' => self::$db_server, 'port' => self::$db_port, 'username' => self::$db_username, 'password' => self::$db_password, 'dbName' => self::$db_name, 'tablePrefix' => 'yf_', 'charset' => 'utf8', ]; } /** * Mongo database configuration. */ public static function mongo() { if (!self::$mongo_username) { return null; } return [ 'dsn' => sprintf('%s://%s:%s@%s:%d/%s', self::$mongo_type, urlencode(self::$mongo_username), urlencode(self::$mongo_password), self::$mongo_server, self::$mongo_port, self::$mongo_name), 'tablePrefix' => 'yf_', ]; } }