/** * 以Json的方式渲染数据并输出 * * @param boolean $show * @return string */ public function render($show = true) { ob_start(); echo serialize($this->_data); $out = ob_get_clean(); if ($show) { echo $out; } //如果输出debug信息, Json会不正确 Pft_Debug::getDefaultDebug()->clearDebugInfo(); return $out; }
/** * 以PhpArray的方式渲染数据并输出 * * @param boolean $show * @return string */ public function render($show = true) { ob_start(); //这里显示菜单 //这里显示主体部分 //parent::render( true ); reset($this->_data); echo var_export($this->_data); //这里显示底部 $out = ob_get_clean(); if ($show) { //echo "<pre>\n"; echo $out; //echo "\n</pre>"; } Pft_Debug::getDefaultDebug()->clearDebugInfo(); return $out; }
/** * 以XML的方式渲染数据并输出 * * @param boolean $show * @return string */ public function render($show = true) { ob_start(); //这里显示菜单 //这里显示主体部分 //parent::render( true ); reset($this->_data); echo '<?xml version="1.0" encoding="' . $this->_charSet . '"?>' . "\n"; echo Pft_Util_Array::varToXml($this->_data); //这里显示底部 $out = ob_get_clean(); if ($show) { header("Content-type: text/xml; charset=" . $this->_charSet); echo $out; } //如果输出debug信息, XML会报错 Pft_Debug::getDefaultDebug()->clearDebugInfo(); return $out; }
/** * @todo 解决和dialog重复的问题 * * @param boolean $show * @return string */ public function render($show = true) { ob_start(); /** * ajax 也要显示显示 Tq消息 * Tq消息要在 tip 之前 * ajax不显示消息, 此时消息存在 session 里,下次统一发送 */ //echo Tpm_Message_Sender_Tq::getMsgHtml(); /** * 这里显示主体部分 */ parent::render(true); $out = ob_get_clean(); if ($show) { echo $out; } //如果输出debug信息, Ajax会不爽 Pft_Debug::getDefaultDebug()->clearDebugInfo(); return $out; }
/** * 以XML的方式渲染数据并输出 * * @param boolean $show * @return string */ public function render($show = true) { // header( "Content-type: application/octetstream" ); // header( "Content-Disposition: attachment; filename=".date('Y-m-d H:i:s').".csv" ); // header('Content-type: application/csv'); // header('Content-Disposition: attachment; filename="xxx.csv"'); ob_start(); //这里显示菜单 //这里显示主体部分 //parent::render( true ); reset($this->_data); /** * 这里显示主体部分 */ parent::render(true); //这里显示底部 $out = ob_get_clean(); if ($show) { echo $out; } //如果输出debug信息, XML会报错 Pft_Debug::getDefaultDebug()->clearDebugInfo(); return $out; }
Pft_Log::addLog('Cache exception : ' . $errorInfo); if (defined('DEBUG') && DEBUG) { echo "<pre>" . $errorInfo . "</pre>"; echo "<pre>" . debug_print_backtrace() . "</pre>"; //todo: 此处转入debug 错误代码处理 switch ($code) { } } else { $_REQUEST['msg'] = $e->getMessage(); $_REQUEST['code'] = $code; include 'error.php'; //header( "Location:?do=error&code=$code&msg=".urlencode($e->getMessage()) ); //header( "Location:?do=error&code=$code&msg=".$e->getMessage() ); } } Pft_Debug::addInfoToDefault('After dispatch.'); if (defined("DEBUG") && DEBUG) { /** * 程序结束 输出调试信息 */ Pft_Debug::getDefaultDebug()->output(); } /** * Record Process Time * @author terry * @version 0.1.0 * Sat Aug 04 13:54:36 CST 2007 */ $endTime = microtime(true); $processTimeLogger = new Pft_Log_File('processTime'); $processTimeLogger->log(($endTime - APP_START_TIME) * 1000, 0, 'ProcessTimeAt MS', "", "", @$_REQUEST['do']);