ds_enabled_p (public)

 ds_enabled_p

Defined in packages/acs-developer-support/tcl/acs-developer-support-procs.tcl

Returns:
true if developer-support facilities are enabled.

Partial Call Graph (max 5 caller/called nodes):
%3 test_ds_features_enabled_test ds_features_enabled_test (test acs-developer-support) ds_enabled_p ds_enabled_p test_ds_features_enabled_test->ds_enabled_p ds_add ds_add (public) ds_add->ds_enabled_p ds_collect_connection_info ds_collect_connection_info (public) ds_collect_connection_info->ds_enabled_p ds_collect_db_call ds_collect_db_call (public) ds_collect_db_call->ds_enabled_p ds_comment ds_comment (public) ds_comment->ds_enabled_p ds_get_db_command_info ds_get_db_command_info (private) ds_get_db_command_info->ds_enabled_p

Testcases:
ds_features_enabled_test
Source code:
    #
    # On busy sites, frequent calls to [ds_enabled_p] lead to huge
    # number of mutex locks for the nsv ds_properties. Therefore,
    # cache its results in a per-request variable.
    #
    if {[info exists ::ds_enabled_p]} {
        return $::ds_enabled_p
    }

    #
    # When not connected, always assume that developer-support is
    # turned off.
    #
    if { [ns_conn isconnected] == 0 } {
        return 0
    }
    #
    # Get the nsv values and cache it in the current request.
    #
    if {
        ![nsv_exists ds_properties enabled_p]
        || ![nsv_get ds_properties enabled_p]
    } {
        set ::ds_enabled_p 0
    } else {
        set ::ds_enabled_p 1
    }
    return $::ds_enabled_p
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: