• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 3. The Fusebox Framework > Section 6: Reverse Circuit Structure

Section 6: Reverse Circuit Structure

Section 6 creates a mirror image of the fusebox.circuits structure. Instead of the keys in the circuits structure being the circuit names and their values being the directory mappings, this structure’s keys are the directory mappings and the values of those mappings are the circuit names. The reverse circuit structure is used throughout the rest of the core to look up the circuit name of whichever circuit is being accessed at that moment. Here is the code:

<cftry> 
  <cfscript> 
  FB_.ReverseCircuitPath=StructNew(); 
  for (aCircuitName in fusebox.Circuits){
    FB_.ReverseCircuitPath[fusebox.Circuits[aCircuitName]]=aCircuitName; 
    if (ListLen(fusebox.Circuits[aCircuitName], "/") EQ 1){
      fusebox.HomeCircuit=aCircuitName; 
      fusebox.IsHomeCircuit=TRUE;}} 
  </cfscript> 
  <cfcatch> 
    <cfif fusebox.suppressErrors> 
      <cfoutput>The circuits structure does not exist...</cfoutput><cfabort> 
    <cfelse><cfrethrow></cfif> 
  </cfcatch> 
</cftry> 

					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint