From b7091aaf0137d97cf4aa4a402ec50b3946d369c0 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Mon, 10 Dec 2012 22:12:09 +0800 Subject: Deprecate ext/mysql. Per https://wiki.php.net/rfc/mysql_deprecation, connecting to a MySQL database via ext/mysql now generates an E_DEPRECATED error. This commit includes the minimal EXPECTF updates required for the test suite to pass: it may be preferable to refactor some of the tests to suppress deprecation errors in situations where no other error is expected from mysql_[p]connect(), but I'm not enough of a MySQL expert to want to get my hands that dirty in a long standing test suite. --- ext/mysql/php_mysql.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext/mysql/php_mysql.c') diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index f1aab94f8a..dc7f108b5d 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -731,6 +731,10 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) zend_bool free_host=0, new_link=0; long connect_timeout; + php_error_docref(NULL TSRMLS_CC, + E_DEPRECATED, + "The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead"); + #if !defined(MYSQL_USE_MYSQLND) if ((MYSQL_VERSION_ID / 100) != (mysql_get_client_version() / 100)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, -- cgit v1.2.1