util_driver_info (public)

 util_driver_info [ -array array ] [ -driver driver ]

Defined in packages/acs-tcl/tcl/utilities-procs.tcl

Returns the protocol and port for the specified (or current) driver.

Switches:
-array (optional)
the array to populate with proto, address and port
-driver (optional)
the driver to query (defaults to [ad_conn driver])
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 security::get_http_port security::get_http_port (private) util_driver_info util_driver_info security::get_http_port->util_driver_info security::get_https_port security::get_https_port (private) security::get_https_port->util_driver_info security::get_register_subsite security::get_register_subsite (public) security::get_register_subsite->util_driver_info security::validated_host_header security::validated_host_header (public) security::validated_host_header->util_driver_info subsite::get_url subsite::get_url (public) subsite::get_url->util_driver_info ad_conn ad_conn (public) util_driver_info->ad_conn

Testcases:
No testcase defined.
Source code:
    #ns_log notice "util_driver_info -driver <$driver>"

    if {$driver eq ""} {
        set driver [ad_conn driver]
    }

    set section [ns_driversection -driver $driver]

    switch -glob -- $driver {
        nsudp* -
        nssock* {
            set d [list proto http port [ns_config -int $section Port] address [ns_config $section address]]
        }
        nsunix {
            set d [list proto http port "" address ""]
        }
        nsssl* - nsssle {
            set d [list proto https port [ns_config -int $section Port] address [ns_config $section address]]
        }
        nsopenssl {
            set d [list proto https port [ns_config -int $section ServerPort] address [ns_config $section address]]
        }
        default {
            set d ""
            try {
                foreach drv [ns_driver info -server [ns_info server]] {
                    #ns_log notice "util_driver_info driver <$driver> check $drv"
                    if {[dict get $drv module] eq $driver} {
                        lappend d  proto [dict get $drv protocol]  address [dict get $drv address]  port [dict get $drv port]
                        #ns_log notice "util_driver_info for driver '$driver>' -> <$d>"
                        break
                    }
                }
            } on error {errorMsg} {
                # Maybe an older version of NaviServer
            }
            if {[llength $d] == 0} {
                ns_log warning "Unknown driver: '$driver'"
                set d [list proto http port [ns_config -int $section Port] address [ns_config $section address]]
            }
        }
    }
    set hostname [ns_config $section hostname]
    if {$hostname eq ""} {
        # Try to get hostname from linked driver configuration (h3)
        set hostname [ns_config [ns_config $section https] hostname]
    }
    if {$hostname eq ""} {
        ns_log error "util_driver_info: no 'hostname' specified in section '$section'"
    }
    lappend d hostname $hostname

    #ns_log notice "util_driver_info returns <$d>"

    if {[info exists array]} {
        upvar $array result
        array set result $d
    }
    return $d
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/utilities-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: