Index: openacs-4/packages/acs-bootstrap-installer/installer/tcl/0-acs-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/installer/tcl/0-acs-init.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-bootstrap-installer/installer/tcl/0-acs-init.tcl 27 Oct 2014 16:39:04 -0000 1.2 +++ openacs-4/packages/acs-bootstrap-installer/installer/tcl/0-acs-init.tcl 7 Aug 2017 23:47:46 -0000 1.3 @@ -7,11 +7,35 @@ # # $Id$ -# handling NaviServer deprecated ns_info subcommands. namespace eval acs { - set ::acs::pageroot [expr {[catch {ns_server pagedir}] ? [ns_info pageroot] : [ns_server pagedir]}] - set ::acs::tcllib [expr {[catch {ns_server tcllib}] ? [ns_info tcllib] : [ns_server tcllib]}] - set ::acs::rootdir [file dirname [string trimright $::acs::tcllib "/"]] + # + # Determine, under which server we are running + # + set ::acs::useNaviServer [expr {[ns_info name] eq "NaviServer"}] + + # + # Initialize the list of known database types . User code should use the database + # API routine db_known_database_types rather than reference the nsv list directly. + # We might change the way this is implemented later. Each database type is + # represented by a list consisting of the internal name, driver name, and + # "pretty name" (used by the APM to list the available database engines that + # one's package can choose to support). The driver name and "pretty name" happen + # to be the same for PostgreSQL and Oracle but let's not depend on that being true + # in all cases... + # + + set ::acs::known_database_types { + {oracle Oracle Oracle} + {postgresql PostgreSQL PostgreSQL} + } + + # + # Enable / disable features depending on availability + # + set ::acs::pageroot [expr {$::acs::useNaviServer ? [ns_server pagedir] : [ns_info pageroot]}] + set ::acs::tcllib [expr {$::acs::useNaviServer ? [ns_server tcllib] : [ns_info tcllib]}] + set ::acs::rootdir [file dirname [string trimright $::acs::tcllib "/"]] + set ::acs::useNsfProc [expr {[info commands ::nsf::proc] ne ""}] } # Determine the OpenACS root directory, which is the directory right above the @@ -39,7 +63,7 @@ lassign [split $version .] major minor point if {$major == 0 && ( $minor < 7 || ($minor == 7 && $point < 8))} { - ns_log Error "0-acs-init.tcl: please use tdom version 0.7.8 or greater (you have version $version)" + ns_log Error "0-acs-init.tcl: please use tDOM version 0.7.8 or greater (you have version $version)" } } } @@ -49,3 +73,9 @@ } else { ns_log "Error" "$bootstrap_file does not exist. Aborting the OpenACS load process." } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: