Zend db适配器mysqli或PDO_MYSQL [英] Zend db adapter mysqli or PDO_MYSQL
问题描述
我看过几个在application.ini中执行此操作的代码示例
I've seen several code samples that do this in application.ini
resources.db.adapter = mysqli
or
resources.db.adapter = PDO_MYSQL
两者之间的真正区别是什么?它是否会影响我的代码?我应该选择一个还是另一个?
What is the real difference between the two? Does it impact my code? when should I choose one or the other?
推荐答案
我通过1.0版本开发了很多Zend_Db组件。这是目标,适配器的功能相同,或接近它的PHP扩展支持。
I developed a lot of the Zend_Db component for Zend Framework through the 1.0 release. It was the goal that the adapters function identically, or as close to it as could be supported by the PHP extension.
可以对两个MySQL适配器运行同一组单元测试,几乎没有区别。性能方面,没有可衡量的差异。
The same set of unit tests can be run against both MySQL adapters, with virtually no difference. Performance-wise, there's no measurable difference.
你会选择一个的原因,以及我们支持Mysqli的唯一原因,而不是只有PDO_MySQL,是您需要部署到您没有启用PDO扩展的PHP环境,并且您没有修改环境的权限。例如,商品托管环境。
The reason you would choose one over the other, and the only reason why we supported Mysqli at all, instead of only PDO_MySQL, is that you need to deploy to a PHP environment where you don't have the PDO extension enabled, and you don't have the privilege to modify the environment. For instance, a commodity hosting environment.
这篇关于Zend db适配器mysqli或PDO_MYSQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!