Skip to content

Instantly share code, notes, and snippets.

@modius
Created October 18, 2009 10:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save modius/212620 to your computer and use it in GitHub Desktop.
Save modius/212620 to your computer and use it in GitHub Desktop.
Flush ColdFusion trusted cache from Farcry Webtop
<!--- (project or plugin)\packages\forms\UpdateApp.cfc --->
<cfcomponent displayname="Update App"
hint="Provides a granular way to update parts of the application state"
extends="farcry.core.packages.forms.UpdateApp"
output="false">
<cfproperty ftSeq="101"
ftFieldset="ColdFusion"
name="cfCache"
type="boolean"
default="0"
hint="Flush ColdFusion Trusted cache"
ftLabel="Flush Trusted Cache" ftType="boolean" />
<cffunction name="processCFcache"
access="public" returntype="boolean"
description="Reload PSL Service"
output="false">
<cfset var oCFAdmin = createObject("component","cfide.adminapi.administrator").login(application.fapi.getConfig('coldfusion','password')) />
<cfset var oRuntime = createObject("component","cfide.adminapi.runtime") />
<!--- Clear trusted cache --->
<cfset oRuntime.clearTrustedCache() />
<!--- Stop and restart trusted cache --->
<cfset oRuntime.setCacheProperty("TrustedCache", 0) />
<cfset oRuntime.setCacheProperty("TrustedCache", 1) />
<cfreturn true />
</cffunction>
</cfcomponent>
<!--- (project or plugin)\packages\forms\configColdFusion.cfc --->
<cfcomponent extends="farcry.core.packages.forms.forms"
key="coldfusion"
displayname="ColdFusion Config"
hint="ColdFusion Server"
output="false">
<cfproperty ftSeq="1"
name="password"
type="string"
default=""
hint="Password for accessing CF Admin API"
ftHint="Password to allow FarCry access to the CF admin API"
ftFieldset="Server"
ftLabel="CF Password"
ftType="password"
ftRenderType="editpassword"
ftstyle="width:500px;" />
</cfcomponent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment