/** * @return Response */ public function index() { $checkNameList = array('chaoguo' => TRUE, 'hailongchen' => FALSE, 'yutingwu' => FALSE, 'yishuliu' => FALSE); if (!empty($_GET['check_name'])) { $checkName = $_GET['check_name']; //set cookie setcookie("checked_name", $checkName, time() + 3600); } elseif (!empty($_COOKIE['checked_name'])) { $checkName = $_COOKIE['checked_name']; } $snakeList = array(); $virusList = array(); if (!empty($checkName)) { foreach ($checkNameList as $key => $check) { if ($key == $checkName) { $checkNameList[$key] = TRUE; } else { $checkNameList[$key] = FALSE; } } $response = cURL::get(self::DEV_HOST . '/2.0/order/xhprof_config_list?name=' . $checkName); $body = json_decode($response->body, TRUE); $configList = $body['data']['info']; foreach ($configList['virus_action'] as $key => $value) { foreach ($value as $_key => $_value) { $arr = explode(':', $_value); $virusList[$key][$_key]['name'] = $arr[0]; $virusList[$key][$_key]['switch'] = isset($arr[1]) ? $arr[1] : 'off'; } } foreach ($configList['snake_action'] as $key => $value) { foreach ($value as $_key => $_value) { $arr = explode(':', $_value); $snakeList[$key][$_key]['name'] = $arr[0]; $snakeList[$key][$_key]['switch'] = isset($arr[1]) ? $arr[1] : 'off'; } } } $param = array('current' => '配置', 'tab' => 'config', 'name_list' => $checkNameList, 'virus_config_list' => $virusList, 'snake_config_list' => $snakeList); return view('config', $param); }
/** * Get zones by sport * * @param int $sport Sport ID * @return mixed|string */ public static function getZones($sport) { $access_token = Route::input('fantasy_token') ? Route::input('fantasy_token') : Session::get('fantasy_token'); if (is_null($access_token)) { $token = self::getAccessToken(); $access_token = $token->FantasyApi->data->access_token; } try { $url = Config::get('fantasy.fantasy_url'); $request = ['access_token' => $access_token, 'action' => 'ZONE', 'method' => 'GET', 'sport' => $sport]; $url = cURL::buildUrl($url, $request); $curl = cURL::get($url); $response = json_decode($curl); } catch (\Exception $ex) { \Log::error('FantasyWrapper.getZones.catch', ['exception' => $ex]); $response = $ex->getMessage(); } return $response; }
public function xhprof_detail($id) { $response = cURL::get(parent::DEV_HOST . '/2.0/order/xhprof_detail_diy?uniqid=' . $id); $xhprofData = json_decode($response->body, 1); return $xhprofData; }
/** * Xhprof Performance Analysis(snake) * * @return Response */ public function snake_xhprof($page = 0) { $response = cURL::get(parent::DEV_HOST . '/2.0/order/xhprof_list?type=snake&page=' . $page); $data = json_decode($response->body); return view('xhprof_snake', ['xhprofData' => $data->data, 'current' => 'Snake analysis', 'tab' => 'snake']); }