Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Nov 2023 12:21:50 GMT
From:      Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 54b238b132af - main - databases/pear-DB: Import upstream patches
Message-ID:  <202311271221.3ARCLoXq094234@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=54b238b132af2af8b8e1a13cb07816b3be6396c0

commit 54b238b132af2af8b8e1a13cb07816b3be6396c0
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-11-27 11:27:16 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-11-27 12:19:29 +0000

    databases/pear-DB: Import upstream patches
    
    - Add lastId method [1]
    - Fix PHP 8.2 compatiblity [2]
    - Update WWW
    - Bump PORTREVISION for package change
    
    Obtained from:  https://github.com/pear/DB/commit/90010c56379bd2b116172a9ea321282cb8389243 [1]
                    https://github.com/pear/DB/commit/4efd340ec9eb1da23fa2df60d387c274e9c1100b (part of) [2]
---
 databases/pear-DB/Makefile                   |   4 +-
 databases/pear-DB/files/patch-..-package.xml |  54 +++
 databases/pear-DB/files/patch-lastId         |  92 ++++
 databases/pear-DB/files/patch-php82          | 623 +++++++++++++++++++++++++++
 4 files changed, 772 insertions(+), 1 deletion(-)

diff --git a/databases/pear-DB/Makefile b/databases/pear-DB/Makefile
index f9716a62b72d..73cf0cd31289 100644
--- a/databases/pear-DB/Makefile
+++ b/databases/pear-DB/Makefile
@@ -1,11 +1,13 @@
 PORTNAME=	DB
 PORTVERSION=	1.11.0
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	databases www pear
 
 MAINTAINER=	sunpoet@FreeBSD.org
 COMMENT=	PEAR Database Abstraction Layer
-WWW=		https://pear.php.net/package/DB
+WWW=		https://pear.php.net/package/DB \
+		https://github.com/pear/DB/
 
 LICENSE=	PHP301
 
diff --git a/databases/pear-DB/files/patch-..-package.xml b/databases/pear-DB/files/patch-..-package.xml
new file mode 100644
index 000000000000..850a8f232fdc
--- /dev/null
+++ b/databases/pear-DB/files/patch-..-package.xml
@@ -0,0 +1,54 @@
+--- ../package.xml.orig	2021-08-11 00:23:52 UTC
++++ ../package.xml
+@@ -76,7 +76,7 @@ DB is compatible with PHP 5 and PHP 7.</description>
+  </notes>
+  <contents>
+   <dir name="/">
+-   <file md5sum="eaf70b943121e9dfa35e4088bd5fd52e" name="DB/common.php" role="php">
++   <file md5sum="a9128c5dfb3a8e474b163d3dcd0f0739" name="DB/common.php" role="php">
+     <tasks:replace from="@package_version@" to="version" type="package-info" />
+    </file>
+    <file md5sum="10119c4e34daeeb4971e2796fa3921b2" name="DB/dbase.php" role="php">
+@@ -85,34 +85,34 @@ DB is compatible with PHP 5 and PHP 7.</description>
+    <file md5sum="ba5f07380be8b2c03adb1fc09e7db5b8" name="DB/fbsql.php" role="php">
+     <tasks:replace from="@package_version@" to="version" type="package-info" />
+    </file>
+-   <file md5sum="9819551742b4cdb3a5abf45f471f95b1" name="DB/ibase.php" role="php">
++   <file md5sum="28b82817a9fb0ed6ff7618076ee9a142" name="DB/ibase.php" role="php">
+     <tasks:replace from="@package_version@" to="version" type="package-info" />
+    </file>
+    <file md5sum="e6981af139e452257dc39bc5350644a3" name="DB/ifx.php" role="php">
+     <tasks:replace from="@package_version@" to="version" type="package-info" />
+    </file>
+-   <file md5sum="4e8c5a8afc6b5ad37f23bf559201f1f4" name="DB/msql.php" role="php">
++   <file md5sum="d31648f78c41d11fb4f8687b30b602d6" name="DB/msql.php" role="php">
+     <tasks:replace from="@package_version@" to="version" type="package-info" />
+    </file>
+    <file md5sum="a32af26c00b059f0d8ccfa2662c4cb49" name="DB/mssql.php" role="php">
+     <tasks:replace from="@package_version@" to="version" type="package-info" />
+    </file>
+-   <file md5sum="55ad1308ffc308267f563789290fdbdf" name="DB/mysql.php" role="php">
++   <file md5sum="870c455db8787da3f97d01f875490545" name="DB/mysql.php" role="php">
+     <tasks:replace from="@package_version@" to="version" type="package-info" />
+    </file>
+-   <file md5sum="b62a36e1e05ad95af8f39a5a48855ebd" name="DB/mysqli.php" role="php">
++   <file md5sum="fcf77ba6df51d24385061d9e6b4378bc" name="DB/mysqli.php" role="php">
+     <tasks:replace from="@package_version@" to="version" type="package-info" />
+    </file>
+-   <file md5sum="3aa11d49d1c687e1e1680ed31acd41ab" name="DB/oci8.php" role="php">
++   <file md5sum="1b483906142c176fa510da54fe794aac" name="DB/oci8.php" role="php">
+     <tasks:replace from="@package_version@" to="version" type="package-info" />
+    </file>
+-   <file md5sum="baf67770a168687ac87faaade1c136ec" name="DB/odbc.php" role="php">
++   <file md5sum="48f18271c1d33dc34e4dce793db3b684" name="DB/odbc.php" role="php">
+     <tasks:replace from="@package_version@" to="version" type="package-info" />
+    </file>
+-   <file md5sum="50547917ca4cc946aad49e15fd054c0b" name="DB/pgsql.php" role="php">
++   <file md5sum="71c4706666ea849b4bd39cd23e0c5d9f" name="DB/pgsql.php" role="php">
+     <tasks:replace from="@package_version@" to="version" type="package-info" />
+    </file>
+-   <file md5sum="c653861f7b53a2a095a030fdc191aaa1" name="DB/sqlite.php" role="php">
++   <file md5sum="342cb6f566d22d23eaeef0cde62af33a" name="DB/sqlite.php" role="php">
+     <tasks:replace from="@package_version@" to="version" type="package-info" />
+    </file>
+    <file md5sum="39c1a57add4b198c8b77349f7955981e" name="DB/storage.php" role="php">
diff --git a/databases/pear-DB/files/patch-lastId b/databases/pear-DB/files/patch-lastId
new file mode 100644
index 000000000000..22cfbabe96b9
--- /dev/null
+++ b/databases/pear-DB/files/patch-lastId
@@ -0,0 +1,92 @@
+Obtained from:	https://github.com/pear/DB/commit/90010c56379bd2b116172a9ea321282cb8389243
+
+--- DB/common.php.orig	2021-08-11 00:23:52 UTC
++++ DB/common.php
+@@ -1809,6 +1809,23 @@ class DB_common extends PEAR
+     }
+ 
+     // }}}
++    // {{{ lastId()
++
++    /**
++     * Returns the row ID of the most recent INSERT into the database
++     *
++     * @param string  $link_identifier  DBMS link identifier
++     *
++     * @return int the row ID of the most recent INSERT into the database.
++     *             If no successful INSERTs into rowid tables have ever
++     *             occurred on this database connection then returns 0.
++     */
++    function lastId($link_identifier = null)
++    {
++        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
++    }
++
++    // }}}
+     // {{{ createSequence()
+ 
+     /**
+--- DB/mysql.php.orig	2021-08-11 00:23:52 UTC
++++ DB/mysql.php
+@@ -654,6 +654,29 @@ class DB_mysql extends DB_common
+     }
+ 
+     // }}}
++    // {{{ lastId()
++
++    /**
++     * Returns the row ID of the most recent INSERT into the database
++     *
++     * @param string  $link_identifier mysql link identifier
++     *
++     * @return int the row ID of the most recent INSERT into the database.
++     *             If no successful INSERTs into rowid tables have ever
++     *             occurred on this database connection then returns 0.
++     *
++     * @see DB_common::lastID()
++     */
++    function lastId($link_identifier = null)
++    {
++        $id = mysql_insert_id($link_identifier);
++        if(empty($id) || !is_int($id)) {
++            return 0;
++        }
++        return $id;
++    }
++
++    // }}}
+     // {{{ createSequence()
+ 
+     /**
+--- DB/mysqli.php.orig	2021-08-11 00:23:52 UTC
++++ DB/mysqli.php
+@@ -739,6 +739,29 @@ class DB_mysqli extends DB_common
+         return $this->raiseError($result);
+     }
+ 
++    // }}}
++    // {{{ lastId()
++
++    /**
++     * Returns the row ID of the most recent INSERT into the database
++     *
++     * @param string  $link_identifier mysqli link identifier
++     *
++     * @return int the row ID of the most recent INSERT into the database.
++     *             If no successful INSERTs into rowid tables have ever
++     *             occurred on this database connection then returns 0.
++     *
++     * @see DB_common::lastID()
++     */
++    function lastId($link_identifier = null)
++    {
++        $id = $this->connection->insert_id();
++        if(empty($id) || !is_int($id)) {
++            return 0;
++        }
++        return $id;
++    }
++
+     /**
+      * Creates a new sequence
+      *
diff --git a/databases/pear-DB/files/patch-php82 b/databases/pear-DB/files/patch-php82
new file mode 100644
index 000000000000..63b2115dbb05
--- /dev/null
+++ b/databases/pear-DB/files/patch-php82
@@ -0,0 +1,623 @@
+Obtained from:	https://github.com/pear/DB/commit/4efd340ec9eb1da23fa2df60d387c274e9c1100b (part of)
+
+--- DB/ibase.php.orig	2021-08-11 00:23:52 UTC
++++ DB/ibase.php
+@@ -707,9 +707,9 @@ class DB_ibase extends DB_common
+         $repeat = 0;
+         do {
+             $this->pushErrorHandling(PEAR_ERROR_RETURN);
+-            $result = $this->query("SELECT GEN_ID(${sqn}, 1) "
++            $result = $this->query("SELECT GEN_ID({$sqn}, 1) "
+                                    . 'FROM RDB$GENERATORS '
+-                                   . "WHERE RDB\$GENERATOR_NAME='${sqn}'");
++                                   . "WHERE RDB\$GENERATOR_NAME='{$sqn}'");
+             $this->popErrorHandling();
+             if ($ondemand && DB::isError($result)) {
+                 $repeat = 1;
+@@ -746,7 +746,7 @@ class DB_ibase extends DB_common
+     {
+         $sqn = strtoupper($this->getSequenceName($seq_name));
+         $this->pushErrorHandling(PEAR_ERROR_RETURN);
+-        $result = $this->query("CREATE GENERATOR ${sqn}");
++        $result = $this->query("CREATE GENERATOR {$sqn}");
+         $this->popErrorHandling();
+ 
+         return $result;
+--- DB/msql.php.orig	2021-08-11 00:23:52 UTC
++++ DB/msql.php
+@@ -443,7 +443,7 @@ class DB_msql extends DB_common
+         $repeat = false;
+         do {
+             $this->pushErrorHandling(PEAR_ERROR_RETURN);
+-            $result = $this->query("SELECT _seq FROM ${seqname}");
++            $result = $this->query("SELECT _seq FROM {$seqname}");
+             $this->popErrorHandling();
+             if ($ondemand && DB::isError($result) &&
+                 $result->getCode() == DB_ERROR_NOSUCHTABLE) {
+@@ -490,7 +490,7 @@ class DB_msql extends DB_common
+         if (DB::isError($res)) {
+             return $res;
+         }
+-        $res = $this->query("CREATE SEQUENCE ON ${seqname}");
++        $res = $this->query("CREATE SEQUENCE ON {$seqname}");
+         return $res;
+     }
+ 
+--- DB/mysql.php.orig	2021-08-11 00:23:52 UTC
++++ DB/mysql.php
+@@ -590,7 +592,7 @@ class DB_mysql extends DB_common
+         do {
+             $repeat = 0;
+             $this->pushErrorHandling(PEAR_ERROR_RETURN);
+-            $result = $this->query("UPDATE ${seqname} ".
++            $result = $this->query("UPDATE {$seqname} ".
+                                    'SET id=LAST_INSERT_ID(id+1)');
+             $this->popErrorHandling();
+             if ($result === DB_OK) {
+@@ -602,7 +604,7 @@ class DB_mysql extends DB_common
+                 // EMPTY SEQ TABLE
+                 // Sequence table must be empty for some reason, so fill
+                 // it and return 1 and obtain a user-level lock
+-                $result = $this->getOne("SELECT GET_LOCK('${seqname}_lock',10)");
++                $result = $this->getOne("SELECT GET_LOCK('{$seqname}_lock',10)");
+                 if (DB::isError($result)) {
+                     return $this->raiseError($result);
+                 }
+@@ -612,14 +614,14 @@ class DB_mysql extends DB_common
+                 }
+ 
+                 // add the default value
+-                $result = $this->query("REPLACE INTO ${seqname} (id) VALUES (0)");
++                $result = $this->query("REPLACE INTO {$seqname} (id) VALUES (0)");
+                 if (DB::isError($result)) {
+                     return $this->raiseError($result);
+                 }
+ 
+                 // Release the lock
+                 $result = $this->getOne('SELECT RELEASE_LOCK('
+-                                        . "'${seqname}_lock')");
++                                        . "'{$seqname}_lock')");
+                 if (DB::isError($result)) {
+                     return $this->raiseError($result);
+                 }
+@@ -676,12 +678,12 @@ class DB_mysql extends DB_common
+             return $res;
+         }
+         // insert yields value 1, nextId call will generate ID 2
+-        $res = $this->query("INSERT INTO ${seqname} (id) VALUES (0)");
++        $res = $this->query("INSERT INTO {$seqname} (id) VALUES (0)");
+         if (DB::isError($res)) {
+             return $res;
+         }
+         // so reset to zero
+-        return $this->query("UPDATE ${seqname} SET id = 0");
++        return $this->query("UPDATE {$seqname} SET id = 0");
+     }
+ 
+     // }}}
+@@ -720,7 +722,7 @@ class DB_mysql extends DB_common
+         // Obtain a user-level lock... this will release any previous
+         // application locks, but unlike LOCK TABLES, it does not abort
+         // the current transaction and is much less frequently used.
+-        $result = $this->getOne("SELECT GET_LOCK('${seqname}_lock',10)");
++        $result = $this->getOne("SELECT GET_LOCK('{$seqname}_lock',10)");
+         if (DB::isError($result)) {
+             return $result;
+         }
+@@ -730,7 +732,7 @@ class DB_mysql extends DB_common
+             return $this->mysqlRaiseError(DB_ERROR_NOT_LOCKED);
+         }
+ 
+-        $highest_id = $this->getOne("SELECT MAX(id) FROM ${seqname}");
++        $highest_id = $this->getOne("SELECT MAX(id) FROM {$seqname}");
+         if (DB::isError($highest_id)) {
+             return $highest_id;
+         }
+@@ -746,7 +748,7 @@ class DB_mysql extends DB_common
+         // If another thread has been waiting for this lock,
+         // it will go thru the above procedure, but will have no
+         // real effect
+-        $result = $this->getOne("SELECT RELEASE_LOCK('${seqname}_lock')");
++        $result = $this->getOne("SELECT RELEASE_LOCK('{$seqname}_lock')");
+         if (DB::isError($result)) {
+             return $result;
+         }
+--- DB/mysqli.php.orig	2021-08-11 00:23:52 UTC
++++ DB/mysqli.php
+@@ -684,7 +684,7 @@ class DB_mysqli extends DB_common
+                 // so fill it and return 1
+                 // Obtain a user-level lock
+                 $result = $this->getOne('SELECT GET_LOCK('
+-                                        . "'${seqname}_lock', 10)");
++                                        . "'{$seqname}_lock', 10)");
+                 if (DB::isError($result)) {
+                     return $this->raiseError($result);
+                 }
+@@ -701,7 +701,7 @@ class DB_mysqli extends DB_common
+ 
+                 // Release the lock
+                 $result = $this->getOne('SELECT RELEASE_LOCK('
+-                                        . "'${seqname}_lock')");
++                                        . "'{$seqname}_lock')");
+                 if (DB::isError($result)) {
+                     return $this->raiseError($result);
+                 }
+@@ -759,7 +759,7 @@ class DB_mysqli extends DB_common
+             return $res;
+         }
+         // insert yields value 1, nextId call will generate ID 2
+-        return $this->query("INSERT INTO ${seqname} (id) VALUES (0)");
++        return $this->query("INSERT INTO {$seqname} (id) VALUES (0)");
+     }
+ 
+     // }}}
+@@ -798,7 +798,7 @@ class DB_mysqli extends DB_common
+         // Obtain a user-level lock... this will release any previous
+         // application locks, but unlike LOCK TABLES, it does not abort
+         // the current transaction and is much less frequently used.
+-        $result = $this->getOne("SELECT GET_LOCK('${seqname}_lock',10)");
++        $result = $this->getOne("SELECT GET_LOCK('{$seqname}_lock',10)");
+         if (DB::isError($result)) {
+             return $result;
+         }
+@@ -808,7 +808,7 @@ class DB_mysqli extends DB_common
+             return $this->mysqliRaiseError(DB_ERROR_NOT_LOCKED);
+         }
+ 
+-        $highest_id = $this->getOne("SELECT MAX(id) FROM ${seqname}");
++        $highest_id = $this->getOne("SELECT MAX(id) FROM {$seqname}");
+         if (DB::isError($highest_id)) {
+             return $highest_id;
+         }
+@@ -825,7 +825,7 @@ class DB_mysqli extends DB_common
+         // If another thread has been waiting for this lock,
+         // it will go thru the above procedure, but will have no
+         // real effect
+-        $result = $this->getOne("SELECT RELEASE_LOCK('${seqname}_lock')");
++        $result = $this->getOne("SELECT RELEASE_LOCK('{$seqname}_lock')");
+         if (DB::isError($result)) {
+             return $result;
+         }
+--- DB/oci8.php.orig	2021-08-11 00:23:52 UTC
++++ DB/oci8.php
+@@ -249,7 +249,7 @@ class DB_oci8 extends DB_common
+                                                    $dsn['password'],
+                                                    $db,
+                                                    $char);
+-            $error = OCIError();
++            $error = oci_error();
+             if (!empty($error) && $error['code'] == 12541) {
+                 // Couldn't find TNS listener.  Try direct connection.
+                 $this->connection = @$connect_function($dsn['username'],
+@@ -270,7 +270,7 @@ class DB_oci8 extends DB_common
+         }
+ 
+         if (!$this->connection) {
+-            $error = OCIError();
++            $error = oci_error();
+             $error = (is_array($error)) ? $error['message'] : null;
+             return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                      null, null, null,
+@@ -289,11 +289,7 @@ class DB_oci8 extends DB_common
+      */
+     function disconnect()
+     {
+-        if (function_exists('oci_close')) {
+-            $ret = @oci_close($this->connection);
+-        } else {
+-            $ret = @OCILogOff($this->connection);
+-        }
++        $ret = @oci_close($this->connection);
+         $this->connection = null;
+         return $ret;
+     }
+@@ -320,14 +316,14 @@ class DB_oci8 extends DB_common
+         $this->last_parameters = array();
+         $this->last_query = $query;
+         $query = $this->modifyQuery($query);
+-        $result = @OCIParse($this->connection, $query);
++        $result = @oci_parse($this->connection, $query);
+         if (!$result) {
+             return $this->oci8RaiseError();
+         }
+         if ($this->autocommit) {
+-            $success = @OCIExecute($result,OCI_COMMIT_ON_SUCCESS);
++            $success = @oci_execute($result,OCI_COMMIT_ON_SUCCESS);
+         } else {
+-            $success = @OCIExecute($result,OCI_DEFAULT);
++            $success = @oci_execute($result,OCI_DEFAULT);
+         }
+         if (!$success) {
+             return $this->oci8RaiseError($result);
+@@ -336,7 +332,7 @@ class DB_oci8 extends DB_common
+         if ($this->_checkManip($query)) {
+             return DB_OK;
+         } else {
+-            @ocisetprefetch($result, $this->options['result_buffering']);
++            @oci_set_prefetch($result, $this->options['result_buffering']);
+             return $result;
+         }
+     }
+@@ -387,14 +383,14 @@ class DB_oci8 extends DB_common
+             return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+         }
+         if ($fetchmode & DB_FETCHMODE_ASSOC) {
+-            $moredata = @OCIFetchInto($result,$arr,OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS);
++            $moredata = @oci_fetch_array($result,$arr,OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS);
+             if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE &&
+                 $moredata)
+             {
+                 $arr = array_change_key_case($arr, CASE_LOWER);
+             }
+         } else {
+-            $moredata = OCIFetchInto($result,$arr,OCI_RETURN_NULLS+OCI_RETURN_LOBS);
++            $moredata = oci_fetch_array($result,$arr,OCI_RETURN_NULLS+OCI_RETURN_LOBS);
+         }
+         if (!$moredata) {
+             return null;
+@@ -426,7 +422,7 @@ class DB_oci8 extends DB_common
+      */
+     function freeResult($result)
+     {
+-        return is_resource($result) ? OCIFreeStatement($result) : false;
++        return is_resource($result) ? oci_free_statement($result) : false;
+     }
+ 
+     /**
+@@ -520,7 +516,7 @@ class DB_oci8 extends DB_common
+      */
+     function numCols($result)
+     {
+-        $cols = @OCINumCols($result);
++        $cols = @oci_num_fields($result);
+         if (!$cols) {
+             return $this->oci8RaiseError($result);
+         }
+@@ -592,7 +588,7 @@ class DB_oci8 extends DB_common
+ 
+         $this->last_query = $query;
+         $newquery = $this->modifyQuery($newquery);
+-        if (!$stmt = @OCIParse($this->connection, $newquery)) {
++        if (!$stmt = @oci_parse($this->connection, $newquery)) {
+             return $this->oci8RaiseError();
+         }
+         $this->prepare_types[(int)$stmt] = $types;
+@@ -664,7 +660,7 @@ class DB_oci8 extends DB_common
+                     $data[$key] = $this->quoteFloat($data[$key]);
+                 }
+             }
+-            if (!@OCIBindByName($stmt, ':bind' . $i, $data[$key], -1)) {
++            if (!@oci_bind_by_name($stmt, ':bind' . $i, $data[$key], -1)) {
+                 $tmp = $this->oci8RaiseError($stmt);
+                 return $tmp;
+             }
+@@ -673,9 +669,9 @@ class DB_oci8 extends DB_common
+             $i++;
+         }
+         if ($this->autocommit) {
+-            $success = @OCIExecute($stmt, OCI_COMMIT_ON_SUCCESS);
++            $success = @oci_execute($stmt, OCI_COMMIT_ON_SUCCESS);
+         } else {
+-            $success = @OCIExecute($stmt, OCI_DEFAULT);
++            $success = @oci_execute($stmt, OCI_DEFAULT);
+         }
+         if (!$success) {
+             $tmp = $this->oci8RaiseError($stmt);
+@@ -688,7 +684,7 @@ class DB_oci8 extends DB_common
+             $tmp = DB_OK;
+         } else {
+             $this->_last_query_manip = false;
+-            @ocisetprefetch($stmt, $this->options['result_buffering']);
++            @oci_set_prefetch($stmt, $this->options['result_buffering']);
+             $tmp = new DB_result($this, $stmt);
+         }
+         return $tmp;
+@@ -721,7 +717,7 @@ class DB_oci8 extends DB_common
+      */
+     function commit()
+     {
+-        $result = @OCICommit($this->connection);
++        $result = @oci_commit($this->connection);
+         if (!$result) {
+             return $this->oci8RaiseError();
+         }
+@@ -738,7 +734,7 @@ class DB_oci8 extends DB_common
+      */
+     function rollback()
+     {
+-        $result = @OCIRollback($this->connection);
++        $result = @oci_rollback($this->connection);
+         if (!$result) {
+             return $this->oci8RaiseError();
+         }
+@@ -760,7 +756,7 @@ class DB_oci8 extends DB_common
+         if ($this->last_stmt === false) {
+             return $this->oci8RaiseError();
+         }
+-        $result = @OCIRowCount($this->last_stmt);
++        $result = @oci_num_rows($this->last_stmt);
+         if ($result === false) {
+             return $this->oci8RaiseError($this->last_stmt);
+         }
+@@ -821,20 +817,20 @@ class DB_oci8 extends DB_common
+         } else {
+             $q_fields = "SELECT * FROM ($query) WHERE NULL = NULL";
+ 
+-            if (!$result = @OCIParse($this->connection, $q_fields)) {
++            if (!$result = @oci_parse($this->connection, $q_fields)) {
+                 $this->last_query = $q_fields;
+                 return $this->oci8RaiseError();
+             }
+-            if (!@OCIExecute($result, OCI_DEFAULT)) {
++            if (!@oci_execute($result, OCI_DEFAULT)) {
+                 $this->last_query = $q_fields;
+                 return $this->oci8RaiseError($result);
+             }
+         }
+ 
+-        $ncols = OCINumCols($result);
++        $ncols = oci_num_fields($result);
+         $cols  = array();
+         for ( $i = 1; $i <= $ncols; $i++ ) {
+-            $cols[] = '"' . OCIColumnName($result, $i) . '"';
++            $cols[] = '"' . oci_field_name($result, $i) . '"';
+         }
+         $fields = implode(', ', $cols);
+         // XXX Test that (tip by John Lim)
+@@ -877,7 +873,7 @@ class DB_oci8 extends DB_common
+         $repeat = 0;
+         do {
+             $this->expectError(DB_ERROR_NOSUCHTABLE);
+-            $result = $this->query("SELECT ${seqname}.nextval FROM dual");
++            $result = $this->query("SELECT {$seqname}.nextval FROM dual");
+             $this->popExpect();
+             if ($ondemand && DB::isError($result) &&
+                 $result->getCode() == DB_ERROR_NOSUCHTABLE) {
+@@ -950,11 +946,11 @@ class DB_oci8 extends DB_common
+     function oci8RaiseError($errno = null)
+     {
+         if ($errno === null) {
+-            $error = @OCIError($this->connection);
++            $error = @oci_error($this->connection);
+             return $this->raiseError($this->errorCode($error['code']),
+                                      null, null, null, $error['message']);
+         } elseif (is_resource($errno)) {
+-            $error = @OCIError($errno);
++            $error = @oci_error($errno);
+             return $this->raiseError($this->errorCode($error['code']),
+                                      null, null, null, $error['message']);
+         }
+@@ -973,9 +969,9 @@ class DB_oci8 extends DB_common
+     function errorNative()
+     {
+         if (is_resource($this->last_stmt)) {
+-            $error = @OCIError($this->last_stmt);
++            $error = @oci_error($this->last_stmt);
+         } else {
+-            $error = @OCIError($this->connection);
++            $error = @oci_error($this->connection);
+         }
+         if (is_array($error)) {
+             return $error['code'];
+@@ -1029,21 +1025,21 @@ class DB_oci8 extends DB_common
+ 
+             $this->last_query = $q_fields;
+ 
+-            if (!$stmt = @OCIParse($this->connection, $q_fields)) {
++            if (!$stmt = @oci_parse($this->connection, $q_fields)) {
+                 return $this->oci8RaiseError(DB_ERROR_NEED_MORE_DATA);
+             }
+-            if (!@OCIExecute($stmt, OCI_DEFAULT)) {
++            if (!@oci_execute($stmt, OCI_DEFAULT)) {
+                 return $this->oci8RaiseError($stmt);
+             }
+             
+             $i = 0;
+-            while (@OCIFetch($stmt)) {
++            while (@oci_fetch($stmt)) {
+                 $res[$i] = array(
+                     'table' => $case_func($result),
+-                    'name'  => $case_func(@OCIResult($stmt, 1)),
+-                    'type'  => @OCIResult($stmt, 2),
+-                    'len'   => @OCIResult($stmt, 3),
+-                    'flags' => (@OCIResult($stmt, 4) == 'N') ? 'not_null' : '',
++                    'name'  => $case_func(@oci_result($stmt, 1)),
++                    'type'  => @oci_result($stmt, 2),
++                    'len'   => @oci_result($stmt, 3),
++                    'flags' => (@oci_result($stmt, 4) == 'N') ? 'not_null' : '',
+                 );
+                 if ($mode & DB_TABLEINFO_ORDER) {
+                     $res['order'][$res[$i]['name']] = $i;
+@@ -1057,7 +1053,7 @@ class DB_oci8 extends DB_common
+             if ($mode) {
+                 $res['num_fields'] = $i;
+             }
+-            @OCIFreeStatement($stmt);
++            @oci_free_statement($stmt);
+ 
+         } else {
+             if (isset($result->result)) {
+@@ -1071,16 +1067,16 @@ class DB_oci8 extends DB_common
+             $res = array();
+ 
+             if ($result === $this->last_stmt) {
+-                $count = @OCINumCols($result);
++                $count = @oci_num_fields($result);
+                 if ($mode) {
+                     $res['num_fields'] = $count;
+                 }
+                 for ($i = 0; $i < $count; $i++) {
+                     $res[$i] = array(
+                         'table' => '',
+-                        'name'  => $case_func(@OCIColumnName($result, $i+1)),
+-                        'type'  => @OCIColumnType($result, $i+1),
+-                        'len'   => @OCIColumnSize($result, $i+1),
++                        'name'  => $case_func(@oci_field_name($result, $i+1)),
++                        'type'  => @oci_field_type($result, $i+1),
++                        'len'   => @oci_field_size($result, $i+1),
+                         'flags' => '',
+                     );
+                     if ($mode & DB_TABLEINFO_ORDER) {
+--- DB/odbc.php.orig	2021-08-11 00:23:52 UTC
++++ DB/odbc.php
+@@ -331,7 +331,7 @@ class DB_odbc extends DB_common
+             return null;
+         }
+         if ($fetchmode !== DB_FETCHMODE_ORDERED) {
+-            for ($i = 0; $i < count($arr); $i++) {
++            for ($i = 0, $iMax = count($arr); $i < $iMax; $i++) {
+                 $colName = @odbc_field_name($result, $i+1);
+                 $a[$colName] = $arr[$i];
+             }
+@@ -502,7 +502,7 @@ class DB_odbc extends DB_common
+         $repeat = 0;
+         do {
+             $this->pushErrorHandling(PEAR_ERROR_RETURN);
+-            $result = $this->query("update ${seqname} set id = id + 1");
++            $result = $this->query("update {$seqname} set id = id + 1");
+             $this->popErrorHandling();
+             if ($ondemand && DB::isError($result) &&
+                 $result->getCode() == DB_ERROR_NOSUCHTABLE) {
+@@ -513,7 +513,7 @@ class DB_odbc extends DB_common
+                 if (DB::isError($result)) {
+                     return $this->raiseError($result);
+                 }
+-                $result = $this->query("insert into ${seqname} (id) values(0)");
++                $result = $this->query("insert into {$seqname} (id) values(0)");
+             } else {
+                 $repeat = 0;
+             }
+@@ -523,7 +523,7 @@ class DB_odbc extends DB_common
+             return $this->raiseError($result);
+         }
+ 
+-        $result = $this->query("select id from ${seqname}");
++        $result = $this->query("select id from {$seqname}");
+         if (DB::isError($result)) {
+             return $result;
+         }
+--- DB/pgsql.php.orig	2021-08-11 00:23:52 UTC
++++ DB/pgsql.php
+@@ -460,7 +460,7 @@ class DB_pgsql extends DB_common
+             unset($this->row[(int)$result]);
+             unset($this->_num_rows[(int)$result]);
+             $this->affected = 0;
+-            return @pg_freeresult($result);
++            return @pg_free_result($result);
+         }
+         return false;
+     }
+@@ -534,7 +534,7 @@ class DB_pgsql extends DB_common
+      */
+     function numCols($result)
+     {
+-        $cols = @pg_numfields($result);
++        $cols = @pg_num_fields($result);
+         if (!$cols) {
+             return $this->pgsqlRaiseError();
+         }
+@@ -559,7 +559,7 @@ class DB_pgsql extends DB_common
+      */
+     function numRows($result)
+     {
+-        $rows = @pg_numrows($result);
++        $rows = @pg_num_rows($result);
+         if ($rows === null) {
+             return $this->pgsqlRaiseError();
+         }
+@@ -664,7 +664,7 @@ class DB_pgsql extends DB_common
+         $repeat = false;
+         do {
+             $this->pushErrorHandling(PEAR_ERROR_RETURN);
+-            $result = $this->query("SELECT NEXTVAL('${seqname}')");
++            $result = $this->query("SELECT NEXTVAL('{$seqname}')");
+             $this->popErrorHandling();
+             if ($ondemand && DB::isError($result) &&
+                 $result->getCode() == DB_ERROR_NOSUCHTABLE) {
+@@ -703,7 +703,7 @@ class DB_pgsql extends DB_common
+     function createSequence($seq_name)
+     {
+         $seqname = $this->getSequenceName($seq_name);
+-        $result = $this->query("CREATE SEQUENCE ${seqname}");
++        $result = $this->query("CREATE SEQUENCE {$seqname}");
+         return $result;
+     }
+ 
+@@ -791,7 +791,7 @@ class DB_pgsql extends DB_common
+      */
+     function errorNative()
+     {
+-        return @pg_errormessage($this->connection);
++        return @pg_last_error($this->connection);
+     }
+ 
+     // }}}
+@@ -916,7 +916,7 @@ class DB_pgsql extends DB_common
+             $case_func = 'strval';
+         }
+ 
+-        $count = @pg_numfields($id);
++        $count = @pg_num_fields($id);
+         $res   = array();
+ 
+         if ($mode) {
+@@ -926,9 +926,9 @@ class DB_pgsql extends DB_common
+         for ($i = 0; $i < $count; $i++) {
+             $res[$i] = array(
+                 'table' => $got_string ? $case_func($result) : '',
+-                'name'  => $case_func(@pg_fieldname($id, $i)),
+-                'type'  => @pg_fieldtype($id, $i),
+-                'len'   => @pg_fieldsize($id, $i),
++                'name'  => $case_func(@pg_field_name($id, $i)),
++                'type'  => @pg_field_type($id, $i),
++                'len'   => @pg_field_size($id, $i),
+                 'flags' => $got_string
+                            ? $this->_pgFieldFlags($id, $i, $result)
+                            : '',
+@@ -943,7 +943,7 @@ class DB_pgsql extends DB_common
+ 
+         // free the result only if we were called on a table
+         if ($got_string) {
+-            @pg_freeresult($id);
++            @pg_free_result($id);
+         }
+         return $res;
+     }
+@@ -967,7 +967,7 @@ class DB_pgsql extends DB_common
+      */
+     function _pgFieldFlags($resource, $num_field, $table_name)
+     {
+-        $field_name = @pg_fieldname($resource, $num_field);
++        $field_name = @pg_field_name($resource, $num_field);
+ 
+         // Check if there's a schema in $table_name and update things
+         // accordingly.
+@@ -986,7 +986,7 @@ class DB_pgsql extends DB_common
+                                 AND typ.typrelid = f.attrelid
+                                 AND f.attname = '$field_name'
+                                 AND $tableWhere");
+-        if (@pg_numrows($result) > 0) {
++        if (@pg_num_rows($result) > 0) {
+             $row = @pg_fetch_row($result, 0);
+             $flags  = ($row[0] == 't') ? 'not_null ' : '';
+ 
+@@ -1010,7 +1010,7 @@ class DB_pgsql extends DB_common
+                                 AND f.attrelid = i.indrelid
+                                 AND f.attname = '$field_name'
+                                 AND $tableWhere");
+-        $count = @pg_numrows($result);
++        $count = @pg_num_rows($result);
+ 
+         for ($i = 0; $i < $count ; $i++) {
+             $row = @pg_fetch_row($result, $i);
+--- DB/sqlite.php.orig	2021-08-11 00:23:52 UTC
++++ DB/sqlite.php
+@@ -517,7 +517,7 @@ class DB_sqlite extends DB_common
+         if (DB::isError($result)) {
+             return($result);
+         }
+-        $query   = "CREATE TRIGGER ${seqname}_cleanup AFTER INSERT ON $seqname
++        $query   = "CREATE TRIGGER {$seqname}_cleanup AFTER INSERT ON $seqname
+                     BEGIN
+                         DELETE FROM $seqname WHERE id<LAST_INSERT_ROWID();
+                     END ";



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202311271221.3ARCLoXq094234>