Update of /cvsroot/bobs/bobs/inc/templates
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31807/bobs/inc/templates
Modified Files:
backup_create_databases.php
Log Message:
Applied Rene's patch to allow db3 or db4.
Index: backup_create_databases.php
===================================================================
RCS file: /cvsroot/bobs/bobs/inc/templates/backup_create_databases.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- backup_create_databases.php 15 Mar 2004 12:53:34 -0000 1.4
+++ backup_create_databases.php 26 Mar 2004 21:33:51 -0000 1.5
@@ -9,9 +9,18 @@
var $id = ''; // database handle
function create ( $db ) {
+
+ // check what dba type we should use
$this->id = dba_open ($db, "n", "db3");
+ if ( $this->id === FALSE ) {
+ $this->id = dba_open ($db, "n", "db4");
+ if ( $this->id === FALSE ) {
+ echo "Could not create a database of type db3 or db4 (tried both)\n";
+ }
+ }
return;
}
+
function closedb () {
dba_sync($this->id);
dba_close ($this->id);
@@ -96,14 +105,20 @@
// open the file index db
$id = dba_open($db, "r", "db3");
if (!$id) {
- echo "dba_open failed\n";
- exit;
+ $id = dba_open($db, "r", "db4");
+ if (!$id) {
+ echo "dba_open failed\n";
+ exit;
+ }
}
// create a new dir database.
$dir_id = dba_open ('{DIR_DB}', "n", "db3");
if (!$dir_id) {
- echo "dba_open failed\n";
- exit;
+ $dir_id = dba_open ('{DIR_DB}', "n", "db4");
+ if (!$dir_id) {
+ echo "dba_open failed\n";
+ exit;
+ }
}
// set the first key
|