updated plugin WP Mail SMTP
version 2.0.0
This commit is contained in:
@ -38,7 +38,7 @@ use Monolog\Handler\SyslogHandler as MonologSyslogHandler;
|
||||
*/
|
||||
class Google_Client
|
||||
{
|
||||
const LIBVER = "2.2.3";
|
||||
const LIBVER = "2.4.1";
|
||||
const USER_AGENT_SUFFIX = "google-api-php-client/";
|
||||
const OAUTH2_REVOKE_URI = 'https://oauth2.googleapis.com/revoke';
|
||||
const OAUTH2_TOKEN_URI = 'https://oauth2.googleapis.com/token';
|
||||
@ -142,6 +142,10 @@ class Google_Client
|
||||
// Service class used in Google_Client::verifyIdToken.
|
||||
// Explicitly pass this in to avoid setting JWT::$leeway
|
||||
'jwt' => null,
|
||||
|
||||
// Setting api_format_v2 will return more detailed error messages
|
||||
// from certain APIs.
|
||||
'api_format_v2' => false
|
||||
],
|
||||
$config
|
||||
);
|
||||
@ -412,6 +416,17 @@ class Google_Client
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the access token used for requests.
|
||||
*
|
||||
* Note that at the time requests are sent, tokens are cached. A token will be
|
||||
* cached for each combination of service and authentication scopes. If a
|
||||
* cache pool is not provided, creating a new instance of the client will
|
||||
* allow modification of access tokens. If a persistent cache pool is
|
||||
* provided, in order to change the access token, you must clear the cached
|
||||
* token by calling `$client->getCache()->clear()`. (Use caution in this case,
|
||||
* as calling `clear()` will remove all cache items, including any items not
|
||||
* related to Google API PHP Client.)
|
||||
*
|
||||
* @param string|array $token
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
@ -789,12 +804,31 @@ class Google_Client
|
||||
*/
|
||||
public function execute(RequestInterface $request, $expectedClass = null)
|
||||
{
|
||||
$request = $request->withHeader(
|
||||
'User-Agent',
|
||||
$this->config['application_name']
|
||||
. " " . self::USER_AGENT_SUFFIX
|
||||
. $this->getLibraryVersion()
|
||||
);
|
||||
$request = $request
|
||||
->withHeader(
|
||||
'User-Agent',
|
||||
sprintf(
|
||||
'%s %s%s',
|
||||
$this->config['application_name'],
|
||||
self::USER_AGENT_SUFFIX,
|
||||
$this->getLibraryVersion()
|
||||
)
|
||||
)
|
||||
->withHeader(
|
||||
'x-goog-api-client',
|
||||
sprintf(
|
||||
'gl-php/%s gdcl/%s',
|
||||
phpversion(),
|
||||
$this->getLibraryVersion()
|
||||
)
|
||||
);
|
||||
|
||||
if ($this->config['api_format_v2']) {
|
||||
$request = $request->withHeader(
|
||||
'X-GOOG-API-FORMAT-VERSION',
|
||||
2
|
||||
);
|
||||
}
|
||||
|
||||
// call the authorize method
|
||||
// this is where most of the grunt work is done
|
||||
@ -1056,6 +1090,18 @@ class Google_Client
|
||||
return $this->http;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the API format version.
|
||||
*
|
||||
* `true` will use V2, which may return more useful error messages.
|
||||
*
|
||||
* @param bool $value
|
||||
*/
|
||||
public function setApiFormatV2($value)
|
||||
{
|
||||
$this->config['api_format_v2'] = (bool) $value;
|
||||
}
|
||||
|
||||
protected function createDefaultHttpClient()
|
||||
{
|
||||
$options = ['exceptions' => false];
|
||||
|
@ -67,9 +67,11 @@ class Google_Http_MediaFileUpload
|
||||
private $httpResultCode;
|
||||
|
||||
/**
|
||||
* @param $mimeType string
|
||||
* @param $data string The bytes you want to upload.
|
||||
* @param $resumable bool
|
||||
* @param Google_Client $client
|
||||
* @param RequestInterface $request
|
||||
* @param string $mimeType
|
||||
* @param string $data The bytes you want to upload.
|
||||
* @param bool $resumable
|
||||
* @param bool $chunkSize File will be uploaded in chunks of this many bytes.
|
||||
* only used if resumable=True
|
||||
*/
|
||||
|
@ -294,7 +294,7 @@ class Google_Service_Resource
|
||||
}
|
||||
|
||||
if (count($queryVars)) {
|
||||
$requestUrl .= '?' . implode($queryVars, '&');
|
||||
$requestUrl .= '?' . implode('&', $queryVars);
|
||||
}
|
||||
|
||||
return $requestUrl;
|
||||
|
Reference in New Issue
Block a user