Skip to content

Commit

Permalink
Preliminary OpenBD support (tested with OpenBD Ready2Run version 3.1).
Browse files Browse the repository at this point in the history
  • Loading branch information
perdjurner committed Jul 28, 2014
1 parent ea1cf88 commit 5a93055
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
3 changes: 0 additions & 3 deletions Application.cfc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<cfcomponent output="false">
<cfif StructKeyExists(server, "bluedragon")>
<cfset this.datasource = "wheelstestdb">
</cfif>
<cfinclude template="wheels/functions.cfm">
</cfcomponent>
10 changes: 1 addition & 9 deletions wheels/events/onapplicationstart.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,7 @@
application.$wheels.URLRewriting = "Off";
}
// set datasource name to same as the folder the app resides in unless the developer has set it with the global setting already
if (StructKeyExists(this, "dataSource"))
{
application.$wheels.dataSourceName = this.dataSource;
}
else
{
application.$wheels.dataSourceName = LCase(ListLast(GetDirectoryFromPath(GetBaseTemplatePath()), Right(GetDirectoryFromPath(GetBaseTemplatePath()), 1)));
}
application.$wheels.dataSourceName = this.dataSource;
application.$wheels.dataSourceUserName = "";
application.$wheels.dataSourcePassword = "";
application.$wheels.transactionMode = "commit";
Expand Down
1 change: 1 addition & 0 deletions wheels/functions.cfm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<cfset this.name = Hash(GetDirectoryFromPath(GetBaseTemplatePath()))>
<cfset this.mappings["/wheelsMapping"] = GetDirectoryFromPath(GetBaseTemplatePath()) & "wheels">
<cfset this.sessionManagement = true>
<cfset this.dataSource = LCase(ListLast(GetDirectoryFromPath(GetBaseTemplatePath()), Right(GetDirectoryFromPath(GetBaseTemplatePath()), 1)))>
<cfif StructKeyExists(server, "railo") OR StructKeyExists(server, "bluedragon")>
<cfinclude template="../config/app.cfm">
<cfinclude template="controller/appfunctions.cfm">
Expand Down
2 changes: 1 addition & 1 deletion wheels/model/adapters/Base.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
StructAppend(loc.args, loc.orgArgs, true);
</cfscript>

<cfquery result="loc.result" name="query.name" attributeCollection="#loc.args#"><cfloop array="#arguments.sql#" index="loc.i"><cfif IsStruct(loc.i)><cfset loc.queryParamAttributes = $CFQueryParameters(loc.i)><cfif StructKeyExists(loc.queryParamAttributes, "useNull")>NULL<cfelseif StructKeyExists(loc.queryParamAttributes, "list")><cfif arguments.parameterize>(<cfqueryparam value="#loc.queryParamAttributes.value#" cfsqltype="#loc.queryParamAttributes.cfsqltype#" attributeCollection="#loc.queryParamAttributes#">)<cfelse>(#PreserveSingleQuotes(loc.i.value)#)</cfif><cfelse><cfif arguments.parameterize><cfqueryparam value="#loc.queryParamAttributes.value#" cfsqltype="#loc.queryParamAttributes.cfsqltype#" attributeCollection="#loc.queryParamAttributes#"><cfelse>#$quoteValue(str=loc.i.value, sqlType=loc.i.type)#</cfif></cfif><cfelse><cfset loc.i = Replace(PreserveSingleQuotes(loc.i), "[[comma]]", ",", "all")>#PreserveSingleQuotes(loc.i)#</cfif>#chr(13)##chr(10)#</cfloop><cfif arguments.limit>LIMIT #arguments.limit#<cfif arguments.offset>#chr(13)##chr(10)#OFFSET #arguments.offset#</cfif></cfif></cfquery>
<cfquery result="loc.result" name="query.name" datasource="#loc.args.datasource#" attributeCollection="#loc.args#"><cfloop array="#arguments.sql#" index="loc.i"><cfif IsStruct(loc.i)><cfset loc.queryParamAttributes = $CFQueryParameters(loc.i)><cfif StructKeyExists(loc.queryParamAttributes, "useNull")>NULL<cfelseif StructKeyExists(loc.queryParamAttributes, "list")><cfif arguments.parameterize>(<cfqueryparam value="#loc.queryParamAttributes.value#" cfsqltype="#loc.queryParamAttributes.cfsqltype#" attributeCollection="#loc.queryParamAttributes#">)<cfelse>(#PreserveSingleQuotes(loc.i.value)#)</cfif><cfelse><cfif arguments.parameterize><cfqueryparam value="#loc.queryParamAttributes.value#" cfsqltype="#loc.queryParamAttributes.cfsqltype#" attributeCollection="#loc.queryParamAttributes#"><cfelse>#$quoteValue(str=loc.i.value, sqlType=loc.i.type)#</cfif></cfif><cfelse><cfset loc.i = Replace(PreserveSingleQuotes(loc.i), "[[comma]]", ",", "all")>#PreserveSingleQuotes(loc.i)#</cfif>#chr(13)##chr(10)#</cfloop><cfif arguments.limit>LIMIT #arguments.limit#<cfif arguments.offset>#chr(13)##chr(10)#OFFSET #arguments.offset#</cfif></cfif></cfquery>

<cfscript>
if (StructKeyExists(query, "name"))
Expand Down

0 comments on commit 5a93055

Please sign in to comment.