官网: 简介: Allow definition of user defined constants in simple ini files, which are then processed like internal constants, without any of the usual performance penalties. 允许使用简单的ini文件来定义需要的常量,就像使用内部变量一样,而且没有使用Define的性能问题。
作者说Hidef is initialized in php module init, before apache starts spawning children. 在apache启动前,PHP启动时创建并初始化了这些常量,这样就不需要在php里define常量了,性能自然没有任何问题了! 在Nginx下同样可用,以下是安装过程:
1、下载并解压进入目录
# wget # tar zxvf hidef-0.1.8.tgz # cd hidef-0.1.8
2、没有configure文件,执行phpize创建该文件
# /usr/local/webserver/php/bin/phpize # ./configure --enable-hidef --with-php-config=/usr/local/webserver/php/bin/php-config # make # make install
define() is notoriously slow. Since the main benefit of APC is to increase the performance of scripts/applications, this mechanism is provided to streamline the process of mass constant definition. However, this function does not perform as well as anticipated.
For a better-performing solution, try the hidef extension from PECL.