On 29/11/12 10:11, Mailing list wrote:
.. annoying top posting...

This is getting close to a good solution.

ini option mysql_is_deprecated - can not be set in .ini/htaccess etc, only by ini_set() - so hosters/distros can not fix it...

Normally added just before mysql_connect...

ini_set('mysql_is_deprecated', "I WILL NOT USE IT IN THE FUTURE");
mysql_connect(......)

if the ini value is not set, then mysql_connect() can issue a E_DEPRECATED warning

"Mysql is deprecated, use mysqli or PDO, to remove this warning you can set mysql_is_deprecated"

They then have to google mysql_is_deprecated, which tells them to use the magic string...

Solves:
- Users will get warnings on upgrading - it can not be hidden by hosters/distros etc. - Users can easily disable the warning, however they will be explicitly aware of the problem.

Backwards/forward compatible....

Regards
Alan




That is indeed a better solution, but again, what happens after moving to PECL? Is this how we want to be deprecating extensions in the future?

As mentioned several times in this discussion, this is the first time we're trying to put a whole extension through a language feature/function deprecation process. To me, it's like putting a square through a round hole. Alan's suggestion makes the hole a bit more square.

Instead of this being a vote on throwing E_DEPRECATED in ext/mysql, what we really should have is a vote on an RFC on "How to deprecate and remove an extension from core". We can then apply that RFC to any extension we want removed from core. Up until now the process has been to just move it to PECL. Now we're voting to use a different process specifically for ext/mysql because of reasons unknown. I understand the reasons for encouraging people to move to other maintained extensions, but what is the rationale for using a different process specifically for ext/mysql than what we've used in the past?

The fact of the matter is, it's not an extension that will be removed. It's an extension that will be *retired from core*. It will continue to be available from PECL. Magic quotes and most of the other examples of "successful" use of deprecation were actually removed from the language. They are no longer available and you can't get them from PECL either.

IMHO there shouldn't be a vote on E_DEPRECATED without including future removal plans.

Cheers,
David




On Thursday, November 29, 2012 07:00 AM, David Muir wrote:
On 29/11/12 05:09, Ángel González wrote:
I see it as simple to show E_DEPRECATED but not when installed from PECL.

1) Add a
int mysql_extension_triggers_deprecated_warning = 1;

And use it as a conditional for triggering the warning.

2) Copy the extension code to PECL

3) Add these changes in PECL
- If the mysql functions are not already registered,
register them with the bundled code.
- Set mysql_extension_triggers_deprecated_warning = 0;

4) That's it.



Then people (distros, hosts, etc) will just install it from PECL instead to avoid all the E_DEPRECATED mess.

David






--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to