Showing posts with label ColdFusion 8. Show all posts
Showing posts with label ColdFusion 8. Show all posts

Wednesday 23 October 2013

Documentation for older versions of ColdFusion

G'day:
Gavin was asking about docs for older versions of ColdFusion today. In my searchings, I've located the docs for a number of older versions of ColdFusion. I'm gonna list 'em here so they're easier to find.
  • Cold Fusion 2.0 online documentation, courtesy of GES technologies (update 2015-05-07: link is now dead)
  • Cold Fusion 3 online documentation, courtesy of House of Fusion (update 2016-06-30: link is now dead)
  • ColdFusion 4.5 online documentation, also courtesy of House of Fusion (update 2016-06-30: link is now dead)
  • ColdFusion 4.5.2 offline downloadable documentation, courtesy of Adobe (these are zip files)
  • ColdFusion 5.0 offline downloadable documentation (Adobe, zip files)
  • CFMX 6.1 offline downloadable documentation (Adobe, zip files)
  • CFMX 7 offline downloadable documentation (Adobe, zips)
  • ColdFusion 8 online documentation (Adobe livedocs)
  • ColdFusion 9 online documentation (help.adobe.com)
  • ColdFusion 10 online documentation (the current rendition of Adobe online docs: learn.adobe.com. I wish they'd just stick with the same bloody domain name / online docs structure!!). That site is now dead. But the docs are here: ColdFusion Documentation Archive.
  • ColdFusion 11: same page as above, but that's a direct link.
Hopefully that's helpful to someone.

Righto...

--
Adam

    Saturday 3 November 2012

    CFML: Application.cfc-set mappings don't work in onApplicationEnd

    G'day:
    Well this was not what I was intending to be looking at this evening, but I made the mistake of  looking at StackOverflow and didn't understand what I was reading about mappings and onSessionEnd and ColdFusion 8, so looked into it.


    I don't really care about quirks of CF8: the boat's pretty much sailed on any problems anyone finds with that.  However I wanted to make sure it wasn't still happening in CF9 or CF10.

    The original problem is that ColdFusion mappings that are set in Application.cfc don't seem to exist by the time onSessionEnd() runs (this is on ColdFusion 8).  Here's some test code and the results:

    <cfcomponent output="true">
        
        <cfset this.name = "testMappings">
        <cfset this.sessionManagement = true>
        <cfset this.applicationTimeout    = createTimespan(0,0,0,20)>
        <cfset this.sessionTimeout        = createTimespan(0,0,0,10)>
        
        <cfset this.mappings = structNew()>
        <cfset this.mappings["/test"] = "C:\temp">
        
        <cfset testExpandPath("Pseudoconstructor")>
        
        <cffunction name="onApplicationStart" returnType="boolean" output="true">
            <cfset testExpandPath("onApplicationStart")>
            <cfreturn true>
        </cffunction>
    
        <cffunction name="onApplicationEnd" returnType="void" output="true">
            <cfargument name="applicationScope" required="true">
            <cfset testExpandPath("onApplicationEnd")>
        </cffunction>
        
        <cffunction name="onRequestStart" returnType="boolean" output="true">
            <cfargument name="thePage" type="string" required="true">
            <cfset testExpandPath("onRequestStart")>
            <cfreturn true>
        </cffunction>
    
        <cffunction name="onRequest" returnType="void">
            <cfargument name="thePage" type="string" required="true">
            <cfset testExpandPath("onRequest")>
            <cfinclude template="#arguments.thePage#">
        </cffunction>
    
        <cffunction name="onRequestEnd" returnType="void" output="true">
            <cfargument name="thePage" type="string" required="true">
            <cfset testExpandPath("onRequestEnd")>
        </cffunction>
    
        <cffunction name="onSessionStart" returnType="void" output="true">
            <cfset testExpandPath("onSessionStart")>
        </cffunction>
    
        <cffunction name="onSessionEnd" returnType="void" output="true">
            <cfargument name="sessionScope" type="struct" required="true">
            <cfargument name="appScope" type="struct" required="false">
            <cfset testExpandPath("onSessionEnd")>
        </cffunction>
    
    
        <cffunction name="testExpandPath" returntype="void" access="public" output="true">
            <cfargument name="message" required="true" type="string">
    
            <cfset var path  = expandPath("/test")>
            <cfset var fullMessage = "#message#: #path#">
            <cfoutput>#fullMessage#<br /></cfoutput>
            <cflog file="testMappings" text="#fullMessage#">
        </cffunction>
    
    </cfcomponent>
    

    Pseudoconstructor: C:\apps\adobe\ColdFusion\8\instances\CF801\cfusion.ear\cfusion.war\test
    onApplicationStart: C:\temp
    onSessionStart: C:\temp
    onRequestStart: C:\temp
    onRequest: C:\temp
    test.cfm: C:\temp
    onRequestEnd: C:\temp
    onSessionEnd: C:\apps\adobe\ColdFusion\8\instances\CF801\cfusion.ear\cfusion.war\test
    onApplicationEnd: C:\apps\adobe\ColdFusion\8\instances\CF801\cfusion.ear\cfusion.war\test
    
    
    Firstly, it's completely legit that the mapping doesn't work in the pseudoconstructor.  See my article on how the settings set in the this scope work if you're not sure why.

    However to me it's a bug that they aren't still around in onSessionEnd() and onApplicationEnd().  Someone at Adobe clearly thinks so too, as the behaviour has been modified (partially) in CF9:

    Pseudoconstructor: C:\webroots\CF902\test
    onApplicationStart: C:\temp
    onSessionStart: C:\temp
    onRequestStart: C:\temp
    onRequest: C:\temp
    test.cfm: C:\temp
    onRequestEnd: C:\temp
    onSessionEnd: C:\temp
    onApplicationEnd: C:\webroots\CF902\test
    
    
    onSessionEnd() has been fixed, but not onApplicationEnd().  You'd think that if someone took the time to fix one of these, they might check the other one too eh?  Apparently not.

    It's the same behaviour in ColdFusion 10.  But Railo (4.0.013) works fine: the mapping is still available in onApplicationEnd().

    I've raised a bug for this: 3358817.

    The work around - such as it is - for this is to set the mappings in CFAdmin: then they work fine.  Not much of a work around, but it might help some people.

    Righto.

    --
    Adam