Server struct aliasing?

118 views
Skip to first unread message

Tom King

unread,
Feb 2, 2015, 12:03:48 PM2/2/15
to lu...@googlegroups.com
Is it just me, or is there some sort of alias built in for server.railo - > server.lucee?

i.e, these both return true for me:
StructKeyExists(server, "railo");
StructKeyExists(server, "lucee");

When presumably the first one should return false?
Ta
T

Jean Moniatte

unread,
Feb 2, 2015, 12:07:33 PM2/2/15
to lu...@googlegroups.com
I confirm the same, the key railo exists (structKeyExists(server,'railo') is true) but dump(server) does not show it, it shows a lucee key.

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/bb56ecdb-f05d-43b2-9464-e6fb2dec72f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Igal @ Lucee.org

unread,
Feb 2, 2015, 12:14:31 PM2/2/15
to lu...@googlegroups.com
it's for backward compatibility and easy migration from Railo.

Tom King

unread,
Feb 2, 2015, 12:21:11 PM2/2/15
to lu...@googlegroups.com
Cheers - actually caught me out as I was writing conditional stuff in the cfwheels core where I was actively trying to identify lucee for minimum supported version etc.
But no problem once you know it's intended. Also, pending tests etc etc, cfWheels should be good to go soon (I hope) as a 'supported' framework.

T

Mark Drew

unread,
Feb 2, 2015, 12:23:39 PM2/2/15
to lu...@googlegroups.com
I am not sure what will become the standard but maybe StructKeyExists(SERVER, “lucee”) or SERVER.railo.version GT “4.3” ? 

MD 

Tom King

unread,
Feb 2, 2015, 12:26:34 PM2/2/15
to lu...@googlegroups.com
I just settled on:

if (StructKeyExists(server, "lucee"))
{
application.$wheels.serverName = "Lucee";
application.$wheels.serverVersion = server.lucee.version;
}
else if(StructKeyExists(server, "railo"))
{
application.$wheels.serverName = "Railo";
application.$wheels.serverVersion = server.railo.version;
}
else
{
application.$wheels.serverName = "Adobe ColdFusion";
application.$wheels.serverVersion = server.coldfusion.productVersion;
}

Which appears to work :)

Michael Offner

unread,
Feb 2, 2015, 1:22:00 PM2/2/15
to lucee
"server.railo" is supported as an alias for "server.lucee", we did this to make sure code like the following still work
if(server.railo.version>"4.0.0.000");

We saw this as an hidden feature for backward compatibility, because of that it is not shown with the dump or structKeyList, but structKeyExists should also return false, we will change this for the next patch release...
best use "server.coldfusion.productName" instead.

Micha



On Mon, Feb 2, 2015 at 6:03 PM, Tom King <t...@oxalto.co.uk> wrote:

--
Reply all
Reply to author
Forward
0 new messages