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):
- 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 $dXQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-tcl/tcl/utilities-procs.xql