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