Yaf Framework php Extension Framework-witness the defects of our knowledge

Source: Internet
Author: User
In the past two days, I have been studying a framework. yaf is an extension framework of php. its full name is YetAnotherFramework.

In the past two days, I have been studying a Framework. yaf is an extension Framework of php. its full name is Yet Another Framework. yaf is the only Framework written by people entering the PHP Development Group in China, in addition, there are other works such as yar yac lua Taint, blog address http://www.laruence.com, in the last two days to study this framework I specifically installed the linux system, and then look at his C code, the logic code implementation, garbage collection mechanism, memory cycle control, and loading methods are pretty cool! This guy has a lot of tutorials in linux. windows is more about installing vc6 and later versions. many people just learn PHP and have not studied it, so today I am writing a simple tutorial, praising this framework and revealing what Sina Weibo uses! Official Test http://www.laruence.com/2012/09/16/2791.html

Today, I will teach you how to use this thing. Today's simple tutorial!

I have already performed experiments on win8, because win8 is installed on the company's computer, and php Version 5.3.23 is installed on iis 8, then the official said to download the class library can be more than 5.3 php_yaf.dll but this thing looks a lot of http://code.google.com/p/yafphp/downloads/list has multiple versions, and is divided into zts and CTS version, here for everyone what this is, it is actually php thread security and non-thread security, that is, the two loading methods of PHP, ISAPI and FASTCGI. we know that FAST_CGI has been integrated on IIS7, in general, PHP is used. if FAST_CGI is used in windows, iis7 is usually recommended to use a non-linear security of the system. The current configuration is as follows:

Then, I downloaded the Target version of the new version. I was renaming it and loading php_yaf.dll to ext/to load php. after ini, a problem occurs when php.exe-l is executed. the error message of php5ts is missing. at this time, we will put it under the php root directory and execute it correctly.
Add the following to php. ini:

Configuration instructions

Option name default value can modify range update records
Yaf. environproductPHP_INI_ALL environment name. when INI is used as the Yaf configuration file, this indicates the name of the section Yaf will read in the INI configuration.
Directory path of yaf. libraryNULLPHP_INI_ALL global class library
Yaf. cache_config0PHP_INI_SYSTEM indicates whether to cache the configuration file (only effective for the INI configuration file). enabling this option can improve the performance in case of complicated configuration.
Yaf. name_suffix1PHP_INI_ALL: when processing Controller, Action, Plugin, and Model, whether the key information in the class name is a suffix, such as UserModel, while in prefix mode, it is ModelUser.
Yaf. name_separator "" PHP_INI_ALL indicates the delimiter between the prefix and name when processing Controller, Action, Plugin, and Model. the default value is null, that is, UserPlugin, and it is set "_", the judgment is based on "User_Plugin" to be compatible with the existing naming rules of ST.
Yaf. forward_limit5PHP_INI_ALLforward maximum nested depth
When yaf. use_namespace0PHP_INI_SYSTEM is enabled, Yaf registers its own class using the namespace method. for example, Yaf_Application will become Yaf \ Application.
When yaf. use_spl_autoload0PHP_INI_ALL is enabled, Yaf will continue to enable PHP to automatically load function loading when loading fails. in consideration of performance, this option is disabled unless otherwise specified.

Restart iis and we will find that yaf has been extended. this is very simple, but it is silly for people who are used to the php Framework. how can we use this, is everything written by myself? most of the frameworks are manually configured by myself, and then the framework for rapid development is separated by many things, if you are interested in PHP, you can study it and enrich our knowledge. if your PHP feels good, we suggest you check his source code C, and you will not be able to find it. The author's development ideas are awesome! Tomorrow I will teach you how to use it to quickly develop a web! For more information, see http://yaf.laruence.com/manual/#!

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.