Changeset 266
- Timestamp:
- 11/06/06 15:14:58 (2 years ago)
- Location:
- framework/trunk
- Files:
-
- 5 modified
-
fusebox.dtd (modified) (1 diff)
-
fuseboxApplication.cfc (modified) (5 diffs)
-
fuseboxCircuit.cfc (modified) (4 diffs)
-
myFusebox.cfc (modified) (1 diff)
-
skeleton/fusebox.xml.cfm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
framework/trunk/fusebox.dtd
r133 r266 13 13 path CDATA #REQUIRED 14 14 parent CDATA #IMPLIED 15 relative (true | false) "true" 15 16 > 16 17 <!-- -
framework/trunk/fuseboxApplication.cfc
r265 r266 93 93 hint="I am the myFusebox data structure." /> 94 94 95 <!--- fixed ticket 99 again--->95 <!--- fixed ticket 139 ---> 96 96 <cfset var myVersion = "5.0.1.#REReplace('$LastChangedRevision$','[^0-9]','','all')#" /> 97 97 … … 635 635 <cfset var alias = "" /> 636 636 <cfset var parent = "" /> 637 <cfset var relative = true /> 637 638 <cfset var nAttrs = 0 /> 638 639 … … 658 659 <cfset nAttrs = 2 /> 659 660 </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> 660 668 <cfif this.strictMode and nAttrs neq structCount(children[i].xmlAttributes)> 661 669 <cfthrow type="fusebox.badGrammar.unexpectedAttributes" … … 668 676 <cfif structKeyExists(previousCircuits,alias) and 669 677 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()> 671 680 <!--- old circuit, we can just reload it ---> 672 681 <cfset this.circuits[alias] = previousCircuits[alias].reload(arguments.myFusebox) /> … … 675 684 <cfset this.circuits[alias] = 676 685 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) /> 678 687 </cfif> 679 688 </cfloop> -
framework/trunk/fuseboxCircuit.cfc
r264 r266 63 63 <cfargument name="myFusebox" type="myFusebox" required="true" 64 64 hint="I am the myFusebox data structure." /> 65 <cfargument name="relative" type="boolean" required="true" 66 hint="I indicate whether the path is relative or absolute (mapped)." /> 65 67 66 68 <cfset variables.fuseboxApplication = arguments.fbApp /> 67 69 <cfset variables.alias = arguments.alias /> 70 <cfset variables.relative = arguments.relative /> 68 71 69 72 <cfset variables.fuseboxLexicon = variables.fuseboxApplication.getFuseactionFactory().getBuiltinLexicon() /> … … 81 84 </cfif> 82 85 <cfset this.path = variables.relativePath /> 83 <cfset variables.fullPath = variables.appPath & variables.relativePath /> 86 <!--- ticket 139: allow absolute path names and mappings: ---> 87 <cfif left(variables.relativePath,1) is "/"> 88 <cfif variables.relative> 89 <!--- unintentional absolute path? ---> 90 <cfif variables.fuseboxApplication.strictMode> 91 <cfthrow type="fusebox.badGrammar.illegalPath" 92 message="Circuit path is not relative" 93 detail="The 'path' value '#variables.originalPath#' for circuit #getAlias()# specifies an absolute path. Did you forget to specify 'relative=""false""'?" /> 94 </cfif> 95 <cfset variables.fullPath = variables.appPath & variables.relativePath /> 96 <cfelse> 97 <!--- explicit absolute / mapped path: ---> 98 <cfset variables.fullPath = expandPath(variables.relativePath) /> 99 </cfif> 100 <cfelse> 101 <cfif variables.relative> 102 <cfset variables.fullPath = variables.appPath & variables.relativePath /> 103 <cfelse> 104 <cfthrow type="fusebox.badGrammar.illegalPath" 105 message="Circuit path is relative" 106 detail="The 'path' value '#variables.originalPath#' for circuit #getAlias()# should specify an absolute path when 'relative=""false""'." /> 107 </cfif> 108 </cfif> 84 109 <!--- remove pairs of directory/../ to form canonical path: ---> 85 110 <cfloop condition="find('/../',variables.fullPath) gt 0"> 86 111 <cfset variables.fullPath = REreplace(variables.fullPath,"[^\.:/]*/\.\./","") /> 87 112 </cfloop> 113 <!--- 114 this was not correctly normalized prior to ticket 139 but it didn't really matter 115 until absolute paths were allowed in that ticket: 116 ---> 117 <cfset variables.relativePath = variables.fuseboxApplication.relativePath(variables.appPath,variables.fullPath) /> 88 118 <cfset this.rootPath = variables.fuseboxApplication.relativePath(variables.fullPath,variables.appPath) /> 89 119 … … 140 170 <cfthrow type="fusebox.missingCircuitXML" 141 171 message="missing circuit.xml" 142 detail="The circuit xml file, #circuitFile#, for circuit #getAlias()# could not be found ."172 detail="The circuit xml file, #circuitFile#, for circuit #getAlias()# could not be found in #variables.fullPath#." 143 173 extendedinfo="#cfcatch.detail#" /> 144 174 </cfif> … … 284 314 285 315 <cfreturn variables.circuitFile /> 316 317 </cffunction> 318 319 <cffunction name="getOriginalPathIsRelative" returntype="string" access="public" output="false" 320 hint="I return true if this circuit's declaration used a relative path."> 321 322 <cfreturn variables.relative /> 286 323 287 324 </cffunction> -
framework/trunk/myFusebox.cfc
r265 r266 51 51 <cfcomponent hint="I provide the per-request myFusebox data structure and some convenience methods."> 52 52 <cfscript> 53 // fixed ticket 99 for fusebox files53 // fixed ticket 139 54 54 this.version.runtime = "5.0.1.#REReplace('$LastChangedRevision$','[^0-9]','','all')#"; 55 55 -
framework/trunk/skeleton/fusebox.xml.cfm
r203 r266 7 7 <fusebox> 8 8 <circuits> 9 <!-- illustrates defaults for parent ("") and relative ("true") --> 9 10 <circuit alias="m" path="model/" parent="" /> 10 11 <circuit alias="v" path="views/" parent="" /> 11 <circuit alias="app" path="controller/" parent="" />12 <circuit alias="app" path="controller/" relative="true" /> 12 13 </circuits> 13 14 … … 21 22 <!-- change this to something more secure: --> 22 23 <parameter name="password" value="skeleton" /> 24 <parameter name="strictMode" value="true" /> 23 25 <!-- 24 26 These are all default values that can be overridden:
