public function export() { //http://admin.alarm.mix.sina.com.cn/?s=redis_tmp_log&a=get_tmp_log&_search_field=type&_search_keyword=1 $type = $_GET['_search_keyword']; $fileName = "{$type}.txt"; header("Cache-Control:public"); header("Pragma:public"); header("Content-type:APPLICATION/OCTET-STREAM"); header("Content-Disposition:inline; filename={$fileName}"); $i = 0; $limit = 100; while (true) { $start = (++$i - 1) * $limit; $stop = $start + $limit; $tmpLog = MyRedis::getTmpLog($type, $start, $stop); if (empty($tmpLog['messages'])) { break; } ob_start(); echo implode("\n", $tmpLog['messages']); ob_end_flush(); } }