我正在尝试利用项目GuzzleHttp库(我认为是4.1.2版)中的现有库,但是我遇到了致命错误
调用未定义函数GuzzleHttp \ deprecation_proxy()
下面的代码
public function downloadAttachment($url, $name, $session)
{
$path = '/local/path/to/.'$name;
$file_path = fopen($path,'w');
$client = new \GuzzleHttp\Client();
$cookieJar = \GuzzleHttp\Cookie\CookieJar::fromArray(['session' => $session], 'localhost');
$response = $client->request('GET', $url, ['save_to' => $file_path, 'cookies' => $cookieJar]);
return ['response_code'=>$response->getStatusCode(), 'name' => $name];
}
对此有何想法?旁注-由于项目中已有代码,我无法更新GuzzleHttp。