Home > Backend Development > PHP Tutorial > Configuring Yaf_PHP Tutorial

Configuring Yaf_PHP Tutorial

WBOY
Release: 2016-07-20 11:13:01
Original
1159 people have browsed it

The latest beta version of yaf in peclhttp://pecl.php.net/package/Yaf

Install pcre

To install pcre first, run Debian ubuntu

<span sudo</span> apt-get <span install</span> libpcre3 libpcre3-dev
Copy after login
$ <span sudo</span> pecl <span install</span> apc
Copy after login

Install Yaf

Download Yaf, unzip it and enter the yaf directory (the directory with c files) and execute the following command:

<span $ phpize

$ .</span>/configure --with-php-config=/usr/bin/php-<span config

$ </span><span make</span><span 

$ </span><span sudo</span> <span make</span> <span install</span>
Copy after login
<span 路径/usr/bin/php-config要根据系统所配置的路径。</span>
Copy after login

Configure php.ini file

Add

at the end of the php.ini file
<span ;yaf Framework
extension</span>=<span yaf.so
yaf.environ</span>=<span "</span><span product</span><span "</span><span 
yaf.use_spl_autoload</span>=<span 1</span><span 
yaf.use_namespace</span>=<span 1</span> 
Copy after login

Table 2.2. Yaf configuration options

选项名称 默认值 可修改范围 更新记录
yaf.environ product PHP_INI_ALL 环境名称, 当用INI作为Yaf的配置文件时, 这个指明了Yaf将要在INI配置中读取的节的名字
yaf.library NULL PHP_INI_ALL 全局类库的目录路径
yaf.cache_config 0 PHP_INI_SYSTEM 是否缓存配置文件(只针对INI配置文件生效), 打开此选项可在复杂配置的情况下提高性能
yaf.name_suffix 1 PHP_INI_ALL 在处理Controller, Action, Plugin, Model的时候, 类名中关键信息是否是后缀式, 比如UserModel, 而在前缀模式下则是ModelUser
yaf.name_separator "" PHP_INI_ALL 在处理Controller, Action, Plugin, Model的时候, 前缀和名字之间的分隔符, 默认为空, 也就是UserPlugin, 加入设置为"_", 则判断的依据就会变成:"User_Plugin", 这个主要是为了兼容ST已有的命名规范
yaf.forward_limit 5 PHP_INI_ALL forward最大嵌套深度
yaf.use_namespace 0 PHP_INI_SYSTEM 开启的情况下, Yaf将会使用命名空间方式注册自己的类, 比如Yaf_Application将会变成YafApplication
yaf.use_spl_autoload 0 PHP_INI_ALL 开启的情况下, Yaf在加载不成功的情况下, 会继续让PHP的自动加载函数加载, 从性能考虑, 除非特殊情况, 否则保持这个选项关闭

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/440418.htmlTechArticleThe latest beta version of yaf in pecl http://pecl.php.net/package/Yaf To install pcre first Install pcre, Debian ubuntu execute apt-get libpcre3 libpcre3-dev $ pecl apc Install Yaf Download Yaf, unzip...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template