-2

Regarding the upcoming Magento version 2 I'm asking myself, if:

  • Will it make use of PDO?
  • And if so, will it make use of PDO emulated prepares[1] ?

I'm also asking myself about similar PDO related issues, like the usage of "SET NAMES" in Magento 1. Will this be part of the DSN or has the old database/configuration layer that interfaces with PDO taken in 1:1 from Magento 1?

[1] PDO::ATTR_EMULATE_PREPARES; http://php.net/pdo.setattribute

1

Note: As Magento 2 isn't released yet, the questions can only be answered to the time of date from sources publicly available.

Will it make use of PDO?

Yes it will make use of PDO. It's the only DB interface offered so far:

Will it make use of PDO emulated prepares?

Yes, emulated prepares are explicitly enabled by default:


Despite there are many new classes all around and Magento as usual is a database centric application, the underlying code is pretty much copied over from Magento 1 with no or only decorative changes. This includes keeping the Mysql 4 compatbile SQL mode (the comment given suggests that this is wanted), keeping the known Problems with setting the character set with SQL (see Example #1) or keeping the complicated way to configure the database adapter (e.g. you still can't use DSN nor aliasing which is a feature of PDO). The love for the past is still heated, underlying of all this you find \Zend_Db_Adapter_Pdo_Mysql.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.