Remove default database from config file - was confusing and if they changed it at...
authorchriskl <chriskl>
Thu, 27 Mar 2003 12:56:29 +0000 (12:56 +0000)
committerchriskl <chriskl>
Thu, 27 Mar 2003 12:56:29 +0000 (12:56 +0000)
classes/database/MySQL.php
classes/database/Postgres.php
classes/database/Postgres71.php
classes/database/Postgres72.php
classes/database/Postgres73.php
classes/database/Postgres74.php
conf/config.inc.php-dist
libraries/lib.inc.php

index 62349cb2f77b9f11b17560787c09636ce85d5bab..fa8fef415c5f31c6aad3234458d6f31e77327b78 100644 (file)
-<?php\r
-\r
-/**\r
- * A class that implements the DB interface for MySQL 3.23 and up\r
- *\r
- * $Id: MySQL.php,v 1.5 2003/01/18 06:38:37 chriskl Exp $\r
- */\r
-\r
-include_once('classes/database/BaseDB.php');\r
-\r
-class MySQL extends BaseDB {\r
-\r
-       var $dbFields = array('dbname' => 'Database');\r
-       var $tbFields = array('tbname' => 'Name', 'tbowner' => '');\r
-\r
-       // MySQL doesn't have object IDs \r
-       var $id = '';\r
-\r
-       function MySQL($host, $port, $database, $user, $password) {\r
-               $this->BaseDB('mysql');\r
-\r
-               //$this->Port = $port;\r
-\r
-               $this->conn->connect($host, $user, $password, $database);\r
-       }\r
-\r
-       /**\r
-        * A function to check that the database functions are installed\r
-        * and running.\r
-        * @return True on success, false otherwise\r
-        */\r
-       function isLoaded() {\r
-               return function_exists('mysql_connect');\r
-       }\r
-\r
-       /**\r
-        * Cleans (escapes) an object name (eg. table, field)\r
-        * @param $str The string to clean, by reference\r
-        * @return The cleaned string\r
-        */\r
-       function fieldClean(&$str) {\r
-               return $str;\r
-       }\r
-\r
-       /**\r
-        * Return all database available on the server\r
-        * @return A list of databases, sorted alphabetically\r
-        */\r
-       function &getDatabases() {\r
-               $sql = "SHOW DATABASES";\r
-               return $this->selectSet($sql);\r
-       }\r
-\r
-       /**\r
-        * Return all information about a particular database\r
-        * @param $database The name of the database to retrieve\r
-        * @return The database info\r
-        */\r
-       function &getDatabase($database) {\r
-               $this->clean($database);\r
-               $sql = "SHOW DATABASES LIKE '{$database}'";\r
-               return $this->selectRow($sql);\r
-       }\r
-\r
-       /**\r
-        * Drops a database\r
-        * @param $database The name of the database to retrieve\r
-        * @return 0 success\r
-        */\r
-       function dropDatabase($database) {\r
-               $this->clean($database);\r
-               $sql = "DROP DATABASE {$database}";\r
-       }\r
-\r
-       // Table functions\r
-\r
-       /**\r
-        * Return all tables in current database\r
-        * @return All tables, sorted alphabetically \r
-        */\r
-       function &getTables() {\r
-               $sql = "SHOW TABLE STATUS";\r
-               return $this->selectSet($sql);\r
-       }\r
-\r
-       /**\r
-        * Return all information relating to a table\r
-        * @param $table The name of the table\r
-        * @return Table information\r
-        */\r
-       function &getTableByName($table) {\r
-               $this->clean($table);\r
-               $sql = "SHOW TABLE STATUS LIKE '{$table}'";\r
-               return $this->selectRow($sql);\r
-       }\r
-\r
-       // @@ Need create table - tricky!!\r
-       \r
-       /**\r
-        * Removes a table from the database\r
-        * @param $table\r
-        * @return 0 success\r
-        */\r
-       function dropTable($table) {\r
-               $this->clean($table);\r
-               \r
-               $sql = "DROP TABLE {$table}";\r
-\r
-               // @@ How do you do this?\r
-               return $this->execute($sql);\r
-       }\r
-\r
-       /**\r
-        * Renames a table\r
-        * @param $table The table to be renamed\r
-        * @param $newName The new name for the table\r
-        * @return 0 success\r
-        */\r
-       function renameTable($table, $newName) {\r
-               $this->clean($table);\r
-               $this->clean($newName);\r
-               $sql = "ALTER TABLE {$table} RENAME {$newName}";\r
-\r
-               // @@ How do you do this?\r
-               return $this->execute($sql);\r
-       }\r
-\r
-       /**\r
-        * Adds a unique constraint to a table\r
-        * @param $table The table to which to add the unique\r
-        * @param $fields (array) An array of fields over which to add the unique\r
-        * @param $name (optional) The name to give the unique, otherwise default name is assigned\r
-        * @return 0 success\r
-        */\r
-       function addUniqueConstraint($table, $fields, $name = '') {\r
-               $this->clean($table);\r
-               $this->arrayClean($fields);\r
-               $this->clean($name);\r
-               \r
-               if ($name != '')\r
-                       $sql = "ALTER TABLE {$table} ADD UNIQUE {$name} (\"" . join('","', $fields) . "\")";\r
-               else\r
-                       $sql = "ALTER TABLE {$table} ADD UNIQUE (\"" . join('","', $fields) . "\")";\r
-\r
-               // @@ How do you do this?\r
-               return $this->execute($sql);\r
-       }\r
-\r
-       /**\r
-        * Drops a unique constraint from a table\r
-        * @param $table The table from which to drop the unique\r
-        * @param $name The name of the unique\r
-        * @return 0 success\r
-        */\r
-       function dropUniqueConstraint($table, $name) {\r
-               $this->clean($table);\r
-               $this->clean($name);\r
-               \r
-               $sql = "ALTER TABLE {$table} DROP INDEX {$name}";\r
-\r
-               // @@ How do you do this?\r
-               return $this->execute($sql);\r
-       }       \r
-        \r
-       /**\r
-        * Adds a primary key constraint to a table\r
-        * @param $table The table to which to add the primery key\r
-        * @param $fields (array) An array of fields over which to add the primary key\r
-        * @param $name (optional) The name to give the key, otherwise default name is assigned\r
-        * @return 0 success\r
-        */\r
-       function addPrimaryKeyConstraint($table, $fields, $name = '') {\r
-               $this->clean($table);\r
-               $this->arrayClean($fields);\r
-               $this->clean($name);\r
-               \r
-               if ($name != '')\r
-                       return -99;\r
-               else\r
-                       $sql = "ALTER TABLE {$table} ADD PRIMARY KEY (\"" . join('","', $fields) . "\")";\r
-\r
-               // @@ How do you do this?\r
-               return $this->execute($sql);\r
-       }\r
-\r
-       /**\r
-        * Drops a primary key constraint from a table\r
-        * @param $table The table from which to drop the primary key\r
-        * @param $name The name of the primary key\r
-        * @return 0 success\r
-        */\r
-       function dropPrimaryKeyConstraint($table, $name = '') {\r
-               $this->clean($table);\r
-               $this->clean($name);\r
-               \r
-               $sql = "ALTER TABLE {$table} DROP PRIMARY KEY";\r
-\r
-               // @@ How do you do this?\r
-               return $this->execute($sql);\r
-       }       \r
-       \r
-       // Column Functions\r
-\r
-       /**\r
-        * Add a new column to a table\r
-        * @param $table The table to add to\r
-        * @param $column The name of the new column\r
-        * @param $type The type of the column\r
-        * @param $size (optional) The optional size of the column (ie. 30 for varchar(30))\r
-        * @return 0 success\r
-        */\r
-       function addColumnToTable($table, $column, $type, $size = '') {\r
-               $this->clean($table);\r
-               $this->clean($column);\r
-               $this->clean($type);\r
-               $this->clean($size);\r
-               // @@ How the heck do you properly clean type and size?\r
-               \r
-               if ($size == '')\r
-                       $sql = "ALTER TABLE {$table} ADD COLUMN {$column} {$type}";\r
-               else\r
-                       $sql = "ALTER TABLE {$table} ADD COLUMN {$column} {$type}({$size})";\r
-\r
-               // @@ How do you do this?\r
-               return $this->execute($sql);\r
-       }\r
-\r
-       /**\r
-        * Drops a column from a table\r
-        * @param $table The table from which to drop\r
-        * @param $column The column name to drop\r
-        * @return 0 success\r
-        */\r
-       function dropColumnFromTable($table, $column) {\r
-               $this->clean($table);\r
-               $this->clean($column);\r
-               \r
-               $sql = "ALTER TABLE {$table} DROP COLUMN {$column}";\r
-               \r
-               return $this->execute($sql);\r
-       }\r
-\r
-       /**\r
-        * Sets default value of a column\r
-        * @param $table The table from which to drop\r
-        * @param $column The column name to set\r
-        * @param $default The new default value\r
-        * @return 0 success\r
-        */\r
-       function setColumnDefault($table, $column, $default) {\r
-               $this->clean($table);\r
-               $this->clean($column);\r
-               // @@ How the heck do you clean default clause?\r
-               \r
-               $sql = "ALTER TABLE {$table} ALTER COLUMN {$column} SET DEFAULT {$default}";\r
-\r
-               // @@ How do you do this?\r
-               return $this->execute($sql);\r
-       }\r
-\r
-       /**\r
-        * Drops default value of a column\r
-        * @param $table The table from which to drop\r
-        * @param $column The column name to drop default\r
-        * @return 0 success\r
-        */\r
-       function dropColumnDefault($table, $column) {\r
-               $this->clean($table);\r
-               $this->clean($column);\r
-\r
-               $sql = "ALTER TABLE {$table} ALTER COLUMN {$column} DROP DEFAULT";\r
-\r
-               // @@ How do you do this?\r
-               return $this->execute($sql);\r
-       }\r
-\r
-       /**\r
-        * Sets whether or not a column can contain NULLs\r
-        * @param $table The table that contains the column\r
-        * @param $column The column to alter\r
-        * @param $state True to set null, false to set not null\r
-        * @return 0 success\r
-        * @return -1 attempt to set not null, but column contains nulls\r
-        * @return -2 transaction error\r
-        * @return -3 lock error\r
-        * @return -4 update error\r
-        */\r
-       function setColumnNull($table, $column, $state) {\r
-               // Not implemented without knowing column type\r
-               return -99;\r
-       }\r
-\r
-       /**\r
-        * Renames a column in a table\r
-        * @param $table The table containing the column to be renamed\r
-        * @param $column The column to be renamed\r
-        * @param $newName The new name for the column\r
-        * @return 0 success\r
-        */\r
-       function renameColumn($table, $column, $newName) {\r
-               // Not implemented without knowing column type\r
-               return -99;\r
-       }\r
-\r
-       // Capabilities\r
-       function hasTables() { return true; }\r
-\r
-}\r
-\r
-?>\r
+<?php
+
+/**
+ * A class that implements the DB interface for MySQL 3.23 and up
+ *
+ * $Id: MySQL.php,v 1.6 2003/03/27 12:56:29 chriskl Exp $
+ */
+
+include_once('classes/database/BaseDB.php');
+
+class MySQL extends BaseDB {
+
+       var $dbFields = array('dbname' => 'Database');
+       var $tbFields = array('tbname' => 'Name', 'tbowner' => '');
+
+       // MySQL doesn't have object IDs 
+       var $id = '';
+
+       /**
+        * Constructor
+        * @param $host The hostname to connect to
+        * @param $post The port number to connect to
+        * @param $database The database to connect to.  NULL for default
+        * @param $user The user to connect as
+        * @param $password The password to use
+        */
+       function MySQL($host, $port, $database, $user, $password) {
+               $this->BaseDB('mysql');
+
+               $myhost = "{$host}:{$port}";
+               if ($database === null) $database = 'mysql';
+
+               $this->conn->connect($myhost, $user, $password, $database);
+       }
+
+       /**
+        * A function to check that the database functions are installed
+        * and running.
+        * @return True on success, false otherwise
+        */
+       function isLoaded() {
+               return function_exists('mysql_connect');
+       }
+
+       /**
+        * Cleans (escapes) an object name (eg. table, field)
+        * @param $str The string to clean, by reference
+        * @return The cleaned string
+        */
+       function fieldClean(&$str) {
+               return $str;
+       }
+
+       /**
+        * Return all database available on the server
+        * @return A list of databases, sorted alphabetically
+        */
+       function &getDatabases() {
+               $sql = "SHOW DATABASES";
+               return $this->selectSet($sql);
+       }
+
+       /**
+        * Return all information about a particular database
+        * @param $database The name of the database to retrieve
+        * @return The database info
+        */
+       function &getDatabase($database) {
+               $this->clean($database);
+               $sql = "SHOW DATABASES LIKE '{$database}'";
+               return $this->selectRow($sql);
+       }
+
+       /**
+        * Drops a database
+        * @param $database The name of the database to retrieve
+        * @return 0 success
+        */
+       function dropDatabase($database) {
+               $this->clean($database);
+               $sql = "DROP DATABASE {$database}";
+       }
+
+       // Table functions
+
+       /**
+        * Return all tables in current database
+        * @return All tables, sorted alphabetically 
+        */
+       function &getTables() {
+               $sql = "SHOW TABLE STATUS";
+               return $this->selectSet($sql);
+       }
+
+       /**
+        * Return all information relating to a table
+        * @param $table The name of the table
+        * @return Table information
+        */
+       function &getTableByName($table) {
+               $this->clean($table);
+               $sql = "SHOW TABLE STATUS LIKE '{$table}'";
+               return $this->selectRow($sql);
+       }
+
+       // @@ Need create table - tricky!!
+       
+       /**
+        * Removes a table from the database
+        * @param $table
+        * @return 0 success
+        */
+       function dropTable($table) {
+               $this->clean($table);
+               
+               $sql = "DROP TABLE {$table}";
+
+               // @@ How do you do this?
+               return $this->execute($sql);
+       }
+
+       /**
+        * Renames a table
+        * @param $table The table to be renamed
+        * @param $newName The new name for the table
+        * @return 0 success
+        */
+       function renameTable($table, $newName) {
+               $this->clean($table);
+               $this->clean($newName);
+               $sql = "ALTER TABLE {$table} RENAME {$newName}";
+
+               // @@ How do you do this?
+               return $this->execute($sql);
+       }
+
+       /**
+        * Adds a unique constraint to a table
+        * @param $table The table to which to add the unique
+        * @param $fields (array) An array of fields over which to add the unique
+        * @param $name (optional) The name to give the unique, otherwise default name is assigned
+        * @return 0 success
+        */
+       function addUniqueConstraint($table, $fields, $name = '') {
+               $this->clean($table);
+               $this->arrayClean($fields);
+               $this->clean($name);
+               
+               if ($name != '')
+                       $sql = "ALTER TABLE {$table} ADD UNIQUE {$name} (\"" . join('","', $fields) . "\")";
+               else
+                       $sql = "ALTER TABLE {$table} ADD UNIQUE (\"" . join('","', $fields) . "\")";
+
+               // @@ How do you do this?
+               return $this->execute($sql);
+       }
+
+       /**
+        * Drops a unique constraint from a table
+        * @param $table The table from which to drop the unique
+        * @param $name The name of the unique
+        * @return 0 success
+        */
+       function dropUniqueConstraint($table, $name) {
+               $this->clean($table);
+               $this->clean($name);
+               
+               $sql = "ALTER TABLE {$table} DROP INDEX {$name}";
+
+               // @@ How do you do this?
+               return $this->execute($sql);
+       }       
+        
+       /**
+        * Adds a primary key constraint to a table
+        * @param $table The table to which to add the primery key
+        * @param $fields (array) An array of fields over which to add the primary key
+        * @param $name (optional) The name to give the key, otherwise default name is assigned
+        * @return 0 success
+        */
+       function addPrimaryKeyConstraint($table, $fields, $name = '') {
+               $this->clean($table);
+               $this->arrayClean($fields);
+               $this->clean($name);
+               
+               if ($name != '')
+                       return -99;
+               else
+                       $sql = "ALTER TABLE {$table} ADD PRIMARY KEY (\"" . join('","', $fields) . "\")";
+
+               // @@ How do you do this?
+               return $this->execute($sql);
+       }
+
+       /**
+        * Drops a primary key constraint from a table
+        * @param $table The table from which to drop the primary key
+        * @param $name The name of the primary key
+        * @return 0 success
+        */
+       function dropPrimaryKeyConstraint($table, $name = '') {
+               $this->clean($table);
+               $this->clean($name);
+               
+               $sql = "ALTER TABLE {$table} DROP PRIMARY KEY";
+
+               // @@ How do you do this?
+               return $this->execute($sql);
+       }       
+       
+       // Column Functions
+
+       /**
+        * Add a new column to a table
+        * @param $table The table to add to
+        * @param $column The name of the new column
+        * @param $type The type of the column
+        * @param $size (optional) The optional size of the column (ie. 30 for varchar(30))
+        * @return 0 success
+        */
+       function addColumnToTable($table, $column, $type, $size = '') {
+               $this->clean($table);
+               $this->clean($column);
+               $this->clean($type);
+               $this->clean($size);
+               // @@ How the heck do you properly clean type and size?
+               
+               if ($size == '')
+                       $sql = "ALTER TABLE {$table} ADD COLUMN {$column} {$type}";
+               else
+                       $sql = "ALTER TABLE {$table} ADD COLUMN {$column} {$type}({$size})";
+
+               // @@ How do you do this?
+               return $this->execute($sql);
+       }
+
+       /**
+        * Drops a column from a table
+        * @param $table The table from which to drop
+        * @param $column The column name to drop
+        * @return 0 success
+        */
+       function dropColumnFromTable($table, $column) {
+               $this->clean($table);
+               $this->clean($column);
+               
+               $sql = "ALTER TABLE {$table} DROP COLUMN {$column}";
+               
+               return $this->execute($sql);
+       }
+
+       /**
+        * Sets default value of a column
+        * @param $table The table from which to drop
+        * @param $column The column name to set
+        * @param $default The new default value
+        * @return 0 success
+        */
+       function setColumnDefault($table, $column, $default) {
+               $this->clean($table);
+               $this->clean($column);
+               // @@ How the heck do you clean default clause?
+               
+               $sql = "ALTER TABLE {$table} ALTER COLUMN {$column} SET DEFAULT {$default}";
+
+               // @@ How do you do this?
+               return $this->execute($sql);
+       }
+
+       /**
+        * Drops default value of a column
+        * @param $table The table from which to drop
+        * @param $column The column name to drop default
+        * @return 0 success
+        */
+       function dropColumnDefault($table, $column) {
+               $this->clean($table);
+               $this->clean($column);
+
+               $sql = "ALTER TABLE {$table} ALTER COLUMN {$column} DROP DEFAULT";
+
+               // @@ How do you do this?
+               return $this->execute($sql);
+       }
+
+       /**
+        * Sets whether or not a column can contain NULLs
+        * @param $table The table that contains the column
+        * @param $column The column to alter
+        * @param $state True to set null, false to set not null
+        * @return 0 success
+        * @return -1 attempt to set not null, but column contains nulls
+        * @return -2 transaction error
+        * @return -3 lock error
+        * @return -4 update error
+        */
+       function setColumnNull($table, $column, $state) {
+               // Not implemented without knowing column type
+               return -99;
+       }
+
+       /**
+        * Renames a column in a table
+        * @param $table The table containing the column to be renamed
+        * @param $column The column to be renamed
+        * @param $newName The new name for the column
+        * @return 0 success
+        */
+       function renameColumn($table, $column, $newName) {
+               // Not implemented without knowing column type
+               return -99;
+       }
+
+       // Capabilities
+       function hasTables() { return true; }
+
+}
+
+?>
index 98e5535d316ec8067ad163f0cdb1454b9f206cb3..d3c2c27546547e80ae192598f641cce4663e1fa5 100755 (executable)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres.php,v 1.68 2003/03/26 05:59:05 chriskl Exp $
+ * $Id: Postgres.php,v 1.69 2003/03/27 12:56:29 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -100,12 +100,19 @@ class Postgres extends BaseDB {
        // Rule action types
        var $rule_events = array('SELECT', 'INSERT', 'UPDATE', 'DELETE');
 
+       /**
+        * Constructor
+        * @param $host The hostname to connect to
+        * @param $post The port number to connect to
+        * @param $database The database name to connect to. NULL for default.
+        * @param $user The user to connect as
+        * @param $password The password to use
+        */
        function Postgres($host, $port, $database, $user, $password) {
                $this->BaseDB('postgres7');
 
-               //$this->conn->host = $host
-               //$this->Port = $port;
-               $pghost = "$host:$port";
+               $pghost = "{$host}:{$port}";
+               if ($database === null) $database = 'template1';
 
                $this->conn->connect($pghost, $user, $password, $database);
        }
index 14890c659a1f9889121731eafb91b8bf2eb31a65..12cbe46e467feabfd7ab4bffba2609442e1a0aba 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres71.php,v 1.28 2003/03/25 00:26:27 chriskl Exp $
+ * $Id: Postgres71.php,v 1.29 2003/03/27 12:56:30 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -24,6 +24,14 @@ class Postgres71 extends Postgres {
                'sequence' => array('SELECT', 'UPDATE', 'ALL')
        );
 
+       /**
+        * Constructor
+        * @param $host The hostname to connect to
+        * @param $post The port number to connect to
+        * @param $database The database name to connect to
+        * @param $user The user to connect as
+        * @param $password The password to use
+        */
        function Postgres71($host, $port, $database, $user, $password) {
                $this->Postgres($host, $port, $database, $user, $password);
        }
index f73c8c08ea1cd9caa2c961b7ec1858c7ccac82a8..92a5373605d7e9c314d1d3c4aa44bbde4779be56 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres72.php,v 1.31 2003/03/26 03:45:00 chriskl Exp $
+ * $Id: Postgres72.php,v 1.32 2003/03/27 12:56:30 chriskl Exp $
  */
 
 
@@ -27,10 +27,14 @@ class Postgres72 extends Postgres71 {
                'sequence' => array('SELECT', 'UPDATE', 'ALL PRIVILEGES')
        );
 
-       // This gets it from the database.
-       // $rs = pg_exec($link, "SELECT oid FROM pg_database WHERE datname='template1'") or pg_die(pg_errormessage(), "", __FILE__, __LINE__);
-       // $builtin_max = pg_result($rs, 0, "oid");
-       
+       /**
+        * Constructor
+        * @param $host The hostname to connect to
+        * @param $post The port number to connect to
+        * @param $database The database name to connect to
+        * @param $user The user to connect as
+        * @param $password The password to use
+        */
        function Postgres72($host, $port, $database, $user, $password) {
                $this->Postgres71($host, $port, $database, $user, $password);
        }
index 8892f51b41d44f9ac5def2fe884a689e2812d135..8b6c1f71c7f7afdf210354dd3f31d3e077acf707 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres73.php,v 1.32 2003/03/26 02:14:04 chriskl Exp $
+ * $Id: Postgres73.php,v 1.33 2003/03/27 12:56:30 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -41,10 +41,19 @@ class Postgres73 extends Postgres72 {
                'schema' => array('CREATE', 'USAGE', 'ALL PRIVILEGES')
        );
 
+       /**
+        * Constructor
+        * @param $host The hostname to connect to
+        * @param $post The port number to connect to
+        * @param $database The database name to connect to
+        * @param $user The user to connect as
+        * @param $password The password to use
+        */
        function Postgres73($host, $port, $database, $user, $password) {
                $this->Postgres72($host, $port, $database, $user, $password);
        }
 
+
        // Schema functions
        
        /**
index 28744051837e96a7e1eb200f4b2a8b33a6990abb..c2823c8e315385a2d408c304a0b17a6d04ab04d1 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres74.php,v 1.4 2003/03/16 10:56:02 chriskl Exp $
+ * $Id: Postgres74.php,v 1.5 2003/03/27 12:56:30 chriskl Exp $
  */
 
 include_once('classes/database/Postgres73.php');
@@ -21,10 +21,19 @@ class Postgres74 extends Postgres73 {
        var $_schemaOIDs = array(11, 99);
        var $_schemaNames = array('pg_catalog', 'pg_toast');
 
+       /**
+        * Constructor
+        * @param $host The hostname to connect to
+        * @param $post The port number to connect to
+        * @param $database The database name to connect to
+        * @param $user The user to connect as
+        * @param $password The password to use
+        */
        function Postgres74($host, $port, $database, $user, $password) {
                $this->Postgres73($host, $port, $database, $user, $password);
        }
 
+
        // Trigger functions
        
        /**
index 3f30c9e6e1a010b7747ba7ceb1f51a54823c7464..47b2bd3343076680d9b5e0e471d64fbc80437515 100644 (file)
@@ -4,7 +4,7 @@
         * Central phpPgAdmin configuration.  As a user you may modify the
         * settings here for your particular configuration.
         *
-        * $Id: config.inc.php-dist,v 1.12 2003/03/10 02:15:16 chriskl Exp $
+        * $Id: config.inc.php-dist,v 1.13 2003/03/27 12:56:30 chriskl Exp $
         */
 
        // Set error reporting level
        $confServers[0]['host'] = 'localhost';
        $confServers[0]['port'] = 5432;
        $confServers[0]['type'] = 'Postgres73';
-       $confServers[0]['default'] = 'template1';
-       
+
        // Servers and types
        //$confServers[1]['desc'] = 'Development';
        //$confServers[1]['host'] = 'database-dev';
        //$confServers[1]['port'] = 5432;
-       //$confServers[1]['type'] = 'Postgres73';
-       //$confServers[1]['default'] = 'template1';
-       
+       //$confServers[1]['type'] = 'Postgres74';
+
        /*****************************************
         * Don't modify anything below this line *
         *****************************************/
index c1ba27be32466be3a9c61900fecf9319740b46b4..d17625041bc1144f5cc1c93ff244cdae6e15625a 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Function library read in upon startup
         *
-        * $Id: lib.inc.php,v 1.23 2003/03/27 10:56:27 chriskl Exp $
+        * $Id: lib.inc.php,v 1.24 2003/03/27 12:56:30 chriskl Exp $
         */
 
        // Application name 
                require_once('classes/database/' . $_type . '.php');
                $data = new $_type(     $confServers[$_SESSION['webdbServerID']]['host'],
                                                                        $confServers[$_SESSION['webdbServerID']]['port'],
-                                                                       $confServers[$_SESSION['webdbServerID']]['default'],
+                                                                       null,
                                                                        $_SESSION['webdbUsername'],
                                                                        $_SESSION['webdbPassword']);
        }