yohgaki Thu Oct 17 19:41:34 2002 EDT
Modified files:
/php4/ext/pgsql README pgsql.c php_pgsql.h
Log:
Added pg_get_pid()
Index: php4/ext/pgsql/README
diff -u php4/ext/pgsql/README:1.8 php4/ext/pgsql/README:1.9
--- php4/ext/pgsql/README:1.8 Sun Apr 7 21:50:06 2002
+++ php4/ext/pgsql/README Thu Oct 17 19:41:34 2002
@@ -43,14 +43,13 @@
somewhere in your system to build PHP with PostgreSQL support.
==== Note For PostgreSQL 7.2 ====
-I've tested upto 7.2.1.
+I've tested upto 7.2.2.
==== TODO List ===
Make pg_convert() smater.
- Better regex
- User defiend type support
Support async connection.
-Support async notification.
==== Experimental Functions =====
@@ -217,6 +216,19 @@
Select records that has ids (id=>value)
--------------------------------------------------------------------
+array pg_get_notify([resource db[, notify]])
+ Get notify message on the connection
+
+--------------------------------------------------------------------
+string pg_unescape_bytea(string bytea_data)
+ Unescape bytea field data
+
+--------------------------------------------------------------------
+bool pg_ping(resource db)
+ ping database connection and try to reset connection if it's
+ broken
+
+-------------------------------------------------------------------
Again, experimental functions are subject to be changed without
notice.
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.236 php4/ext/pgsql/pgsql.c:1.237
--- php4/ext/pgsql/pgsql.c:1.236 Thu Oct 17 03:58:46 2002
+++ php4/ext/pgsql/pgsql.c Thu Oct 17 19:41:34 2002
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql.c,v 1.236 2002/10/17 07:58:46 yohgaki Exp $ */
+/* $Id: pgsql.c,v 1.237 2002/10/17 23:41:34 yohgaki Exp $ */
#include <stdlib.h>
@@ -116,6 +116,7 @@
PHP_FE(pg_field_is_null,NULL)
/* async message function */
PHP_FE(pg_get_notify, NULL)
+ PHP_FE(pg_get_pid, NULL)
/* error message functions */
PHP_FE(pg_result_error, NULL)
PHP_FE(pg_last_error, NULL)
@@ -3015,9 +3016,7 @@
zval *pgsql_link;
int id = -1, result_type = PGSQL_ASSOC;
PGconn *pgsql;
- PGresult *pgsql_result;
PGnotify *pgsql_notify;
- pgsql_result_handle *pg_result;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS()
TSRMLS_CC, "r|l",
&pgsql_link) ==
FAILURE) {
@@ -3044,6 +3043,24 @@
}
/* }}} */
+/* {{{ proto resource pg_get_pid([resource connection)
+ Get backend(server) pid */
+PHP_FUNCTION(pg_get_pid)
+{
+ zval *pgsql_link;
+ int id = -1, pid;
+ PGconn *pgsql;
+
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS()
+TSRMLS_CC, "r",
+ &pgsql_link) ==
+FAILURE) {
+ RETURN_FALSE;
+ }
+
+ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link",
+le_link, le_plink);
+
+ RETURN_LONG(PQbackendPID(pgsql));
+}
+/* }}} */
/* {{{ php_pgsql_meta_data
* TODO: Add meta_data cache for better performance
Index: php4/ext/pgsql/php_pgsql.h
diff -u php4/ext/pgsql/php_pgsql.h:1.55 php4/ext/pgsql/php_pgsql.h:1.56
--- php4/ext/pgsql/php_pgsql.h:1.55 Thu Oct 17 03:58:46 2002
+++ php4/ext/pgsql/php_pgsql.h Thu Oct 17 19:41:34 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pgsql.h,v 1.55 2002/10/17 07:58:46 yohgaki Exp $ */
+/* $Id: php_pgsql.h,v 1.56 2002/10/17 23:41:34 yohgaki Exp $ */
#ifndef PHP_PGSQL_H
#define PHP_PGSQL_H
@@ -99,6 +99,7 @@
PHP_FUNCTION(pg_field_is_null);
/* async message functions */
PHP_FUNCTION(pg_get_notify);
+PHP_FUNCTION(pg_get_pid);
/* error message functions */
PHP_FUNCTION(pg_result_error);
PHP_FUNCTION(pg_last_error);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php