Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add support for relative pathes and placeholder to path field of the …

…H2 driver
  • Loading branch information...
commit 62a8c6f318f0f9c80808c5af6e116f7b812d4267 1 parent f0b8c3f
micstriit authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 railo-cfml/railo-admin/admin/dbdriver/H2.cfc
View
10 railo-cfml/railo-admin/admin/dbdriver/H2.cfc
@@ -15,6 +15,7 @@
<cffunction name="onBeforeUpdate" returntype="void" output="no">
+ <!--- add the right file delimiter --->
<cfset form.custom_path=replace(
form.custom_path,
SLASH[server.separator.file],
@@ -24,7 +25,15 @@
<cfset form.custom_path=form.custom_path&server.separator.file>
</cfif>
+ <!--- make sure relative path and path with placeholder are working --->
+ <cfif not directoryExists(form.custom_path)>
+ <cfset local._custom_path=expandPath(form.custom_path)>
+ <cfif directoryExists(local._custom_path)>
+ <cfset form.custom_path=local._custom_path>
+ </cfif>
+ </cfif>
+ <!--- if parent exist, create it --->
<cfif not directoryExists(form.custom_path)>
<cfset var parent=mid(form.custom_path,1,len(form.custom_path)-1)>
<cfset parent=getDirectoryFromPath(parent)>
@@ -34,6 +43,7 @@
<cfthrow message="directory [#form.custom_path#] doesn't exist">
</cfif>
</cfif>
+
</cffunction>
<cffunction name="getName" returntype="string" output="no"
Please sign in to comment.
Something went wrong with that request. Please try again.