rfc:mysql_deprecation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
rfc:mysql_deprecation [2012/11/12 12:49] – created aharveyrfc:mysql_deprecation [2012/11/28 06:12] – Slight clarification of the question breakdown. aharvey
Line 1: Line 1:
 ====== Request for Comments: ext/mysql deprecation ====== ====== Request for Comments: ext/mysql deprecation ======
-  * Version: 1.0 +  * Version: 1.1.2 
-  * Date: 2012-11-12+  * Date: 2012-11-28
   * Author: Adam Harvey <aharvey@php.net>   * Author: Adam Harvey <aharvey@php.net>
-  * Status: Under Discussion+  * Status: Voting
   * First Published at: https://wiki.php.net/rfc/mysql_deprecation   * First Published at: https://wiki.php.net/rfc/mysql_deprecation
   * Trivial patch: http://files.adamharvey.name/mysql-deprecation.patch   * Trivial patch: http://files.adamharvey.name/mysql-deprecation.patch
Line 9: Line 9:
  
 This RFC proposes to generate E_DEPRECATED errors when connecting to a MySQL database with the ext/mysql API. This RFC proposes to generate E_DEPRECATED errors when connecting to a MySQL database with the ext/mysql API.
 +
 +===== Voting ======
 +
 +Please note that there are two questions below: please vote on both if possible. The first controls the direct result of this RFC, while the second is to provide guidance should the RFC be rejected.
 +
 +<doodle title="Should ext/mysql generate E_DEPRECATED errors in PHP 5.5?" auth="user" voteType="single" closed="false">
 +   * Yes
 +   * No
 +</doodle>
 +
 +There are four options available for the next question:
 +
 +If the vote to make ext/mysql generate E_DEPRECATED errors is unsuccessful, what course of action do you think we should take?
 +
 +  * **(a)** Enhance the manual text to make the soft deprecation clearer, and generate E_DEPRECATED notices in PHP 5.6.
 +  * **(b)** Enhance the manual text to make the soft deprecation clearer, but take no further action in terms of E_DEPRECATED for the forseeable future.
 +  * **%%(c)%%** Remove the warnings from the manual and undeprecate ext/mysql entirely.
 +  * **(d)** Do nothing.
 +
 +<doodle title="If the vote to make ext/mysql generate E_DEPRECATED errors is unsuccessful, what course of action do you think we should take?" auth="user" voteType="single" closed="false">
 +>
 +   * (a)
 +   * (b)
 +   * (c)
 +   * (d)
 +</doodle>
  
 ===== Background ===== ===== Background =====
Line 21: Line 47:
  
 [[http://files.adamharvey.name/mysql-deprecation.patch|An extremely trivial patch to do this is available.]] [[http://files.adamharvey.name/mysql-deprecation.patch|An extremely trivial patch to do this is available.]]
 +
 +The proposed wording of the deprecation message is:
 +
 +> The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
  
 ===== Why? ===== ===== Why? =====
Line 33: Line 63:
  
 > Moving away from ext/mysql is not only about security but also about having access to all features of the MySQL database. > Moving away from ext/mysql is not only about security but also about having access to all features of the MySQL database.
 +
 > ext/mysql was built for MySQL 3.23 and only got very few additions since then while mostly keeping compatibility with this old version which makes the code a bit harder to maintain. From top of my head missing features not support be ext/mysql include:  > ext/mysql was built for MySQL 3.23 and only got very few additions since then while mostly keeping compatibility with this old version which makes the code a bit harder to maintain. From top of my head missing features not support be ext/mysql include: 
     * Stored Procedures (can't handle multiple result sets)     * Stored Procedures (can't handle multiple result sets)
Line 45: Line 75:
  
 None of those reasons have gone away. None of those reasons have gone away.
 +
 +Ulf Wendel has also written [[http://blog.ulf-wendel.de/2012/php-mysql-why-to-upgrade-extmysql/|a terrific blog post explaining why upgrading from ext/mysql is a good idea]].
  
 ===== Issues ===== ===== Issues =====
Line 61: Line 93:
  
 Some future release of PHP will presumably unbundle ext/mysql, at which point it can be moved out to PECL to slowly bitrot. That future release is not part of this RFC, however. Some future release of PHP will presumably unbundle ext/mysql, at which point it can be moved out to PECL to slowly bitrot. That future release is not part of this RFC, however.
 +
 +===== Workarounds =====
 +
 +==== Converting to MySQLi or PDO ====
 +
 +  * http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers
 +
 +==== Suppressing deprecation warnings ====
 +
 +While code is being converted to MySQLi, E_DEPRECATED errors can be suppressed by setting error_reporting in php.ini to exclude E_DEPRECATED:
 +
 +    error_reporting = E_ALL ^ E_DEPRECATED
 +
 +Note that this will also hide other deprecation warnings, however, which may be for things other than MySQL.
  
 ===== Changelog ===== ===== Changelog =====
  
-  * 2012-11-12: Initial version.+  * 1.1.2 (2012-11-28): Replace the Oracle Wiki link with a link to Ulf's new blog post; moved to voting phase. 
 +  * 1.1.1 (2012-11-19): Added the wording of the deprecation message that was already in the patch. 
 +  * 1.1 (2012-11-13): Added workarounds; fixed formatting on the quote of Johannes' e-mail. 
 +  * 1.0 (2012-11-12): Initial version.
rfc/mysql_deprecation.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1