@ does not work. (and editing NEWS is much nicer anyway)
    
    --Jani
    
    

On Tue, 22 Jul 2003, Marcus Boerger wrote:

>helly          Tue Jul 22 19:05:17 2003 EDT
>
>  Modified files:              
>    /php-src/ext/pgsql config.m4 php_pgsql.h pgsql.c 
>  Log:
>  Added pg_version() which returns an associative array of client/protocol/server
>  version.
>  @Added pg_version() function. (Marcus)
>  
>  
>Index: php-src/ext/pgsql/config.m4
>diff -u php-src/ext/pgsql/config.m4:1.34 php-src/ext/pgsql/config.m4:1.35
>--- php-src/ext/pgsql/config.m4:1.34   Wed Jun 26 09:07:40 2002
>+++ php-src/ext/pgsql/config.m4        Tue Jul 22 19:05:17 2003
>@@ -1,5 +1,5 @@
> dnl
>-dnl $Id: config.m4,v 1.34 2002/06/26 13:07:40 derick Exp $
>+dnl $Id: config.m4,v 1.35 2003/07/22 23:05:17 helly Exp $
> dnl
> 
> AC_DEFUN(PHP_PGSQL_CHECK_FUNCTIONS,[
>@@ -57,6 +57,8 @@
>   AC_CHECK_LIB(pq, PQcmdTuples,AC_DEFINE(HAVE_PQCMDTUPLES,1,[Broken libpq under 
> windows]))
>   AC_CHECK_LIB(pq, PQoidValue,AC_DEFINE(HAVE_PQOIDVALUE,1,[Older PostgreSQL]))
>   AC_CHECK_LIB(pq, PQclientEncoding,AC_DEFINE(HAVE_PQCLIENTENCODING,1,[PostgreSQL 
> 7.0.x or later]))
>+  AC_CHECK_LIB(pq, PQparameterStatus,AC_DEFINE(HAVE_PQPARAMETERSTATUS,1,[PostgreSQL 
>7.4 or later]))
>+  AC_CHECK_LIB(pq, PQprotocolVersion,AC_DEFINE(HAVE_PQPROTOCOLVERSION,1,[PostgreSQL 
>7.4 or later]))
>   AC_CHECK_LIB(pq, 
> pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[Whether libpq is 
> compiled with --enable-multibye]))
>   LIBS=$old_LIBS
>   LDFLAGS=$old_LDFLAGS
>Index: php-src/ext/pgsql/php_pgsql.h
>diff -u php-src/ext/pgsql/php_pgsql.h:1.62 php-src/ext/pgsql/php_pgsql.h:1.63
>--- php-src/ext/pgsql/php_pgsql.h:1.62 Tue Jun 10 16:03:35 2003
>+++ php-src/ext/pgsql/php_pgsql.h      Tue Jul 22 19:05:17 2003
>@@ -17,7 +17,7 @@
>    +----------------------------------------------------------------------+
>  */
>  
>-/* $Id: php_pgsql.h,v 1.62 2003/06/10 20:03:35 imajes Exp $ */
>+/* $Id: php_pgsql.h,v 1.63 2003/07/22 23:05:17 helly Exp $ */
> 
> #ifndef PHP_PGSQL_H
> #define PHP_PGSQL_H
>@@ -71,6 +71,7 @@
> PHP_FUNCTION(pg_port);
> PHP_FUNCTION(pg_tty);
> PHP_FUNCTION(pg_options);
>+PHP_FUNCTION(pg_version);
> PHP_FUNCTION(pg_ping);
> /* query functions */
> PHP_FUNCTION(pg_query);
>Index: php-src/ext/pgsql/pgsql.c
>diff -u php-src/ext/pgsql/pgsql.c:1.283 php-src/ext/pgsql/pgsql.c:1.284
>--- php-src/ext/pgsql/pgsql.c:1.283    Tue Jul 22 18:05:46 2003
>+++ php-src/ext/pgsql/pgsql.c  Tue Jul 22 19:05:17 2003
>@@ -19,7 +19,7 @@
>    +----------------------------------------------------------------------+
>  */
>  
>-/* $Id: pgsql.c,v 1.283 2003/07/22 22:05:46 helly Exp $ */
>+/* $Id: pgsql.c,v 1.284 2003/07/22 23:05:17 helly Exp $ */
> 
> #include <stdlib.h>
> 
>@@ -88,6 +88,7 @@
>       PHP_FE(pg_port,                 NULL)
>       PHP_FE(pg_tty,                  NULL)
>       PHP_FE(pg_options,              NULL)
>+      PHP_FE(pg_version,              NULL)
>       PHP_FE(pg_ping,                 NULL)
>       /* query functions */
>       PHP_FE(pg_query,                NULL)
>@@ -782,6 +783,7 @@
> #define PHP_PG_PORT 4
> #define PHP_PG_TTY 5
> #define PHP_PG_HOST 6
>+#define PHP_PG_VERSION 7
> 
> /* {{{ php_pgsql_get_link_info
>  */
>@@ -831,6 +833,18 @@
>               case PHP_PG_HOST:
>                       Z_STRVAL_P(return_value) = PQhost(pgsql);
>                       break;
>+              case PHP_PG_VERSION:
>+                      array_init(return_value);
>+                      add_assoc_string(return_value, "client", PG_VERSION, 1);
>+#if HAVE_PQPROTOCOLVERSION
>+                      add_assoc_long(return_value, "protocol", 
>PQprotocolVersion(pgsql));
>+#if HAVE_PQPARAMETERSTATUS
>+                      if (PQprotocolVersion(pgsql) >= 3) {
>+                              add_assoc_string(return_value, "server", 
>PQparameterStatus(pgsql, "server_version"), 1);
>+                      }
>+#endif
>+#endif
>+                      return;
>               default:
>                       RETURN_FALSE;
>       }
>@@ -890,6 +904,14 @@
> PHP_FUNCTION(pg_host)
> {
>       php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_HOST);
>+}
>+/* }}} */
>+
>+/* {{{ proto array pg_version([resource connection])
>+   Returns an array with client, protocol and server version (when available) */
>+PHP_FUNCTION(pg_version)
>+{
>+      php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_VERSION);
> }
> /* }}} */
> 
>
>
>
>

-- 
https://www.paypal.com/xclick/[EMAIL PROTECTED]&no_note=1&tax=0&currency_code=EUR
 


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to