]> granicus.if.org Git - php/commitdiff
Added PostgreSQL module info function.
authorJouni Ahto <jah@php.net>
Wed, 24 May 2000 06:48:04 +0000 (06:48 +0000)
committerJouni Ahto <jah@php.net>
Wed, 24 May 2000 06:48:04 +0000 (06:48 +0000)
ext/pgsql/pgsql.c
ext/pgsql/php_pgsql.h

index 41e3f8afc64e381dda74456d55c25e89c4f006cc..977b4c00d38944c1b7e4eea3ba4a8010c5c8b76a 100644 (file)
@@ -13,7 +13,7 @@
    | license@php.net so we can mail you a copy immediately.               |
    +----------------------------------------------------------------------+
    | Authors: Zeev Suraski <zeev@zend.com>                                |
-   |          Jouni Ahto <jah@cultnet.fi> (large object interface)        |
+   |          Jouni Ahto <jah@mork.net> (large object interface)          |
    +----------------------------------------------------------------------+
  */
  
@@ -78,7 +78,14 @@ function_entry pgsql_functions[] = {
 };
 
 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_RINIT_FUNCTION(pgsql)
 }
 
 
+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 559a0249fe36ef689f38a7663d6fc2dbd01bc58f..ac8a35394ac000eb02ed0cea6a84a50e1fc98839 100644 (file)
@@ -63,6 +63,7 @@ extern zend_module_entry pgsql_module_entry;
 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);