Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 454020 - dev-lang/php[pdo mysqlnd -mysql] should enable MySQL PDO driver
Summary: dev-lang/php[pdo mysqlnd -mysql] should enable MySQL PDO driver
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-25 15:07 UTC by Zoltán Halassy
Modified: 2013-06-08 13:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zoltán Halassy 2013-01-25 15:07:36 UTC
Tested with 5.4.8.

If pdo and only mysqlnd is on, and mysql off, portage passes --without-pdo-mysql to the configure script, and disables the driver.

The idea was to turn off the already deprecated mysql_* functions from php, so could write replacement compatiblity functions for old codes during the transition to PDO, but this makes it "impossible" (stock PHP doesn't let undefine, rename or redefine functions without addons, like apd).

It would be cool, if the USE flag system would enable a combination which enables the PDO MySQL driver, but omits the old mysql_* functions.

Thank you!
Comment 1 Ole Markus With (RETIRED) gentoo-dev 2013-01-28 10:49:35 UTC
mysql_ functions are not deprecated. And you would kill portability of your code if you write those functions. I would REALLY recommend you write against something like Doctrine DBAL (not the ORM) instead of writing your own wrapper code.
Comment 2 Zoltán Halassy 2013-01-28 11:03:36 UTC
(In reply to comment #1)
> mysql_ functions are not deprecated. 

Maybe not in 5.4, yet. But otherwise:

http://www.php.net/manual/en/function.mysql-connect.php

> *Warning*
> 
> This extension is deprecated as of PHP 5.5.0, and will be removed in the
> future. Instead, the MySQLi or PDO_MySQL extension should be used. See also
> MySQL: choosing an API guide and related FAQ for more information.
> Alternatives to this function include:
>
>    mysqli_connect()
>    PDO::__construct()


> And you would kill portability of your
> code if you write those functions. 

We can check if the functions are there or not. Wouldn't put code blindly there. But this feature would be mainly useful on the self-maintained development environment, rather than production.

> I would REALLY recommend you write
> against something like Doctrine DBAL (not the ORM) instead of writing your
> own wrapper code.

Thank you for the tip, we will look into it.
Comment 3 Ole Markus With (RETIRED) gentoo-dev 2013-01-28 11:50:55 UTC
Anyways, the issue reported here was a bug in the ebuild, which should be fixed now.
Comment 4 Joakim 2013-06-08 13:40:08 UTC
Please, can this be fixed also for php-5.3.26?