Yaf basic learning summary 1-Yaf Framework Overview

Source: Internet
Author: User
Starting from today, I want to explain the yaf framework. Before that, I must know what yaf is. of course, from the title, we already know that yaf is a PHP framework, maybe everyone is familiar with the PHP Framework. from today on, I will explain the yaf framework to you. Before that, I must know what yaf is. of course, we already know from the title that yaf is a PHP Framework. maybe everyone is familiar with the PHP Framework. Generally, there are at least one or two frameworks used by PHP programmers, thinkPHP and YII are widely used in China, but Yaf is rarely used. I personally think there are two reasons: one is just a short promotion, and the other is the high threshold, which makes it difficult for new users. most new users prefer frameworks that are widely used and have many tutorials and documents.

First, the author of yaf will give a simple reference to yaf: 

With the development of PHP, PHP frameworks are emerging one after another. However, there is still a lot of debate over the use of PHP frameworks. opponents believe that the use of frameworks will reduce the performance, and Zend Framework is often used as an example. the supporter believes that the adoption of the framework can improve the development efficiency and the loss of performance is also worthwhile. these are also one of the reasons for the wide variety of frameworks in the company. some project teams choose some frameworks for performance, while others choose another framework for better encapsulation, are there two solutions? That is to say, is there a framework that neither compromises performance nor improves development efficiency. yaf is born for this purpose. yaf has similar APIs and concepts as Zend Framework, while maintaining compatibility with Bingo to improve development efficiency and standardize development habits. in pursuit of performance, Yaf abstracts the difficult parts of the framework and uses PHP extension (c) to ensure performance. in a simple test conducted by the author, Yaf and native PHP have a performance loss of less than 10% under the same function, while compared with Zend Framework, yaf has a performance of 50 to 60 times that of Zend Framework.


It can be seen that the Yaf framework has the greatest advantage of being fast. it is written in C language, just like native PHP. it is fast and close to native PHP. just like the author, three layers of the Sword: one is a sword in the hand, and the other is a sword in the heart; the other is a sword in the hand, and the other is a sword in the heart, compared with other PHP frameworks written in PHP, Yaf is the second layer of the sword. the framework is not in your hands, but in PHP's "heart.

The official document summarizes the advantages of Yaf as follows: 

1. compared with native PHP, the PHP framework developed in C language has almost no additional performance overhead.
2. all Framework classes, without compilation, are loaded at PHP startup and resident in memory.
3. shorter memory turnover cycle, improved memory utilization, and reduced memory usage.
4. smart automatic loading. global and local loading rules are supported to facilitate sharing of class libraries.
5. high-performance View engine.
6. a highly flexible and scalable framework that supports custom View engines, plug-ins, and custom routes.
7. multiple built-in routes are compatible with common routing protocols.
8. powerful and highly flexible configuration file support. It also supports caching configuration files to avoid performance loss caused by complicated configuration structures.
9. in the framework itself, dangerous operation habits are prohibited.
10. faster execution speed and less memory usage.

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.