Sunday, January 13, 2013

Check version of ColdFusion

To check which version of ColdFusion you have, following code can be used. This code is highly helpful when you have limited access to Control Panel or your hosting company do not reveals the version details.
<cfscript>

versinfo = arraynew(1);

versinfo[1] = structnew();

versinfo[1].name = "the base version, with no updater";

versinfo[1].number = 48097;

versinfo[2] = structnew();

versinfo[2].name = "Updater 1";

versinfo[2].number = 52311;

versinfo[3] = structnew();

versinfo[3].name = "Updater 2";

versinfo[3].number = 55693;

versinfo[4] = structnew();

versinfo[4].name = "Updater 3";

versinfo[4].number = 58500;

curversion = listlast(Server.ColdFusion.ProductVersion);

</cfscript>

<cfoutput>

<p>This server is running <b>#Server.ColdFusion.ProductName#, #server.coldfusion.ProductLevel#</b> <br />

#Server.ColdFusion.ProductVersion#

<br/>

<cfif left(Server.ColdFusion.ProductVersion,5) is "6,0,0">

<p>Which means it?s running with

<cfif server.coldfusion.appserver is "j2ee" and curversion is 58096>

 Updater 3 on ColdFusion MX for J2EE.

<cfelse>

<cfloop from="1" to="#arraylen(versinfo)#" index="i">

<cfif curversion eq versinfo[i].number>

<b>#versinfo[i].name#</b>.

<cfbreak>

<cfelseif curversion lt versinfo[i].number>

<b>patches not yet up to the final release of

#versinfo[i].name#</b>

<cfbreak>

<cfelseif i is arraylen(versinfo)>

a version <b>greater than the final release of

#versinfo[arraylen(versinfo)].name#</b>.

This tool has not been updated yet to recognise that

version number.

</cfif>

</cfloop>

</cfif>

<cfelse>

</cfif>

</cfoutput> 

No comments:

Post a Comment