[PHP-DEV] CVS update: php3/functions From: steffann (php-dev <email protected>)
Date: 04/24/99

Date: Saturday April 24, 1999 @ 21:29
Author: steffann

Update of /repository/php3/functions
In directory php:/tmp/cvs-serv17735/functions

Modified Files:
        pgsql.c php3_pgsql.h
Log Message:
The pgsql module now shows some info in phpinfo()

Index: php3/functions/pgsql.c
diff -u php3/functions/pgsql.c:1.81 php3/functions/pgsql.c:1.82
--- php3/functions/pgsql.c:1.81 Mon Jan 4 02:38:15 1999
+++ php3/functions/pgsql.c Sat Apr 24 21:29:22 1999
@@ -28,7 +28,7 @@
    +----------------------------------------------------------------------+
  */
  
-/* $Id: pgsql.c,v 1.81 1999/01/04 07:38:15 jah Exp $ */
+/* $Id: pgsql.c,v 1.82 1999/04/25 01:29:22 steffann Exp $ */
 
 #include <stdlib.h>
 
@@ -40,6 +40,10 @@
 #include "php3_pgsql.h"
 #include "php3_string.h"
 
+#if !(WIN32|WINNT)
+#include "build-defs.h"
+#endif
+
 #if HAVE_PGSQL
 
 #include "php3_list.h"
@@ -82,7 +86,7 @@
 };
 
 php3_module_entry pgsql_module_entry = {
- "PostgreSQL", pgsql_functions, php3_minit_pgsql, NULL, php3_rinit_pgsql, NULL, NULL, STANDARD_MODULE_PROPERTIES
+ "PostgreSQL", pgsql_functions, php3_minit_pgsql, NULL, php3_rinit_pgsql, NULL, php3_info_pgsql, STANDARD_MODULE_PROPERTIES
 };
 
 #if COMPILE_DL
@@ -1484,7 +1488,48 @@
         }
 }
 /* }}} */
-
+
+
+/* {{{ proto void php3_info_pgsql(void)
+ Show info about the pgsql module */
+void php3_info_pgsql(void)
+{
+ char maxp[16],maxl[16];
+
+ if (php3_pgsql_module.max_persistent==-1) {
+ strcpy(maxp,"Unlimited");
+ } else {
+ snprintf(maxp,15,"%ld",php3_pgsql_module.max_persistent);
+ maxp[15]=0;
+ }
+ if (php3_pgsql_module.max_links==-1) {
+ strcpy(maxl,"Unlimited");
+ } else {
+ snprintf(maxl,15,"%ld",php3_pgsql_module.max_links);
+ maxl[15]=0;
+ }
+ php3_printf("<table cellpadding=5>"
+ "<tr><td>Allow persistent links:</td><td>%s</td></tr>\n"
+ "<tr><td>Persistent links:</td><td>%d/%s</td></tr>\n"
+ "<tr><td>Total links:</td><td>%d/%s</td></tr>\n"
+#if !(WIN32|WINNT)
+ "<tr><td valign=\"top\">Compilation definitions:</td><td>"
+ "<tt>PGSQL_INCLUDE=%s<br>\n"
+ "PGSQL_LFLAGS=%s<br>\n"
+ "PGSQL_LIBS=%s<br></tt></td></tr>"
+#endif
+ "</table>\n",
+ (php3_pgsql_module.allow_persistent?"Yes":"No"),
+ php3_pgsql_module.num_persistent,maxp,
+ php3_pgsql_module.num_links,maxl
+#if !(WIN32|WINNT)
+ ,PHP_PGSQL_INCLUDE,PHP_PGSQL_LFLAGS,PHP_PGSQL_LIBS
+#endif
+ );
+}
+/* }}} */
+
+
 #endif
 
 /*
Index: php3/functions/php3_pgsql.h
diff -u php3/functions/php3_pgsql.h:1.19 php3/functions/php3_pgsql.h:1.20
--- php3/functions/php3_pgsql.h:1.19 Fri Jan 1 12:59:16 1999
+++ php3/functions/php3_pgsql.h Sat Apr 24 21:29:22 1999
@@ -27,7 +27,7 @@
    +----------------------------------------------------------------------+
  */
  
-/* $Id: php3_pgsql.h,v 1.19 1999/01/01 17:59:16 zeev Exp $ */
+/* $Id: php3_pgsql.h,v 1.20 1999/04/25 01:29:22 steffann Exp $ */
 
 #ifndef _PHP3_PGSQL_H
 #define _PHP3_PGSQL_H
@@ -48,6 +48,7 @@
 
 extern int php3_minit_pgsql(INIT_FUNC_ARGS);
 extern int php3_rinit_pgsql(INIT_FUNC_ARGS);
+extern void php3_info_pgsql(void);
 extern void php3_pgsql_connect(INTERNAL_FUNCTION_PARAMETERS);
 extern void php3_pgsql_pconnect(INTERNAL_FUNCTION_PARAMETERS);
 extern void php3_pgsql_close(INTERNAL_FUNCTION_PARAMETERS);

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>