1. The background
In the interview of Sina Weibo, I was asked a question: Can you Yaf? I mean, the question just blew me away,
Later, after the interview, I went to have a look, and found that many domestic companies are using it, and many well-known companies are widely used, including Tencent, Baidu, Sina Weibo and so on.
(Mastering Yaf will be a good plus if you want to join well-known domestic companies like Tencent, Baidu and Weibo.)
However, since Yaf(Yet Another Framework) is written in C + Zend API, it is difficult to read, so the idea of translation came into being.
2. About Yaf
Yaf is a PHP Web high performance framework written in C. If you are interested, you can learn about it by yourself.
Let’s take a look at some of the common problems encountered when developing with Yaf.
- Develop black boxes. In the coding stage, our IDE could not complement or prompt Yaf related functions, and the development process was in a black box.
- The documentation is incomplete. I don’t have a good understanding of the underlying implementation principle of Yaf, so I usually have to read fragmented documents when encountering problems. If the documents can’t solve my problems, I will be helpless and have a terrible development experience.
- Source code reading costs are high. Some students want to thoroughly understand the underlying implementation principle of Yaf by reading the source code, but because Yaf is written by C and the source code implementation is full of a large number of dazzling Zend APIS, the reading cost is relatively high for most students.
3. About YAFPHP
3.1 introduction
Project address: github.com/yinggaozhen…
Yaf-php uses native PHP to rewrite the logic of Yaf source code, restoring its related implementation logic to the maximum extent.
Due to the use of native PHP rewrite, it can achieve the purpose of smoothing reading ability and reducing the cost of reading. During normal development, it can also be introduced as an IDE Helper to speed up development efficiency.
3.2 Final Effect
Without further ado, let’s go straight to the final renderings
3.3 installation
> git clone https://github.com/yinggaozhen/yaf-php-doc.git
Copy the code
3.4 Quick Use
3.4.1 was introduced in PhpStorm
Two ways to do it
Left navigation bar 'External Libraries' ->' Configure PHP Include Path '-> add' yaf-php 'file Path ->' apply 'Copy the code
Menu ` File ` - > ` Setting ` - > ` PHP ` - > add ` Yaf - PHP ` File path - > ` apply `Copy the code
3.4.2 Introduced in NetBeans
Right-click your project -> 'Properties' ->' PHP Include Path '->' Add Folder.. '-> add' yaf-php 'file path ->' open 'Copy the code
3.5 Current Supported/Completed Functions
- Support IDE recognition/auto-fill for Yaf
- It also supports the introduction mode of PSR-0 and PSR-4
- All Yaf public methods are defined as
@link
Form to add official document link
3.6 Functions under development
- Currently 80% of the test cases are through official source code, although it is still being translated
- Supports debugging in a specified version
4 summary
Portal: github.com/yinggaozhen…
This project has been developed on and off for nearly half a year, and is still under development now. If you have any suggestions or comments, please send them to me in the direct issue or send me a private message
Last but not least, if you think your project is good, don’t forget star/fork
Last but not least, if you think your project is good, don’t forget star/fork
Last but not least, if you think your project is good, don’t forget star/fork