/** * 当本页面所有脚本执行完成之后执行(回调函数) * @param string functionName 函数名 * @access protected * @return */ protected function _register_shutdown() { $m = M(); register_shutdown_function(function() use ($m) { global $GLOBALS; $start = $GLOBALS['_beginTime']; $endtime = microtime(true); $calltime = $endtime - $start; $m->table("pingjia_interface_statistic")->add( array( "interface" => MODULE_NAME.'.'.ACTION_NAME, 'calltime' => $calltime, 'createtime' => time() ) ); }); }