コード例 #1
0
 /**
  * Register user
  *
  * @param $identify
  * @param $username
  * @param $client
  * @param $dni
  * @param $name
  * @param $lastname
  * @param $email
  * @return mixed|string
  */
 public static function userRegister($identify, $username, $client, $dni, $name, $lastname, $email)
 {
     $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' => 'USER', 'method' => 'REGISTER', 'identify' => $identify, 'username' => $username, 'client' => $client, 'dni' => $dni, 'name' => $name, 'lastname' => $lastname, 'email' => $email];
         $curl = cURL::post($url, $request);
         $response = json_decode($curl);
     } catch (\Exception $ex) {
         \Log::error('FantasyWrapper.userRegister.catch', ['exception' => $ex, 'identify' => $identify, 'username' => $username, 'client' => $client, 'dni' => $dni, 'name' => $name, 'lastname' => $lastname, 'email' => $email, 'access_token' => $access_token]);
         $response = $ex->getMessage();
     }
     return $response;
 }
コード例 #2
0
 /**
  * 删除配置 
  *
  * @return string
  */
 public function delete()
 {
     $param = array('author' => $_POST['name'], 'module' => $_POST['module'], 'action' => $_POST['action'], 'framework' => $_POST['framework'], 'switch' => $_POST['swi']);
     $url = self::DEV_HOST . '/2.0/order/xhprof_config_delete';
     $response = cURL::post($url, $param);
 }