获取用户信息.

@author Tian

@param string $openid 用户openid
@param string $lang

@return array 用户信息.
515889
public function getUserMsg($openid, $lang = 'zh_CN')
    {
        $queryStr = [
            'openid' => $openid,
            'lang'   => $lang,
        ];

        $res = $this->_get('info', $queryStr);

        return $res;
    }
210476
public function getSuggestions($lang = null)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('users', 'suggestions');

		// Set the API path
		$path = '/users/suggestions.json';

		$data = array();

		// Check if entities is true
		if ($lang)
		{
			$data['lang'] = $lang;
		}

		// Send the request.
		return $this->sendRequest($path, 'GET', $data);
	}
1247295
public function getEmailDetailsByEmailId($emailId, $langId = null){
        $select = $this->tableGateway->getSql()->select();
        
        $select->where('boed_email_id ='.$emailId);
        if($langId != null){
            $select->where('boed_lang_id ='.$langId);
        }
        
        $resultSet = $this->tableGateway->selectWith($select);
        return $resultSet;
    }
1079034
public function select(array $openids, string $lang = 'zh_CN')
    {
        return $this->httpPostJson('cgi-bin/user/info/batchget', [
            'user_list' => array_map(function ($openid) use ($lang) {
                return [
                    'openid' => $openid,
                    'lang' => $lang,
                ];
            }, $openids),
        ]);
    }
1333236
public function detailsJSON($lang, $id)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('Tags', 'update')) {
            return $this->noPermission();
        }

        $tags = Tag::find($id);
        $media = Media::find($tags->featuredImageID);
        $final = array(
            'details' => $tags,
            'featuredImage' => $media
        );

        // Fire event
        $final['events'] = Event::fire('tag:pre_update', [$final]);
        return $final;
    }
325199
private function getTranslations($lang) {
    if (!isset($this->translations[$lang])) {
      $messageFile = $this->localeDir."/messages_".$lang.".php";
      if (file_exists($messageFile)) {
        require_once($messageFile);
        // store for later reference
        $this->translations[$lang] = ${"messages_$lang"};
      }
      else {
        $this->translations[$lang] = [];
      }
    }
    return $this->translations[$lang];
  }
1135499
public OpenUser userInfo(String accessToken, String openId, String lang) {
        String url = WxEndpoint.get("url.oauth.userinfo.get");
        String formatUrl = String.format(url, accessToken, openId, lang);

        logger.debug("get user info {}", formatUrl);
        String response = wxClient.get(formatUrl, false);
        return JsonMapper.defaultMapper().fromJson(response, OpenUser.class);
    }
532489
public function getUserInfo($openId)
    {
        return $this->auth(function () use ($openId) {
            // 1. 调用接口,获取用户信息
            $userInfo = $this->http([
                'url' => 'https://api.weixin.qq.com/cgi-bin/user/info',
                'data' => [
                    'access_token' => $this->accessToken,
                    'openid' => $openId,
                    'lang' => 'zh_CN',
                ],
            ]);

            // 2. 处理微信可能返回错误JSON的情况
            $responseText = $userInfo->getResponseText();
            $response = json_decode($responseText, true);

            // 有的用户会返回错误的JSON格式,导致PHP出现JSON_ERROR_CTRL_CHAR错误
            // {"subscribe":1,"openid":"o0Mh3tzELt7MrnjqRlzNJ9SXNgMg","nickname":"dyx","sex":2,"language":"zh_CN","city":"bý","province":"VÛ]Ý","country":"","headimgurl":"http:\/\/wx.qlogo.cn\/mmopen\/4ibDOGnEicR5lJbicvZOD5Lonvu3kMYphDMJByD9UYCMOzCXwdVxzDpvnlhJJqjDichASpHUYjd51lLNXicoPdib6ibNnxpsUbFgPN3\/0","subscribe_time":1391064765}
            if ($response === null && json_last_error() !== JSON_ERROR_NONE) {
                // 删除返回数据中的错误控制符
                $responseText = preg_replace('/[\x00-\x1F\x7F]/', '', $responseText);
                $response = json_decode($responseText, true);
            }

            // 3. 如果仍然解析不出来,确实是数据错误
            if ($response === null) {
                throw new \Exception('返回不是有效的JSON数据,数据是' . $userInfo->getResponseText(), -1);
            }

            // 4. 将解析成功的数据,设置回去
            $userInfo->setOption('response', $response);

            return $userInfo;
        });
    }
483640
public function watch( $lang = null ) {

		Hooks::runHook( 'StartWatch' );

		pecho( "Watching {$this->title}...\n\n", PECHO_NOTICE );

		$tokens = $this->wiki->get_tokens();

		if( $tokens['watch'] == '+\\' ) {
			pecho( "User has logged out.\n\n", PECHO_FATAL );
			return false;
		}

		$apiArray = array(
			'action' => 'watch',
			'token'  => $tokens['watch'],
			'title'  => $this->title
		);

		if( !is_null( $lang ) ) $apiArray['uselang'] = $lang;

		$result = $this->wiki->apiQuery( $apiArray, true );

		if( isset( $result['watch'] ) ) {
			if( isset( $result['watch']['watched'] ) ) {
				return true;
			} else {
				pecho( "Watch error...\n\n" . print_r( $result['watch'], true ) . "\n\n", PECHO_FATAL );
				return false;
			}
		} else {
			pecho( "Watch error...\n\n" . print_r( $result, true ), PECHO_FATAL );
			return false;
		}

	}
156027
def get_user_info(self, user_id, lang="zh_CN"):
        
        return self.get(
            url="https://api.weixin.qq.com/cgi-bin/user/info",
            params={
                "access_token": self.token,
                "openid": user_id,
                "lang": lang
            }
        )
78103
public function getLangName( $lang = false ) {
		$lang = $lang ? $this->normalizeLang( $lang ) : $this->getLang();
		return $this->getLangNames()[$lang] ?? '';
	}
1200505
public function getUserInfo($openid){
        if (!$this->access_token && !$this->checkAuth()) return false;
        $result = $this->http_get(self::API_URL_PREFIX.self::USER_INFO_URL.'access_token='.$this->access_token.'&openid='.$openid);
        if ($result)
        {
            $json = json_decode($result,true);
            if (isset($json['errcode'])) {
                $this->errCode = $json['errcode'];
                $this->errMsg = $json['errmsg'];
                return false;
            }
            return $json;
        }
        return false;
    }
875016
public function get_user_group($open_id)
    {
        $url = self::API_DOMAIN . 'cgi-bin/groups/getid?access_token=' .$this->get_access_token();
        $xml = sprintf('{"openid":"%s"}', $open_id);
        $res = HttpCurl::post($url, $xml, 'json');
        // 异常处理: 获取时网络错误
        if ($res === false) {
            return Error::code('ERR_POST');
        }
        // 判断是否调用成功
        if (isset($res->groupid)) {
            return array(null, $res);
        } else {
            return array($res, null);
        }
    }
568356
public function getUserGroupId($openId)
    {
        $result = $this->httpRaw(self::WECHAT_USER_GROUP_ID_GET_PREFIX, [
            'openid' => $openId
        ], [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['groupid']) ? $result['groupid'] : false;
    }
464903
public function getUserInfo($accessToken, $openid)
    {
        $apiUrl = 'https://api.weixin.qq.com/sns/userinfo';

        if ($result = $this->_curl($apiUrl, [
            'access_token' => $accessToken,
            'openid' => $openid,
            'lang' => 'zh_CN',
        ])) {
            unset($result['errcode'], $result['errmsg']);
            return $result;
        } else {
            return null;
        }
    }
659931
public function validLang($lang)
    {
        if (in_array($lang, $this->validLanguages)) {
            return $lang;
        }
        if ($this->defaultLanguage) {
            return $this->defaultLanguage;
        }
        return false;
    }
1148886
public static UserInfoList userInfoBatchget(String access_token,String lang,List<String> openids){
		return userInfoBatchget(access_token, lang, openids,0);
	}