Changeset 266 for framework/trunk/fuseboxCircuit.cfc
- Timestamp:
- 11/06/06 15:14:58 (2 years ago)
- Files:
-
- 1 modified
-
framework/trunk/fuseboxCircuit.cfc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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>
