From b906cb1bc2371fa0b3e52e0bd21ef6734db73d9a Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Fri, 30 Mar 2012 09:45:33 +0900 Subject: [PATCH 1/3] Implement Request #47570 libpq's PG_VERSION should be exported to userland --- ext/pgsql/pgsql.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index d8127af8c107b..54a86a827610c 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -934,6 +934,11 @@ PHP_MINIT_FUNCTION(pgsql) le_result = zend_register_list_destructors_ex(_free_result, NULL, "pgsql result", module_number); le_lofp = zend_register_list_destructors_ex(_free_ptr, NULL, "pgsql large object", module_number); le_string = zend_register_list_destructors_ex(_free_ptr, NULL, "pgsql string", module_number); +#if HAVE_PG_CONFIG_H + /* PG_VERSION - libpq version */ + REGISTER_STRING_CONSTANT("PGSQL_LIBPQ_VERSION", PG_VERSION, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("PGSQL_LIBPQ_VERSION_STR", PG_VERSION_STR, CONST_CS | CONST_PERSISTENT); +#endif /* For connection option */ REGISTER_LONG_CONSTANT("PGSQL_CONNECT_FORCE_NEW", PGSQL_CONNECT_FORCE_NEW, CONST_CS | CONST_PERSISTENT); /* For pg_fetch_array() */ @@ -1048,6 +1053,7 @@ PHP_MINFO_FUNCTION(pgsql) php_info_print_table_header(2, "PostgreSQL Support", "enabled"); #if HAVE_PG_CONFIG_H php_info_print_table_row(2, "PostgreSQL(libpq) Version", PG_VERSION); + php_info_print_table_row(2, "PostgreSQL(libpq) ", PG_VERSION_STR); #ifdef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT php_info_print_table_row(2, "Multibyte character support", "enabled"); #else From 67ba12188f88c06842aa0bd2a7fe151b9bf1396b Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Tue, 17 Apr 2012 16:34:47 +0900 Subject: [PATCH 2/3] Add NEWS --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index 2eafb98f70a1c..c862a6f4d63f3 100644 --- a/NEWS +++ b/NEWS @@ -788,6 +788,7 @@ PHP NEWS - Postgres: . Fixed bug #60244 (pg_fetch_* functions do not validate that row param is >0). (Ilia) + . Added PGSQL_LIBPQ_VERSION/PGSQL_LIBPQ_VERSION_STR constants. (Yasuo) - Reflection: . Fixed bug #60367 (Reflection and Late Static Binding). (Laruence) From b509ae381695086edde4658df2567352d3900b90 Mon Sep 17 00:00:00 2001 From: Sherif Ramadan Date: Thu, 19 Jul 2012 17:21:36 -0400 Subject: [PATCH 3/3] mcrypt_ecb has been documented as deprecated but does no throw error. Added an E_DEPRECATED error in reference to Bug #62374 and will update the docs accordingly. --- ext/mcrypt/mcrypt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 05f13cf59be2b..a3f935f6fec5a 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -1317,6 +1317,8 @@ PHP_FUNCTION(mcrypt_ecb) convert_to_long_ex(mode); php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ecb", iv, iv_len, ZEND_NUM_ARGS(), Z_LVAL_PP(mode), return_value TSRMLS_CC); + + php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mcrypt_generic() or mdecrypt_generic() instead"); } /* }}} */