add rudimentary support for 8.1devel
authorchriskl <chriskl>
Tue, 15 Mar 2005 02:44:10 +0000 (02:44 +0000)
committerchriskl <chriskl>
Tue, 15 Mar 2005 02:44:10 +0000 (02:44 +0000)
HISTORY
classes/database/Connection.php
classes/database/Postgres81.php [new file with mode: 0644]
help/PostgresDoc81.php [new file with mode: 0644]

diff --git a/HISTORY b/HISTORY
index 7d72a3e423808dd9658ae4ec1ae98e6316d1b353..f0cb29e90ad14abd47475989ede24c8a58703413 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -10,6 +10,7 @@ Features
 * Allow variable size textarea when editing values (Juergen Weigert)
 * Allow SQL script upload to parse arbitrary SQL, including multiline
   SQL statements
+* Add support for PostgreSQL 8.1devel
   
 Bugs
 * Tree Icons are displayed middle instead of top
index 60f1a4700a39af7405752c6085b6aa2f4d7b1505..71b9faf55beb845a57b14a341b9051eb808d4802 100755 (executable)
@@ -3,7 +3,7 @@
 /**
  * Class to represent a database connection
  *
- * $Id: Connection.php,v 1.8 2005/02/06 04:18:58 mr-russ Exp $
+ * $Id: Connection.php,v 1.9 2005/03/15 02:44:10 chriskl Exp $
  */
 
 include_once('./classes/database/ADODB_base.php');
@@ -65,6 +65,8 @@ class Connection {
                // it won't work with those versions.
                if ((int)substr($version, 0, 1) < 7)
                        return null;
+               elseif (strpos($version, '8.0') === 0 || strpos($version, '7.5') === 0)
+                       return 'Postgres80';
                elseif (strpos($version, '7.4') === 0)
                        return 'Postgres74';
                elseif (strpos($version, '7.3') === 0)
@@ -76,7 +78,7 @@ class Connection {
                elseif (strpos($version, '7.0') === 0)
                        return 'Postgres';
                else
-                       return 'Postgres80';
+                       return 'Postgres81';
        }
 
        /** 
diff --git a/classes/database/Postgres81.php b/classes/database/Postgres81.php
new file mode 100644 (file)
index 0000000..26daa7e
--- /dev/null
@@ -0,0 +1,73 @@
+<?php
+
+/**
+ * PostgreSQL 8.1 support
+ *
+ * $Id: Postgres81.php,v 1.1 2005/03/15 02:44:10 chriskl Exp $
+ */
+
+include_once('./classes/database/Postgres80.php');
+
+class Postgres81 extends Postgres80 {
+
+       // Map of database encoding names to HTTP encoding names.  If a
+       // database encoding does not appear in this list, then its HTTP
+       // encoding name is the same as its database encoding name.
+       var $codemap = array(
+               'BIG5' => 'BIG5',
+               'EUC_CN' => 'GB2312',
+               'EUC_JP' => 'EUC-JP',
+               'EUC_KR' => 'EUC-KR',
+               'EUC_TW' => 'EUC-TW', 
+               'GB18030' => 'GB18030',
+               'GBK' => 'GB2312',
+               'ISO_8859_5' => 'ISO-8859-5',
+               'ISO_8859_6' => 'ISO-8859-6',
+               'ISO_8859_7' => 'ISO-8859-7',
+               'ISO_8859_8' => 'ISO-8859-8',
+               'JOHAB' => 'CP1361',
+               'KOI8' => 'KOI8-R',
+               'LATIN1' => 'ISO-8859-1',
+               'LATIN2' => 'ISO-8859-2',
+               'LATIN3' => 'ISO-8859-3',
+               'LATIN4' => 'ISO-8859-4',
+               'LATIN5' => 'ISO-8859-9',
+               'LATIN6' => 'ISO-8859-10',
+               'LATIN7' => 'ISO-8859-13',
+               'LATIN8' => 'ISO-8859-14',
+               'LATIN9' => 'ISO-8859-15',
+               'LATIN10' => 'ISO-8859-16',
+               'SJIS' => 'SHIFT_JIS',
+               'SQL_ASCII' => 'US-ASCII',
+               'UHC' => 'WIN949',
+               'UTF8' => 'UTF-8',
+               'WIN866' => 'CP866',
+               'WIN874' => 'CP874',
+               'WIN1250' => 'CP1250',
+               'WIN1251' => 'CP1251',
+               'WIN1252' => 'CP1252',
+               'WIN1256' => 'CP1256',
+               'WIN1258' => 'CP1258'
+       );
+       
+       // Last oid assigned to a system object
+       var $_lastSystemOID = 17231;
+
+       /**
+        * Constructor
+        * @param $conn The database connection
+        */
+       function Postgres81($conn) {
+               $this->Postgres80($conn);
+       }
+
+       // Help functions
+       
+       function &getHelpPages() {
+               include_once('./help/PostgresDoc81.php');
+               return $this->help_page;
+       }
+
+}
+
+?>
diff --git a/help/PostgresDoc81.php b/help/PostgresDoc81.php
new file mode 100644 (file)
index 0000000..bcd6d65
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * Help links for PostgreSQL 8.1 documentation
+ *
+ * $Id: PostgresDoc81.php,v 1.1 2005/03/15 02:44:11 chriskl Exp $
+ */
+
+include('./help/PostgresDoc80.php');
+
+$this->help_base = sprintf($GLOBALS['conf']['help_base'], '8.1');
+
+?>