cvs: php4 /ext/pgsql/ pgsql.c php_pgsql.h
[email protected] ("Jouni Ahto")
| Newsgroups | php.version4 |
|---|---|
| Message-ID | <cvsjah959150884@cvsserver> |
jah Wed May 24 08:48:04 2000 EDT
Modified files:
/php4/ext/pgsql pgsql.c php_pgsql.h
Log:
Added PostgreSQL module info function.
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.49 php4/ext/pgsql/pgsql.c:1.50
--- php4/ext/pgsql/pgsql.c:1.49 Wed May 24 00:20:36 2000
+++ php4/ext/pgsql/pgsql.c Wed May 24 08:48:04 2000
@@ -13,11 +13,11 @@
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Zeev Suraski <[email protected]> |
- | Jouni Ahto <[email protected]> (large object interface) |
+ | Jouni Ahto <[email protected]> (large object interface) |
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql.c,v 1.49 2000/05/23 22:20:36 hholzgra Exp $ */
+/* $Id: pgsql.c,v 1.50 2000/05/24 06:48:04 jah Exp $ */
#include <stdlib.h>
@@ -78,7 +78,14 @@
};
zend_module_entry pgsql_module_entry = {
- "pgsql", pgsql_functions, PHP_MINIT(pgsql), PHP_MSHUTDOWN(pgsql), PHP_RINIT(pgsql), NULL, NULL, STANDARD_MODULE_PROPERTIES
+ "pgsql",
+ pgsql_functions,
+ PHP_MINIT(pgsql),
+ PHP_MSHUTDOWN(pgsql),
+ PHP_RINIT(pgsql),
+ NULL,
+ PHP_MINFO(pgsql),
+ STANDARD_MODULE_PROPERTIES
};
#ifdef COMPILE_DL_PGSQL
@@ -178,6 +185,22 @@
}
+PHP_MINFO_FUNCTION(pgsql)
+{
+ char buf[32];
+ PGLS_FETCH();
+
+ php_info_print_table_start();
+ php_info_print_table_header(2, "PostgreSQL Support", "enabled");
+ sprintf(buf, "%ld", PGG(num_persistent));
+ php_info_print_table_row(2, "Active Persistent Links", buf);
+ sprintf(buf, "%ld", PGG(num_links));
+ php_info_print_table_row(2, "Active Links", buf);
+ php_info_print_table_end();
+
+ DISPLAY_INI_ENTRIES();
+
+}
void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
{
char *host=NULL,*port=NULL,*options=NULL,*tty=NULL,*dbname=NULL,*connstring=NULL;
Index: php4/ext/pgsql/php_pgsql.h
diff -u php4/ext/pgsql/php_pgsql.h:1.9 php4/ext/pgsql/php_pgsql.h:1.10
--- php4/ext/pgsql/php_pgsql.h:1.9 Tue May 23 08:03:34 2000
+++ php4/ext/pgsql/php_pgsql.h Wed May 24 08:48:04 2000
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pgsql.h,v 1.9 2000/05/23 06:03:34 jah Exp $ */
+/* $Id: php_pgsql.h,v 1.10 2000/05/24 06:48:04 jah Exp $ */
#ifndef _PHP_PGSQL_H
#define _PHP_PGSQL_H
@@ -63,6 +63,7 @@
PHP_MINIT_FUNCTION(pgsql);
PHP_MSHUTDOWN_FUNCTION(pgsql);
PHP_RINIT_FUNCTION(pgsql);
+PHP_MINFO_FUNCTION(pgsql);
PHP_FUNCTION(pg_connect);
PHP_FUNCTION(pg_pconnect);
PHP_FUNCTION(pg_close);