From: Georg Richter Date: Wed, 7 Aug 2002 22:02:11 +0000 (+0000) Subject: added zend_error messages for deprecated functions X-Git-Tag: php-4.3.0dev_zend2_alpha3~196 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f7792a7698e0d52966c7c6f4e0ace6dcf14772a;p=php added zend_error messages for deprecated functions inserted zak and me in author list/credits --- diff --git a/ext/mysql/CREDITS b/ext/mysql/CREDITS index a9e6c3b00c..bd8f07a9b1 100644 --- a/ext/mysql/CREDITS +++ b/ext/mysql/CREDITS @@ -1,2 +1,4 @@ MySQL Zeev Suraski +Zak Greant +Georg Richter diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index b04aa5f4ea..bc89b715b1 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -12,7 +12,9 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Author: Zeev Suraski | + | Authors: Zeev Suraski | + | Zak Greant | + | Georg Richter | +----------------------------------------------------------------------+ */ @@ -1107,6 +1109,9 @@ PHP_FUNCTION(mysql_create_db) WRONG_PARAM_COUNT; break; } + + zend_error(E_NOTICE, "%s is deprecated; use mysql_query() to issue a SQL CREATE DATABASE statement instead.", get_active_function_name(TSRMLS_C)); + ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); @@ -1146,7 +1151,9 @@ PHP_FUNCTION(mysql_drop_db) WRONG_PARAM_COUNT; break; } - + + zend_error(E_NOTICE, "%s is deprecated; use mysql_query() to issue a SQL DROP DATABASE statement instead.", get_active_function_name(TSRMLS_C)); + ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink); @@ -1582,9 +1589,13 @@ PHP_FUNCTION(mysql_escape_string) * we don't realloc() down to the real size since it'd most probably not * be worth it */ + + zend_error(E_NOTICE, "%s is deprecated; use mysql_real_escape_string() instead", get_active_function_name(TSRMLS_C)); + Z_STRVAL_P(return_value) = (char *) emalloc(Z_STRLEN_PP(str)*2+1); Z_STRLEN_P(return_value) = mysql_escape_string(Z_STRVAL_P(return_value), Z_STRVAL_PP(str), Z_STRLEN_PP(str)); Z_TYPE_P(return_value) = IS_STRING; + } /* }}} */