The runkit extension provides means to modify constants, user-defined functions, and user-defined classes. It also provides for custom superglobal variables and embeddable sub-interpreters via sandboxing.
安装此 PECL 扩展库的信息可在手册中标题为 PECL 扩展库安装的一章中找到。 更多信息如新版本,下载,源文件,维护者信息以及更新日志等可以在这里找到: » http://pecl.php.net/package/runkit.
This package is meant as a feature added replacement for the » classkit package. When compiled with the --enable-runkit=classkit option to ./configure, it will export classkit compatible function definitions and constants.
本 » PECL 扩展未绑定于 PHP 中。
安装此 PECL 扩展库的信息可在手册中标题为 PECL 扩展库安装的一章中找到。 更多信息如新版本,下载,源文件,维护者信息以及更新日志等可以在这里找到: » http://pecl.php.net/package/runkit.
可以从 » PHP 下载页面或者 » http://snaps.php.net/ 下载此 PECL 扩展的 DLL 文件。
Modifying Constants, Functions, Classes, and Methods works with all releases of PHP 4 and PHP 5. No special requirements are necessary.
Custom Superglobals are only available in PHP 4.2.0 or later.
Sandboxing requires PHP 5.1.0 or later, or PHP 5.0.0 with a special TSRM patch applied. Regardless of which version of PHP is in use it must be compiled with the --enable-maintainer-zts option. See the README file in the runkit package for additional information.
这些函数的行为受 php.ini 的影响。
Name | Default | Changeable | Changelog |
---|---|---|---|
runkit.superglobal | "" | PHP_INI_PERDIR | |
runkit.internal_override | "0" | PHP_INI_SYSTEM |
以下是配置选项的简要解释。
Example#1 Custom Superglobals with runkit.superglobal=_FOO,_BAR in php.ini
<?php
function show_values() {
echo "Foo is $_FOO\n";
echo "Bar is $_BAR\n";
echo "Baz is $_BAZ\n";
}
$_FOO = 'foo';
$_BAR = 'bar';
$_BAZ = 'baz';
/* Displays foo and bar, but not baz */
show_values();
?>
以下常量由本扩展模块定义,因此只有在本扩展模块被编译到 PHP 中,或者在运行时被动态加载后才有效。