标题: PHP教程之进步define功能的php扩大hidef的装置和... [打印本页] 作者: 分手快乐 时间: 2015-2-3 23:36 标题: PHP教程之进步define功能的php扩大hidef的装置和... 《PHP+MYSQL WEB开发(第三版)》号称圣经级,(也许是个不错的选择(声明:作者没给我啥好处费,我也不是书托,隔着大老远,我连他老兄的面都没见过的说-_-) 官网:http://pecl.php.net/package/hidef
简介:
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 http://pecl.php.net/get/hidef-0.1.8.tgz
# 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.