CFLib.org – Common Function Library Project

enableDisableDebugging(what)

Last updated September 21, 2004

Version: 1 | Requires: ColdFusion MX | Library: UtilityLib

 
Rated 0 time(s). Average Rating: 0

Description:
This UDF will enable or disable debugging service based on the argument provided. I is useful in situation where you do not have access to ColdFusion Administrator or want to manipulate debugging settings programatically.

Return Values:
Returns nothing.

Example:

view plain print about
<cfoutput>
#enableDisableDebugging('disable')#
#enableDisableDebugging('enable')#
</cfoutput>

Parameters:

Name Description Required
what Either enable or disable. Yes

Full UDF Source:

view plain print about
<!---
 This UDF will enable or disable debugging service with Admin access
 
 @param what      Either enable or disable.  (Required)
 @return Returns nothing. 
 @author Qasim Rasheed (qasim_1976@yahoo.com) 
 @version 1, April 14, 2005 
--->

<cffunction name="enableDisableDebugging" output="false" returntype="void" hint="I enable/disable debugging settings">
    <cfargument name="what" type="string" required="true" />    
    <cfset var db_service = createobject("java","coldfusion.server.ServiceFactory").getDebuggingService()>
    
    <cfif arguments.what eq "enable">
        <cfif not db_service.isEnabled()>
            <cfset db_service.setEnabled(true)>
        </cfif>
    <cfelseif arguments.what eq "disable">
        <cfif db_service.isEnabled()>
            <cfset db_service.setEnabled(false)>
        </cfif>
    </cfif>
</cffunction>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Tayo Akinmade Tayo Akinmade added
arrayTrim
3 day(s) ago

Will Belden Will Belden added
longTime
9 day(s) ago

James Sleeman James Sleeman added
quickSort
19 day(s) ago

Ben Forta Ben Forta added
GetHostAddress
22 day(s) ago

Top Rated

Darwan Leonardo Sitepu EksporSQLData
Rated 5.0, 16 time(s)

Darwan Leonardo Sitepu backupDatabase
Rated 5.0, 13 time(s)

Barney Boisvert indentXml
Rated 5.0, 10 time(s)

Kevin Pepperman generateSsccAsn
Rated 5.0, 4 time(s)

Created by Raymond Camden / Design by Justin Johnson