예제 #1
0
파일: Debug.php 프로젝트: hubs/yuncms
 /**
  * 停止Xhprof调试信息
  */
 public function xhprof_stop()
 {
     if (function_exists('saeAutoLoader')) {
         sae_xhprof_end();
         return;
     }
     $profiler = $this->profiler('xhprof');
     if (true === $profiler->is_open()) {
         $xhprof_fun = 'xhprof_disable';
         if (function_exists($xhprof_fun)) {
             $data = $xhprof_fun();
         } else {
             $data = null;
         }
         $profiler->stop();
         return $data;
     }
 }
예제 #2
0
                    $item['url'] = 'http://n1gel-n1gel.stor.sinaapp.com/weather%2F%E5%A4%A7%E9%9B%AA.png';
                } elseif (strstr($item['weather'], "小雨")) {
                    $item['url'] = 'http://n1gel-n1gel.stor.sinaapp.com/weather%2F%E5%B0%8F%E9%9B%A8.png';
                } else {
                    $item['url'] = "http://n1gel-n1gel.stor.sinaapp.com/weather%2F528a43662164c_12.png";
                }
            }
            return Message::make('news')->items(function () use($city, $items) {
                return array(Message::make('news_item')->title("亲,已为你找到{$city}的天气信息")->PicUrl("http://n1gel-n1gel.stor.sinaapp.com/weather%2Fweather_cover.jpg"), Message::make('news_item')->title($items[0]['title'])->PicUrl($items[0]['url']), Message::make('news_item')->title($items[1]['title'])->PicUrl($items[1]['url']), Message::make('news_item')->title($items[2]['title'])->PicUrl($items[2]['url']), Message::make('news_item')->title($items[3]['title'])->PicUrl($items[3]['url']));
            });
        }
        return Message::make('text')->content($data['text']);
    }
    return Message::make('text')->content($data['text']);
}
if (isset($debug) && $debug) {
    sae_xhprof_end();
}
/**
 * SAE调试 在日志中心选择错误日志查看
 * @param $msg string
 */
function sae_log($msg)
{
    sae_set_display_errors(false);
    //关闭信息输出
    sae_debug($msg);
    //记录日志
    sae_set_display_errors(true);
    //记录日志后再打开信息输出,否则会阻止正常的错误信息的显示
}