What does yaf use for database class libraries?

Source: Internet
Author: User
I recently studied yaf of laruence, which is really good. The only pity is that the database class is not encapsulated. I tried to integrate the database zend2.2.4. But after reading the database code, I found that only one query statement is executed, you have to load a large pile of files. I feel like yaf... recently I am free to study yaf of laruence, which is really good.

The only pity is that the database class is not encapsulated. I tried to integrate the zend 2.2.4 database, but after reading the database code, I found that only one query statement is executed, you have to load a large pile of files. It seems that it is different from the simple dependency of yaf. The default pdo is recommended in this document.

I don't know how to do it when I use yaf?

Reply content:

I recently studied yaf of laruence, which is really good.

The only pity is that the database class is not encapsulated. I tried to integrate the zend 2.2.4 database, but after reading the database code, I found that only one query statement is executed, you have to load a large pile of files. It seems that it is different from the simple dependency of yaf. The default pdo is recommended in this document.

I don't know how to do it when I use yaf?

Yaf has never been used. If the application is not too complex, I personally think PDO is enough. The only thing that needs to be improved is to reuse the link in the singleton mode. However, using global variables does not matter.

It is a waste to encapsulate the database for accessing the database. The advantage of using DAO is to make it easier for programmers to collaborate and improve development efficiency, but it also brings performance loss. How to choose or view the specific situation.

Yaf DB class for reference:
Http://www.yafphp.com/thread-2640-1-1.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.