Show
Ignore:
Timestamp:
11/06/06 15:14:58 (2 years ago)
Author:
scorfield
Message:

Addresses #139 by adding a new attribute, relative=, to the <circuit> declaration in fusebox.xml and,
in strict mode, validating path= and throwing an exception if it is "/absolute/" rather than "relative/".
The default behavior is compatibile with Fusebox 5.0.0 and earlier releases.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • framework/trunk/fuseboxApplication.cfc

    r265 r266  
    9393                                        hint="I am the myFusebox data structure." /> 
    9494                 
    95                 <!--- fixed ticket 99 again ---> 
     95                <!--- fixed ticket 139 ---> 
    9696                <cfset var myVersion = "5.0.1.#REReplace('$LastChangedRevision$','[^0-9]','','all')#" /> 
    9797 
     
    635635                <cfset var alias = "" /> 
    636636                <cfset var parent = "" /> 
     637                <cfset var relative = true /> 
    637638                <cfset var nAttrs = 0 /> 
    638639                 
     
    658659                                <cfset nAttrs = 2 /> 
    659660                        </cfif> 
     661                        <cfif structKeyExists(children[i].xmlAttributes,"relative")> 
     662                                <!--- TODO: check it is boolean ---> 
     663                                <cfset relative = children[i].xmlAttributes.relative /> 
     664                                <cfset nAttrs = nAttrs + 1 /> 
     665                        <cfelse> 
     666                                <cfset parent = "" /> 
     667                        </cfif> 
    660668                        <cfif this.strictMode and nAttrs neq structCount(children[i].xmlAttributes)> 
    661669                                <cfthrow type="fusebox.badGrammar.unexpectedAttributes" 
     
    668676                        <cfif structKeyExists(previousCircuits,alias) and 
    669677                                        children[i].xmlAttributes.path is previousCircuits[alias].getOriginalPath() and 
    670                                         parent is previousCircuits[alias].parent> 
     678                                        parent is previousCircuits[alias].parent and 
     679                                        relative eq previousCircuits[alias].getOriginalPathIsRelative()> 
    671680                                <!--- old circuit, we can just reload it ---> 
    672681                                <cfset this.circuits[alias] = previousCircuits[alias].reload(arguments.myFusebox) /> 
     
    675684                                <cfset this.circuits[alias] = 
    676685                                                createObject("component","fuseboxCircuit") 
    677                                                         .init(this,alias,children[i].xmlAttributes.path,parent,arguments.myFusebox) /> 
     686                                                        .init(this,alias,children[i].xmlAttributes.path,parent,arguments.myFusebox,relative) /> 
    678687                        </cfif> 
    679688                </cfloop>