Changeset 283

Show
Ignore:
Timestamp:
12/23/06 02:17:38 (2 years ago)
Author:
scorfield
Message:

Addresses #95 by allowing fusebox.xml override for pluginsPath which can be relative
(to the application root) or absolute / mapped. A <plugin> can also specify a path=
attribute that is either relative (to the plugins directory) or absolute / mapped.

Location:
framework/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • framework/trunk/fuseboxApplication.cfc

    r282 r283  
    9393                                        hint="I am the myFusebox data structure." /> 
    9494                 
    95                 <!--- fixes ticket 95 for errortemplates and lexicons ---> 
     95                <!--- fixes ticket 95 for plugins ---> 
    9696                <cfset var myVersion = "5.0.1.#REReplace('$LastChangedRevision$','[^0-9]','','all')#" /> 
    9797 
  • framework/trunk/fuseboxCircuit.cfc

    r282 r283  
    7979                <cfset variables.lexicons = structNew() /> 
    8080                 
    81                 <cfset variables.relativePath = replace(arguments.path,"\","/","all") /> 
    82                 <cfif len(variables.relativePath) and right(variables.relativePath,1) is not "/"> 
    83                         <cfset variables.relativePath = variables.relativePath & "/" /> 
    84                 </cfif> 
     81                <cfset variables.relativePath = variables.fuseboxApplication.normalizePartialPath(arguments.path) /> 
    8582                <cfset this.path = variables.relativePath /> 
    8683                <!--- ticket 139: allow absolute path names and mappings: ---> 
  • framework/trunk/fuseboxPlugin.cfc

    r277 r283  
    9393 
    9494                        <cfif structKeyExists(arguments.pluginXML.xmlAttributes,"path")> 
    95                                 <cfset this.path = this.path & replace(arguments.pluginXML.xmlAttributes.path,"\","/","all") /> 
    96                         </cfif> 
    97                         <cfif right(this.path,1) is not "/"> 
    98                                 <cfset this.path = this.path & "/" /> 
     95                                <cfif left(arguments.pluginXML.xmlAttributes.path,1) is "/"> 
     96                                        <!--- path is absolute, ignore normal plugins path ---> 
     97                                        <cfset this.path = arguments.fbApp.normalizePartialPath(arguments.pluginXML.xmlAttributes.path) /> 
     98                                <cfelse> 
     99                                        <cfset this.path = this.path & arguments.fbApp.normalizePartialPath(arguments.pluginXML.xmlAttributes.path) /> 
     100                                </cfif> 
    99101                        </cfif> 
    100102                         
     
    135137                                <cfset variables.template = variables.template & ext /> 
    136138                        </cfif> 
    137                         <cfset this.rootpath = 
    138                                         arguments.fbApp.relativePath(arguments.fbApp.getApplicationRoot() & 
    139                                                                                                         this.path,arguments.fbApp.getApplicationRoot()) /> 
     139                        <cfif left(this.path,1) is "/"> 
     140                                <cfset this.rootpath = 
     141                                                arguments.fbApp.relativePath(arguments.fbApp.expandFuseboxPath(this.path),arguments.fbApp.getApplicationRoot()) /> 
     142                        <cfelse> 
     143                                <cfset this.rootpath = 
     144                                                arguments.fbApp.relativePath(arguments.fbApp.getApplicationRoot() & 
     145                                                                                                                this.path,arguments.fbApp.getApplicationRoot()) /> 
     146                        </cfif> 
    140147                        <!--- remove pairs of directory/../ to form canonical path: ---> 
    141148                        <cfloop condition="find('/../',this.rootpath) gt 0"> 
     
    196203                <cfswitch expression="#variables.phase#"> 
    197204                <cfcase value="processError,fuseactionException"> 
    198                         <cffile action="read" file="#variables.fuseboxApplication.getApplicationRoot()##this.path##variables.template#" 
    199                                         variable="file" 
    200                                         charset="#variables.fuseboxApplication.characterEncoding#" /> 
     205                        <cfif left(this.path,1) is "/"> 
     206                                <cffile action="read" file="#variables.fuseboxApplication.expandFuseboxPath(this.path)##variables.template#" 
     207                                                variable="file" 
     208                                                charset="#variables.fuseboxApplication.characterEncoding#" /> 
     209                        <cfelse> 
     210                                <cffile action="read" file="#variables.fuseboxApplication.getApplicationRoot()##this.path##variables.template#" 
     211                                                variable="file" 
     212                                                charset="#variables.fuseboxApplication.characterEncoding#" /> 
     213                        </cfif> 
    201214                        <cfset arguments.writer.rawPrintln(file) /> 
    202215                </cfcase> 
     
    208221                        <cfset arguments.writer.println('<cfset myFusebox.thisPlugin = "#getName()#"/>') /> 
    209222                        <cfset arguments.writer.print('<' & 'cfoutput><' & 'cfinclude template=') /> 
    210                         <cfset arguments.writer.print('"#variables.fuseboxApplication.parseRootPath##this.path##variables.template#"') /> 
     223                        <cfif left(this.path,1) is "/"> 
     224                                <cfset arguments.writer.print('"#this.path##variables.template#"') /> 
     225                        <cfelse> 
     226                                <cfset arguments.writer.print('"#variables.fuseboxApplication.parseRootPath##this.path##variables.template#"') /> 
     227                        </cfif> 
    211228                        <cfset arguments.writer.println('/><' & '/cfoutput>') /> 
    212229                        <cfset arguments.writer.setPhase(p) /> 
  • framework/trunk/myFusebox.cfc

    r282 r283  
    5151<cfcomponent hint="I provide the per-request myFusebox data structure and some convenience methods."> 
    5252        <cfscript> 
    53         // fixes ticket 95 for errortemplates and lexicons 
     53        // fixes ticket 95 for plugins 
    5454        this.version.runtime     = "5.0.1.#REReplace('$LastChangedRevision$','[^0-9]','','all')#"; 
    5555