PEAR::registerShutdownFunc() -- 为静态类(开发相关包)设置一个关闭函数
参数
array $func - 类的名字,功能的核心.
array $var - 可能存在必须的函数参数,这个参数递交给了和继承数组一至的函数
例子
Example 19-1. Using registerShutdownFunc() <?php
require_once 'PEAR.php';
class myClass {
function myClass()
{
PEAR::registerShutdownFunc(array('myClass', 'shutdown'),
array('param1', 'param2'));
}
function shutdown( $param1, $param2)
{
// do something before we will die
//在结束前执行的代码
}
}
?> |
|