开发者

What is Pear DB library?

I am a noob to PHP can anyone explain me whats Pear DB library with a pra开发者_如何学编程ctical use?

Thanks


http://pear.php.net - PEAR is a framework and distribution system for reusable PHP components.

EDIT(to the first answer):

Except DB abstraction packeges PEAR library contains huge amount of useful classes for work with XML, CURL etc. Full list of maintained packeges is available here.

BTW, PEAR stands for PHP Extension and Application Repository


The What: Pear DB is abstraction layer. Its one of many framework components available from PEAR. What the heck is that? Its a layer/interface between PHP and the db provider (MySQL, MSSQL,Protege) . So, it handles calls to multiple types of db providers in pretty much the same way to your PHP application. Your application layer doesn't have to concern itself with the details of calling individual providers.

Pros: Portability. Allows you to write your db interface code once and have it work with multiple providers. Encapsulation. Makes many db calls a bit simpler to make.

Cons: Performance. It will generally be a bit slower than calling php db commands directly.

Nutshell: Its good to use it when you can.


Its just a database abstraction library. ALlows you to connect to different kinds of databases (MySQL, PostgreSQL) using a consistent API.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜