Skip to content

Commit

Permalink
Detect Cache or IRIS base by checing $zversion (fixes #141)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjsjohnmurray authored and nikitaeverywhere committed Jul 6, 2022
1 parent 661f440 commit 11418e0
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/cls/WebTerminal/Installer.cls
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@ Projection Reference As Installer;

Parameter VERSION = "<!-- @echo package.version -->";

/// In older Cache versions, method "GetISCProduct" does not exists
Parameter iscProductVersion = {$case(
##class(%Dictionary.CompiledMethod).IDKEYExists("%SYSTEM.Version", "GetISCProduct"),
1: $CLASSMETHOD("%SYSTEM.Version", "GetISCProduct"),
: 2
)};
/// Cache or IRIS
Parameter iscProductBase = {$piece($zversion," ")};

ClassMethod RegisterWebApplication(name As %String, spec) As %Status
{
Expand Down Expand Up @@ -98,7 +94,7 @@ ClassMethod CreateProjection(cls As %String, ByRef params) As %Status
set cspProperties("Description") = "An application representing the open socket for /terminal application."
set cspProperties("DispatchClass") = ""

set requiredRole = $case(..#iscProductVersion >= 4, 1: "%DB_IRISSYS", : "%DB_CACHESYS")
set requiredRole = $case(..#iscProductBase = "IRIS", 1: "%DB_IRISSYS", : "%DB_CACHESYS")
set roles = ..GetDBRole(dbdir)
set extractedRoles = $case($get(roles) '= "", 1: ":" _ roles, : "")
set cspProperties("MatchRoles") = ":" _ $case(
Expand Down Expand Up @@ -205,7 +201,7 @@ ClassMethod CreateAllNamespace() As %Status

if ('##Class(Config.Namespaces).Exists(ns)) {

set dbPrefix = $case(..#iscProductVersion >= 4, 1: "IRIS", : "CACHE")
set dbPrefix = $case(..#iscProductBase = "IRIS", 1: "IRIS", : "CACHE")
set Properties("Globals") = dbPrefix _ "TEMP"
set Properties("Library") = dbPrefix _ "LIB"
set Properties("Routines") = dbPrefix _ "TEMP"
Expand All @@ -223,7 +219,6 @@ ClassMethod CreateAllNamespace() As %Status
}

return st

}

ClassMethod Map(fromNS = "") As %Status
Expand Down

0 comments on commit 11418e0

Please sign in to comment.