Changeset 1590
- Timestamp:
- 06/30/08 22:47:46 (6 months ago)
- Files:
-
- coldbox/trunk/system/interceptors/ses.cfc (modified) (8 diffs)
- coldbox/trunk/testharness/config/coldbox.xml.cfm (modified) (1 diff)
- coldbox/trunk/testharness/config/routes.cfm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
coldbox/trunk/system/interceptors/ses.cfc
r1589 r1590 154 154 <cfset httpRequestData = GetHttpRequestData()/> 155 155 156 <!--- Only verify if unique URLS are on, we have an event and a valid empty course. ---> 156 157 <cfif getUniqueURLs() 157 158 AND StructKeyExists(rc, EventName) 158 159 AND (arguments.course EQ "/index.cfm" or arguments.course eq "")> 159 160 161 <!--- Clean for handler & Action ---> 160 162 <cfif StructKeyExists(rc, EventName)> 161 163 <cfset handler = reReplace(rc[EventName],"\.[^.]*$","") /> 162 164 <cfset action = ListLast( rc[EventName], "." ) /> 163 165 </cfif> 164 166 <!--- course a handler ---> 165 167 <cfif len(handler)> 166 168 <cfset newpath = "/" & handler /> 167 169 </cfif> 168 170 <!--- Course path with handler + action if not the default event action ---> 169 171 <cfif len(handler) 170 172 AND len(action) … … 172 174 <cfset newpath = newpath & "/" & action /> 173 175 </cfif> 174 176 <!--- Relocation headers ---> 175 177 <cfif httpRequestData.method EQ "GET"> 176 178 <cfheader statuscode="301" statustext="Moved permanently" /> … … 178 180 <cfheader statuscode="303" statustext="See Other" /> 179 181 </cfif> 180 182 <!--- Relocate ---> 181 183 <cfheader name="Location" value="#getBaseURL()##newpath##serializeURL(httpRequestData.content,event)#" /> 182 184 <cfabort /> … … 212 214 <cfset var qsVal = "" /> 213 215 <cfset var requestString = arguments.action /> 216 <cfset var conventionString = ""> 217 <cfset var conventionStringLen = 0> 218 <cfset var tmpVar = ""> 214 219 <cfset var routeParams = arrayNew(1) /> 215 220 <cfset var routeParamsLength = 0> … … 260 265 <!--- Try to match this route against the URL ---> 261 266 <cfset match = REFindNoCase(thisPattern,requestString,1,true) /> 262 267 263 268 <!--- If a match was made, use the result to route the request ---> 264 269 <cfif (match.len[1] IS NOT 0 AND getProperty('looseMatching')) OR 265 270 (not getProperty('looseMatching') and match.len[1] IS NOT 0 and match.pos[1] EQ 1) > 266 <cfset foundRoute = thisRoute /> 271 <cfset foundRoute = thisRoute /> 267 272 <!--- For each part of the URL in the route ---> 268 273 <cfloop list="#thisRoute.pattern#" delimiters="/" index="thisPattern"> … … 274 279 </cfif> 275 280 </cfloop> 276 277 281 <!--- And leave the loop 'cause we found our route ---> 278 282 <cfbreak /> 279 </cfif> 280 283 </cfif> 281 284 </cfloop> 282 285 … … 287 290 </cfloop> 288 291 289 <!--- Now set the rest of the variables in the route ---> 292 <!--- Convention String, where it will translate the remaining name-value pairs into vars ---> 293 <cfset conventionString = right(requestString,len(requestString)-(match.pos[arraylen(match.pos)]+match.len[arrayLen(match.len)]))> 294 <cfset conventionStringLen = listLen(conventionString,'/')> 295 <cfset tmpVar = ""> 296 <cfif conventionStringLen gt 1> 297 <cfloop from="1" to="#conventionStringLen#" index="i"> 298 <cfif i mod 2 eq 0> 299 <!--- Even ---> 300 <cfset params[tmpVar] = listGetAt(conventionString,i,'/')> 301 <cfelse> 302 <!--- Odd ---> 303 <cfset tmpVar = listGetAt(conventionString,i,'/')> 304 </cfif> 305 </cfloop> 306 </cfif> 307 308 <!--- Now set the rest of the variables in the route: handler & action ---> 290 309 <cfloop collection="#foundRoute#" item="key"> 291 310 <cfif key IS NOT "pattern"> … … 298 317 299 318 <!--- Add a new Course ---> 300 <cffunction name="addCourse" access="p rivate" hint="Adds a route to dispatch" output="false">319 <cffunction name="addCourse" access="public" hint="Adds a route to dispatch" output="false"> 301 320 <!--- ************************************************************* ---> 302 321 <cfargument name="pattern" type="string" required="true" hint="The pattern to match against the URL." /> coldbox/trunk/testharness/config/coldbox.xml.cfm
r1588 r1590 44 44 <Setting name="MyStruct" value="{name:'luis majano', email:'info@email.com', active:'true'}"/> 45 45 <Setting name="MyArray" value="[1,2,3,4,5,6]"/> 46 <Setting name="MyBaseURL" value=" jfetmac" />46 <Setting name="MyBaseURL" value="apps.jfetmac" /> 47 47 </YourSettings> 48 48 coldbox/trunk/testharness/config/routes.cfm
r1589 r1590 59 59 Else, htmlBaseURL and sesBaseURL should be the same. 60 60 ---> 61 <cfset setBaseURL("http://#getSetting('MyBaseURL')#/coldbox/ index.cfm")>61 <cfset setBaseURL("http://#getSetting('MyBaseURL')#/coldbox/testharness/index.cfm")> 62 62 63 63
