예제 #1
0
 protected function requestDownload($url, $dir = '', $filename = '')
 {
     $params['access_token'] = $this->access_token->get();
     $params = array_merge($params, $this->_data);
     $contents = $this->http->get($url, $params)->getRequest();
     Error::check(json_decode($contents['data'], true));
     $ext = File::getStreamExt($contents['headers']);
     $filename = $filename ? $filename : md5($contents['data']) . $ext;
     file_put_contents($filename, $contents['data']);
     return $dir . $filename;
 }
예제 #2
0
파일: Auth.php 프로젝트: wailovet/wechat-qy
 private function getUserFromCode($userid)
 {
     $access_token = $this->access_token->get();
     $data = $this->http->get(self::CORP_USERINFO_URL . "?access_token={$access_token}&userid={$userid}")->getJsonToArray();
     return Error::check($data);
 }