Hello,
We are moving from coldfusion 9 to railo and amazon s3. I saw this cool feature in some old posts about overriding built-in functions. However I am unable to get it to work.
As far as I understand from the posts, if I want to override a function or a tag, I write a UDF and put it in the railo context lib/function or tag appropriately and restart railo and it should get overridden.
The tag I am interested in overriding/wrapping is cfinclude.
I want to change the template path before passing it to the builtin cfinclude. Basically, I want the cfinclude to check if a file is in S3, if it is not, then look for it in the local filesystem of the server, and then include it.
So I have this function to test. I have tried with naming the file and functionname cfinclude, and include - neither work.
I put it in /opt/railo/lib/railo-server/context/library/tag/ and /opt/railo/lib/railo-server/context/library/function/
<cffunction name="Include" output="yes" returntype="any" hint="Custom cfinclude in /opt/railo/lib/railo-server/context/library/tag/Include.cfm.">
<cfargument name="template" type="string" required="yes" hint="Template to include">
hello
<cfinclude attributeCollection="#arguments#">
</cffunction>
I restarted railo multiple times and tried different variations and naming, but this is not called.
How can I get this to work? Overriding built in stuff opens up so many new possibilities for us, we would rather not go in our code and update over 1000 places we use cfinclude.
Thank you
Arpan