cvs: php4 /ext/pgsql php_pgsql.h /ext/pgsql/tests notice.inc
| From: | Yasuo Ohgaki | Date: | Sat, 06 Apr 2002 06:42:02 +0000 |
| Subject: | cvs: php4 /ext/pgsql php_pgsql.h /ext/pgsql/tests notice.inc | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-10918@lists.php.net to get a copy of this message | ||
yohgaki Sat Apr 6 01:42:02 2002 EDT
Modified files:
/php4/ext/pgsql php_pgsql.h
/php4/ext/pgsql/tests notice.inc
Log:
Chages for new pg_last_notice()
Index: php4/ext/pgsql/php_pgsql.h
diff -u php4/ext/pgsql/php_pgsql.h:1.40 php4/ext/pgsql/php_pgsql.h:1.41
--- php4/ext/pgsql/php_pgsql.h:1.40 Sat Mar 30 20:18:32 2002
+++ php4/ext/pgsql/php_pgsql.h Sat Apr 6 01:42:00 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pgsql.h,v 1.40 2002/03/31 01:18:32 yohgaki Exp $ */
+/* $Id: php_pgsql.h,v 1.41 2002/04/06 06:42:00 yohgaki Exp $ */
#ifndef PHP_PGSQL_H
#define PHP_PGSQL_H
@@ -141,6 +141,11 @@
int row;
} pgsql_result_handle;
+typedef struct _php_pgsql_notice {
+ char *message;
+ size_t len;
+} php_pgsql_notice;
+
typedef struct {
long default_link;
long num_links,num_persistent;
@@ -148,9 +153,8 @@
long allow_persistent;
long auto_reset_persistent;
int le_lofp,le_string;
- int ignore_notices;
- char *last_notice;
- uint last_notice_len;
+ int ignore_notices,log_notices;
+ HashTable notices;
} php_pgsql_globals;
Index: php4/ext/pgsql/tests/notice.inc
diff -u php4/ext/pgsql/tests/notice.inc:1.1 php4/ext/pgsql/tests/notice.inc:1.2
--- php4/ext/pgsql/tests/notice.inc:1.1 Fri Apr 5 01:30:18 2002
+++ php4/ext/pgsql/tests/notice.inc Sat Apr 6 01:42:02 2002
@@ -1,11 +1,17 @@
<?php
include 'config.inc';
+ini_set('pgsql.log_notice',1);
+
$db = pg_connect($conn_str);
pg_query($db, "BEGIN;");
pg_query($db, "BEGIN;");
$msg = pg_last_notice($db);
+if ($msg === FALSE) {
+ echo "Cannot find notice message in hash\n";
+ var_dump($msg);
+}
echo $msg;
echo "pg_last_notice() is Ok\n";