Index: openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info,v
diff -u -N -r1.39.2.7 -r1.39.2.8
--- openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info 4 Oct 2015 13:40:06 -0000 1.39.2.7
+++ openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info 30 Nov 2015 12:57:42 -0000 1.39.2.8
@@ -9,7 +9,7 @@
f
t
-
+
Don Baccus
Bootstraps an OpenACS installation.
2015-10-04
@@ -18,7 +18,7 @@
GPL
3
-
+
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 -N -r1.2.2.3 -r1.2.2.4
--- openacs-4/packages/acs-bootstrap-installer/installer/tcl/0-acs-init.tcl 10 Sep 2015 08:21:15 -0000 1.2.2.3
+++ openacs-4/packages/acs-bootstrap-installer/installer/tcl/0-acs-init.tcl 30 Nov 2015 12:57:42 -0000 1.2.2.4
@@ -12,12 +12,28 @@
# Determine, under which server we are running
#
set ::acs::useNaviServer [expr {[ns_info name] eq "NaviServer"}]
+
#
- # Handling NaviServer deprecated ns_info subcommands.
+ # 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 Postgres 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 ""}]
}
Index: openacs-4/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl,v
diff -u -N -r1.9.2.2 -r1.9.2.3
--- openacs-4/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl 27 Oct 2015 09:54:48 -0000 1.9.2.2
+++ openacs-4/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl 30 Nov 2015 12:57:42 -0000 1.9.2.3
@@ -15,9 +15,9 @@
@creation-date 2003/03/16
} {
if { $dbn eq "" } {
- set dbn [nsv_get {db_default_database} .]
+ set dbn $::acs::default_database
}
- return [nsv_get {db_available_pools} $dbn]
+ return [nsv_get db_available_pools $dbn]
}
ad_proc -private db_pool_to_dbn_init {} {
@@ -31,7 +31,7 @@
} {
foreach dbn [nsv_array names {db_available_pools}] {
foreach pool [db_available_pools $dbn] {
- nsv_set {db_pool_to_dbn} $pool $dbn
+ nsv_set db_pool_to_dbn $pool $dbn
}
}
}
@@ -92,17 +92,17 @@
# connecting to the same database and user in each pool, but at the moment
# that's seems anal even by DRB's standards.
- # 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 Postgres and Oracle but let's not depend on that being true
- # in all cases...
+ # The same information is as well in 0-acs-init.tcl; it is kept
+ # here for a while to guarantee a smooth migration, since the
+ # db-interface is essential and we have to deal with situations,
+ # where still an old 0-acs-init.tcl is active. This could be
+ # removed around OpenACS 6.*
+ #
+ set ::acs::known_database_types {
+ {oracle Oracle Oracle}
+ {postgresql PostgreSQL PostgreSQL}
+ }
- nsv_set ad_known_database_types . \
- [list [list "oracle" "Oracle" "Oracle"] [list "postgresql" "PostgreSQL" "PostgreSQL"]]
#
# Initialize the list of available pools
@@ -133,7 +133,7 @@
# all_pools to ensure that the pool is valid.
set dbn_pools [ns_config $config_path "pools_${dbn}"]
- nsv_set {db_available_pools} $dbn $dbn_pools
+ nsv_set db_available_pools $dbn $dbn_pools
ns_log Notice "$proc_name: For database '$dbn', the following pools are available: $dbn_pools"
}
@@ -144,7 +144,8 @@
}
}
- nsv_set {db_default_database} . $default_dbn
+ set ::acs::default_database $default_dbn
+
ns_log Notice "$proc_name: Default database (dbn) is: '$default_dbn'"
if { $old_availablepool_p } {
@@ -215,7 +216,7 @@
set database_problem "RDBMS type could not be determined: $errmsg"
ns_log Error "$proc_name: RDBMS type could not be determined: $errmsg"
} else {
- foreach known_database_type [nsv_get ad_known_database_types .] {
+ foreach known_database_type $::acs::known_database_types {
set this_type [lindex $known_database_type 1]
Index: openacs-4/packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl,v
diff -u -N -r1.43.2.1 -r1.43.2.2
--- openacs-4/packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl 17 Aug 2015 16:43:55 -0000 1.43.2.1
+++ openacs-4/packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl 30 Nov 2015 12:57:42 -0000 1.43.2.2
@@ -322,7 +322,7 @@
if {$db_dir eq "common"} {
return ""
}
- foreach known_database_type [db_known_database_types] {
+ foreach known_database_type $::acs::known_database_types {
if {[lindex $known_database_type 0] eq $db_dir} {
return $db_dir
}
@@ -332,7 +332,7 @@
}
set file_name [file tail $path]
- foreach known_database_type [nsv_get ad_known_database_types .] {
+ foreach known_database_type $::acs::known_database_types {
if { [regexp -- "\-[lindex $known_database_type 0]\.(xql|tcl|sqlj)\$" $file_name match] } {
return [lindex $known_database_type 0]
}
Index: openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl,v
diff -u -N -r1.88.2.4 -r1.88.2.5
--- openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 20 Oct 2015 08:01:04 -0000 1.88.2.4
+++ openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 30 Nov 2015 12:57:42 -0000 1.88.2.5
@@ -113,11 +113,13 @@
# We now use the following global variables:
#
# Server-Wide NSV arrays, keys:
-# db_default_database .
# db_available_pools $dbn
# db_driverkey $dbn
# db_pool_to_dbn $pool
#
+# Global Variables
+# ::acs::default_database
+#
# Per-thread Tcl global variables:
# One Tcl Array per Database Name:
# db_state_${dbn}
@@ -156,7 +158,7 @@
@creation-date 2003/03/16
} {
if { $dbn eq "" } {
- set dbn [nsv_get {db_default_database} .]
+ set dbn $::acs::default_database
}
return "db_state_${dbn}"
}
@@ -195,6 +197,11 @@
}
}
+ set key ::acs::db_driverkey($dbn)
+ if {[info exists $key]} {
+ return [set $key]
+ }
+
if { ![nsv_exists db_driverkey $dbn] } {
# This ASSUMES that any overriding of this default value via
# "ns_param driverkey_dbn" has already been done:
@@ -224,7 +231,7 @@
nsv_set db_driverkey $dbn $driverkey
}
- return [nsv_get db_driverkey $dbn]
+ return [set $key [nsv_get db_driverkey $dbn]]
}
@@ -293,7 +300,7 @@
The nsv containing the list is initialized by the bootstrap script and should
never be referenced directly by user code.
} {
- return [nsv_get ad_known_database_types .]
+ return $::acs::known_database_types
}