` to specify an encryption key. * - `readOnly` to open a database in read-only mode. * - `openOnly` to prevent a new file from being created if the specified path does not exist. * * @param string|array $dsn DSN with connection information. * @return SQLiteConnectionInfo SQLite connection info. */ public function parseDsn(string|array $dsn): IDbConnectionInfo { if(is_string($dsn)) { $dsn = parse_url($dsn); if($dsn === false) throw new InvalidArgumentException('$dsn is not a valid uri.'); } $encKey = ''; $path = $dsn['path'] ?? ''; if($path === 'memory:') $path = ':memory:'; parse_str(str_replace('+', '%2B', $dsn['query'] ?? ''), $query); $encKey = $query['key'] ?? ''; $readOnly = isset($query['readOnly']); $create = !isset($query['openOnly']); return new SQLiteConnectionInfo($path, $encKey, $readOnly, $create); } }