DB updated to 1.8.2
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 12 Feb 2015 21:00:50 +0000 (22:00 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 12 Feb 2015 21:42:00 +0000 (22:42 +0100)
16 files changed:
extlib/DB.php
extlib/DB/common.php
extlib/DB/dbase.php
extlib/DB/fbsql.php
extlib/DB/ibase.php
extlib/DB/ifx.php
extlib/DB/msql.php
extlib/DB/mssql.php
extlib/DB/mysql.php
extlib/DB/mysqli.php
extlib/DB/oci8.php
extlib/DB/odbc.php
extlib/DB/pgsql.php
extlib/DB/sqlite.php
extlib/DB/storage.php
extlib/DB/sybase.php

index a511979e67a74816f1facdcedc7c2ec2e16dde01..b9b5c4a79fdd0462e0a7d0ca4065dd41a42a9364 100644 (file)
@@ -5,7 +5,7 @@
 /**
  * Database independent query interface
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -20,7 +20,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: DB.php,v 1.88 2007/08/12 05:27:25 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -426,12 +426,12 @@ define('DB_PORTABILITY_ALL', 63);
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.13
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB
 {
-    // {{{ &factory()
+    // {{{ factory()
 
     /**
      * Create a new DB object for the specified database type but don't
@@ -444,7 +444,7 @@ class DB
      *
      * @see DB_common::setOption()
      */
-    function &factory($type, $options = false)
+    public static function factory($type, $options = false)
     {
         if (!is_array($options)) {
             $options = array('persistent' => $options);
@@ -480,7 +480,7 @@ class DB
     }
 
     // }}}
-    // {{{ &connect()
+    // {{{ connect()
 
     /**
      * Create a new DB object including a connection to the specified database
@@ -495,7 +495,7 @@ class DB
      *     'portability' => DB_PORTABILITY_ALL,
      * );
      *
-     * $db =& DB::connect($dsn, $options);
+     * $db = DB::connect($dsn, $options);
      * if (PEAR::isError($db)) {
      *     die($db->getMessage());
      * }
@@ -515,7 +515,7 @@ class DB
      *
      * @uses DB::parseDSN(), DB_common::setOption(), PEAR::isError()
      */
-    function &connect($dsn, $options = array())
+    public static function connect($dsn, $options = array())
     {
         $dsninfo = DB::parseDSN($dsn);
         $type = $dsninfo['phptype'];
@@ -539,7 +539,8 @@ class DB
         if (!class_exists($classname)) {
             $tmp = PEAR::raiseError(null, DB_ERROR_NOT_FOUND, null, null,
                                     "Unable to include the DB/{$type}.php"
-                                    . " file for '$dsn'",
+                                    . " file for '"
+                                    . DB::getDSNString($dsn, true) . "'",
                                     'DB_Error', true);
             return $tmp;
         }
@@ -576,7 +577,7 @@ class DB
      */
     function apiVersion()
     {
-        return '1.7.13';
+        return '1.8.2';
     }
 
     // }}}
@@ -589,9 +590,9 @@ class DB
      *
      * @return bool  whether $value is DB_Error object
      */
-    function isError($value)
+    public static function isError($value)
     {
-        return is_a($value, 'DB_Error');
+        return is_object($value) && is_a($value, 'DB_Error');          
     }
 
     // }}}
@@ -604,7 +605,7 @@ class DB
      *
      * @return bool  whether $value is a DB_<driver> object
      */
-    function isConnection($value)
+    public static function isConnection($value)
     {
         return (is_object($value) &&
                 is_subclass_of($value, 'db_common') &&
@@ -625,7 +626,7 @@ class DB
      *
      * @return boolean  whether $query is a data manipulation query
      */
-    function isManip($query)
+    public static function isManip($query)
     {
         $manips = 'INSERT|UPDATE|DELETE|REPLACE|'
                 . 'CREATE|DROP|'
@@ -649,7 +650,7 @@ class DB
      * @return string  the error message or false if the error code was
      *                  not recognized
      */
-    function errorMessage($value)
+    public static function errorMessage($value)
     {
         static $errorMessages;
         if (!isset($errorMessages)) {
@@ -730,7 +731,7 @@ class DB
      *  + username: User name for login
      *  + password: Password for login
      */
-    function parseDSN($dsn)
+    public static function parseDSN($dsn)
     {
         $parsed = array(
             'phptype'  => false,
@@ -859,7 +860,7 @@ class DB
      * @param boolean true to hide the password, false to include it
      * @return string
      */
-    function getDSNString($dsn, $hidePassword) {
+    public static function getDSNString($dsn, $hidePassword) {
         /* Calling parseDSN will ensure that we have all the array elements
          * defined, and means that we deal with strings and array in the same
          * manner. */
@@ -940,7 +941,7 @@ class DB
  * @author     Stig Bakken <ssb@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.13
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_Error extends PEAR_Error
@@ -987,7 +988,7 @@ class DB_Error extends PEAR_Error
  * @author     Stig Bakken <ssb@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.13
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_result
@@ -1452,7 +1453,7 @@ class DB_result
  * @author     Stig Bakken <ssb@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.13
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  * @see        DB_common::setFetchMode()
  */
index c51323d252a90bd88823d1e9c61cf316a16f4ff1..27829a072a0fcf4dadbb52e996ac0c9733a20996 100644 (file)
@@ -5,7 +5,7 @@
 /**
  * Contains the DB_common base class
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -20,7 +20,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: common.php,v 1.144 2007/11/26 22:54:03 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -42,7 +42,7 @@ require_once 'PEAR.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_common extends PEAR
@@ -204,7 +204,7 @@ class DB_common extends PEAR
     function __wakeup()
     {
         if ($this->was_connected) {
-            $this->connect($this->dsn, $this->options);
+            $this->connect($this->dsn, $this->options['persistent']);
         }
     }
 
@@ -261,7 +261,7 @@ class DB_common extends PEAR
      */
     function quoteString($string)
     {
-        $string = $this->quote($string);
+        $string = $this->quoteSmart($string);
         if ($string{0} == "'") {
             return substr($string, 1, -1);
         }
@@ -284,8 +284,7 @@ class DB_common extends PEAR
      */
     function quote($string = null)
     {
-        return ($string === null) ? 'NULL'
-                                  : "'" . str_replace("'", "''", $string) . "'";
+        return $this->quoteSmart($string);
     }
 
     // }}}
@@ -1249,7 +1248,7 @@ class DB_common extends PEAR
             return $query;
         }
         $result = $this->query($query, $params);
-        if (is_a($result, 'DB_result')) {
+        if (is_object($result) && is_a($result, 'DB_result')) {
             $result->setOption('limit_from', $from);
             $result->setOption('limit_count', $count);
         }
index 67afc897d7ff586abe9cd39a90376c1d39e54242..df36f972e3f8168050a6a8e6295fab0e64416d5d 100644 (file)
@@ -6,7 +6,7 @@
  * The PEAR DB driver for PHP's dbase extension
  * for interacting with dBase databases
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -20,7 +20,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: dbase.php,v 1.45 2007/09/21 13:40:41 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -41,7 +41,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_dbase extends DB_common
index 4de4078f778406af58eac1d88ac3801e94df28d0..b719da38e204802b9f7a4f58d5d19ef6fa2e8d96 100644 (file)
@@ -6,7 +6,7 @@
  * The PEAR DB driver for PHP's fbsql extension
  * for interacting with FrontBase databases
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -20,7 +20,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: fbsql.php,v 1.88 2007/07/06 05:19:21 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -41,7 +41,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  * @since      Class functional since Release 1.7.0
  */
index ee19c55890ee215643e08a9ee6bdad98e2ee4903..209ac6c3a1821848d92d753129c6fae3544182f2 100644 (file)
@@ -9,7 +9,7 @@
  * While this class works with PHP 4, PHP's InterBase extension is
  * unstable in PHP 4.  Use PHP 5.
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -23,7 +23,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: ibase.php,v 1.116 2007/09/21 13:40:41 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -49,7 +49,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  * @since      Class became stable in Release 1.7.0
  */
@@ -916,6 +916,8 @@ class DB_ibase extends DB_common
             $error_regexps = array(
                 '/generator .* is not defined/'
                     => DB_ERROR_SYNTAX,  // for compat. w ibase_errcode()
+                '/violation of [\w ]+ constraint/i'
+                    => DB_ERROR_CONSTRAINT,
                 '/table.*(not exist|not found|unknown)/i'
                     => DB_ERROR_NOSUCHTABLE,
                 '/table .* already exists/i'
@@ -926,8 +928,6 @@ class DB_ibase extends DB_common
                     => DB_ERROR_NOT_FOUND,
                 '/validation error for column .* value "\*\*\* null/i'
                     => DB_ERROR_CONSTRAINT_NOT_NULL,
-                '/violation of [\w ]+ constraint/i'
-                    => DB_ERROR_CONSTRAINT,
                 '/conversion error from string/i'
                     => DB_ERROR_INVALID_NUMBER,
                 '/no permission for/i'
index baa6f2867c37c147e6c0facf3558fe67846b27fa..e3150f92fbbe62621deee38b6142c96532186fa4 100644 (file)
@@ -6,7 +6,7 @@
  * The PEAR DB driver for PHP's ifx extension
  * for interacting with Informix databases
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -20,7 +20,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: ifx.php,v 1.75 2007/07/06 05:19:21 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -48,7 +48,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_ifx extends DB_common
@@ -536,7 +536,7 @@ class DB_ifx extends DB_common
      */
     function errorCode($nativecode)
     {
-        if (ereg('SQLCODE=(.*)]', $nativecode, $match)) {
+        if (preg_match('/SQLCODE=(.*)]/', $nativecode, $match)) {
             $code = $match[1];
             if (isset($this->errorcode_map[$code])) {
                 return $this->errorcode_map[$code];
index 34854f47202410c3c85af395064ca011679a7186..c303bb9067d097de75c15f9cc13833c7380006ca 100644 (file)
@@ -10,7 +10,7 @@
  * 4.3.11 and 5.0.4.  Make sure your version of PHP meets or exceeds
  * those versions.
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -23,7 +23,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: msql.php,v 1.64 2007/09/21 13:40:41 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -47,7 +47,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  * @since      Class not functional until Release 1.7.0
  */
index 511a2b686a1f4b66dceed35cef1b255ef2ce662d..e25caf144eba6e68e95944ba4af6a1a3c6ebbfc8 100644 (file)
@@ -6,7 +6,7 @@
  * The PEAR DB driver for PHP's mssql extension
  * for interacting with Microsoft SQL Server databases
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -20,7 +20,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: mssql.php,v 1.92 2007/09/21 13:40:41 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -49,7 +49,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_mssql extends DB_common
@@ -623,6 +623,27 @@ class DB_mssql extends DB_common
         return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
     }
 
+    // }}}
+    // {{{ escapeSimple()
+
+    /**
+     * Escapes a string in a manner suitable for SQL Server.
+     *
+     * @param string $str  the string to be escaped
+     * @return string  the escaped string
+     *
+     * @see DB_common::quoteSmart()
+     * @since Method available since Release 1.6.0
+     */
+    function escapeSimple($str)
+    {
+        return str_replace(
+            array("'", "\\\r\n", "\\\n"),
+            array("''", "\\\\\r\n\r\n", "\\\\\n\n"),
+            $str
+        );
+    }
+
     // }}}
     // {{{ quoteIdentifier()
 
index c672545205cc3a5c4259c98b02122cbdc064f114..21132d62df96857a5f23b95e682f91a8e5208915 100644 (file)
@@ -6,7 +6,7 @@
  * The PEAR DB driver for PHP's mysql extension
  * for interacting with MySQL databases
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -20,7 +20,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: mysql.php,v 1.126 2007/09/21 13:32:52 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -41,7 +41,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_mysql extends DB_common
@@ -772,17 +772,6 @@ class DB_mysql extends DB_common
         return '`' . str_replace('`', '``', $str) . '`';
     }
 
-    // }}}
-    // {{{ quote()
-
-    /**
-     * @deprecated  Deprecated in release 1.6.0
-     */
-    function quote($str)
-    {
-        return $this->quoteSmart($str);
-    }
-
     // }}}
     // {{{ escapeSimple()
 
index c6941b170eab255db5417a3d746a9339804d1326..5f081f7c4fe262968977005fa7b07bd69821bbf0 100644 (file)
@@ -6,7 +6,7 @@
  * The PEAR DB driver for PHP's mysqli extension
  * for interacting with MySQL databases
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -19,7 +19,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: mysqli.php,v 1.82 2007/09/21 13:40:41 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -43,7 +43,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  * @since      Class functional since Release 1.6.3
  */
@@ -993,7 +993,7 @@ class DB_mysqli extends DB_common
             $got_string = false;
         }
 
-        if (!is_a($id, 'mysqli_result')) {
+        if (!is_object($id) || !is_a($id, 'mysqli_result')) {
             return $this->mysqliRaiseError(DB_ERROR_NEED_MORE_DATA);
         }
 
index d307948713bf84aebea9e9dd410ea3758fb2c5cd..9685c60e0c91c9d041f790449f626622636b1790 100644 (file)
@@ -6,7 +6,7 @@
  * The PEAR DB driver for PHP's oci8 extension
  * for interacting with Oracle databases
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -20,7 +20,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: oci8.php,v 1.116 2007/11/28 02:22:39 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -47,7 +47,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_oci8 extends DB_common
@@ -452,6 +452,7 @@ class DB_oci8 extends DB_common
         if (isset($this->prepare_types[(int)$stmt])) {
             unset($this->prepare_types[(int)$stmt]);
             unset($this->manip_query[(int)$stmt]);
+            unset($this->_prepared_queries[(int)$stmt]);
         } else {
             return false;
         }
@@ -670,7 +671,8 @@ class DB_oci8 extends DB_common
                 $tmp = $this->oci8RaiseError($stmt);
                 return $tmp;
             }
-            $this->last_query = preg_replace("/:bind$i/",$this->quoteSmart($data[$key]),$this->last_query,1);
+            $this->last_query = preg_replace("/:bind$i(?!\d)/",
+                    $this->quoteSmart($data[$key]), $this->last_query, 1);
             $i++;
         }
         if ($this->autocommit) {
index eba43659a77e80d2ec1f6f0236e1ab459f0de554..75d4fe74ffd28c8443257a539d0e1b4e10b86486 100644 (file)
@@ -6,7 +6,7 @@
  * The PEAR DB driver for PHP's odbc extension
  * for interacting with databases via ODBC connections
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -20,7 +20,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: odbc.php,v 1.81 2007/07/06 05:19:21 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -44,7 +44,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_odbc extends DB_common
@@ -480,18 +480,6 @@ class DB_odbc extends DB_common
         }
     }
 
-    // }}}
-    // {{{ quote()
-
-    /**
-     * @deprecated  Deprecated in release 1.6.0
-     * @internal
-     */
-    function quote($str)
-    {
-        return $this->quoteSmart($str);
-    }
-
     // }}}
     // {{{ nextId()
 
index 6030bb4c16bb788822a906bab947141adb67895f..adfd6bf0a4b4ce42bb4b10b521d0641c0df9c112 100644 (file)
@@ -6,7 +6,7 @@
  * The PEAR DB driver for PHP's pgsql extension
  * for interacting with PostgreSQL databases
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -21,7 +21,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: pgsql.php,v 1.139 2007/11/28 02:19:44 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -43,7 +43,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_pgsql extends DB_common
@@ -348,12 +348,12 @@ class DB_pgsql extends DB_common
          * CREATE, DECLARE, DELETE, DROP TABLE, EXPLAIN, FETCH,
          * GRANT, INSERT, LISTEN, LOAD, LOCK, MOVE, NOTIFY, RESET,
          * REVOKE, ROLLBACK, SELECT, SELECT INTO, SET, SHOW,
-         * UNLISTEN, UPDATE, VACUUM
+         * UNLISTEN, UPDATE, VACUUM, WITH
          */
         if ($ismanip) {
             $this->affected = @pg_affected_rows($result);
             return DB_OK;
-        } elseif (preg_match('/^\s*\(*\s*(SELECT|EXPLAIN|FETCH|SHOW)\s/si',
+        } elseif (preg_match('/^\s*\(*\s*(SELECT|EXPLAIN|FETCH|SHOW|WITH)\s/si',
                              $query))
         {
             $this->row[(int)$result] = 0; // reset the row counter.
@@ -465,18 +465,6 @@ class DB_pgsql extends DB_common
         return false;
     }
 
-    // }}}
-    // {{{ quote()
-
-    /**
-     * @deprecated  Deprecated in release 1.6.0
-     * @internal
-     */
-    function quote($str)
-    {
-        return $this->quoteSmart($str);
-    }
-
     // }}}
     // {{{ quoteBoolean()
 
index 5c4b396e5ed46bfda7359d34fcf218207c3a4d5d..7adfb4c475a292140b796767145f3c92f144b2e0 100644 (file)
@@ -6,7 +6,7 @@
  * The PEAR DB driver for PHP's sqlite extension
  * for interacting with SQLite databases
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -21,7 +21,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 3.0
- * @version    CVS: $Id: sqlite.php,v 1.118 2007/11/26 22:57:18 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -47,7 +47,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_sqlite extends DB_common
@@ -829,6 +829,9 @@ class DB_sqlite extends DB_common
             $flags = '';
             if ($id[$i]['pk']) {
                 $flags .= 'primary_key ';
+                if (strtoupper($type) == 'INTEGER') {
+                    $flags .= 'auto_increment ';
+                }
             }
             if ($id[$i]['notnull']) {
                 $flags .= 'not_null ';
index ffa2d9447874783e16e4b80ff54a3f6a82261644..9ac23c825e176f16673b8d800537a2a53d1eb774 100644 (file)
@@ -5,7 +5,7 @@
 /**
  * Provides an object interface to a table row
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -18,7 +18,7 @@
  * @author     Stig Bakken <stig@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: storage.php,v 1.24 2007/08/12 05:27:25 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -38,7 +38,7 @@ require_once 'DB.php';
  * @author     Stig Bakken <stig@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_storage extends PEAR
index 3befbf6ea9767a924b5e2e8fae9b8f82e8f7b12c..d87b18caabbd689744d4038fdc29e227afe8b4f0 100644 (file)
@@ -6,7 +6,7 @@
  * The PEAR DB driver for PHP's sybase extension
  * for interacting with Sybase databases
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -21,7 +21,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: sybase.php,v 1.87 2007/09/21 13:40:42 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -46,7 +46,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.8.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_sybase extends DB_common