最好的PHP DAL(数据抽象层)到目前为止 [英] Best PHP DAL (data abstraction layer) so far

查看:493
本文介绍了最好的PHP DAL(数据抽象层)到目前为止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是最好的PHP DAL(数据抽象层)到目前为止开发的任何开源项目,我们可以真诚地重用?

What is the best PHP DAL (data abstraction layer) so far developed under any open source project which we could re-use with good faith?

我发现很难为我的应用程序选择一个DAL来充分支持大多数常见数据库系统(MySQL,PostgreSQL,MSSQL,Oracle等)的抽象,它是:

I am finding it hard to choose a DAL for my application that sufficiently supports abstraction to most common databases systems (MySQL, PostgreSQL, MSSQL, Oracle, etc) and is:


  1. 广泛测试,

  2. 具有良好的界面(可读的方法名称,良好的参数传递策略)

  3. 快速,

  4. 轻量级,

  5. 提供缓存(例如集成Memcache或支持良好的缓存机制),

  6. 开放源代码许可证

  7. 应至少具有MySQL / MySQLi适配器(非基于PDO)

  1. widely tested,
  2. has good interface (readable method names, good parameter passing strategy),
  3. fast,
  4. lightweight,
  5. providing cache (e.g integrates with Memcache or supports a good caching mechanism),
  6. open-source license,
  7. should have adapters for at least MySQL/MySQLi (non-PDO based)

要考虑的一些浴室:

  • PHPBB DAL http://wiki.phpbb.com/Database_Abstraction_Layer
  • Joomla DAL http://api.joomla.org/Joomla-Framework/Database/JDatabase.html
  • ADOdb http://phplens.com/adodb/
  • Zend_db
  • Doctrine (downside only supports PDO_*)
  • any other DAL used/developed under any open-source project/branch

请不要考虑:


  • PDO

  • 所有ORM(但是,Doctrine似乎除了ORM之外还有一个单独的DAL)

推荐答案

如果你能用PHP 5.3,我强烈推荐 Doctrine DAL ,它建立在PDO之上,所以你获得相同的性能和一个伟大的API。

If you can do with PHP 5.3, I would highly recommend Doctrine DAL, it's built on top of PDO, so you get the same performance plus a great API.

strong>更新:如果Doctrine不好,您可以尝试 MDB2 。它有大多数流行的RDBMS驱动程序,一个健壮的API,伟大的文档和庞大的用户基础:

Update: If Doctrine is not good, you can try MDB2. It has drivers for most of the popular RDBMS, a robust API, great docs and a huge user base:


  • MySQL

  • MySQLi(仅限PHP5)

  • PostgreSQL

  • Oracle

  • Frontbase

  • Interbase / Firebird(仅限PHP5)

  • MSSQL

  • SQLite

  • MySQL
  • MySQLi (PHP5 only)
  • PostgreSQL
  • Oracle
  • Frontbase
  • Interbase/Firebird (PHP5 only)
  • MSSQL
  • SQLite

这篇关于最好的PHP DAL(数据抽象层)到目前为止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆