updated plugin WP Mail SMTP
version 2.1.1
This commit is contained in:
@ -79,21 +79,24 @@ class AuthTokenSubscriber implements SubscriberInterface
|
||||
/**
|
||||
* Updates the request with an Authorization header when auth is 'fetched_auth_token'.
|
||||
*
|
||||
* use GuzzleHttp\Client;
|
||||
* use Google\Auth\OAuth2;
|
||||
* use Google\Auth\Subscriber\AuthTokenSubscriber;
|
||||
* Example:
|
||||
* ```
|
||||
* use GuzzleHttp\Client;
|
||||
* use Google\Auth\OAuth2;
|
||||
* use Google\Auth\Subscriber\AuthTokenSubscriber;
|
||||
*
|
||||
* $config = [..<oauth config param>.];
|
||||
* $oauth2 = new OAuth2($config)
|
||||
* $subscriber = new AuthTokenSubscriber($oauth2);
|
||||
* $config = [..<oauth config param>.];
|
||||
* $oauth2 = new OAuth2($config)
|
||||
* $subscriber = new AuthTokenSubscriber($oauth2);
|
||||
*
|
||||
* $client = new Client([
|
||||
* 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/',
|
||||
* 'defaults' => ['auth' => 'google_auth']
|
||||
* ]);
|
||||
* $client->getEmitter()->attach($subscriber);
|
||||
* $client = new Client([
|
||||
* 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/',
|
||||
* 'defaults' => ['auth' => 'google_auth']
|
||||
* ]);
|
||||
* $client->getEmitter()->attach($subscriber);
|
||||
*
|
||||
* $res = $client->get('myproject/taskqueues/myqueue');
|
||||
* $res = $client->get('myproject/taskqueues/myqueue');
|
||||
* ```
|
||||
*
|
||||
* @param BeforeEvent $event
|
||||
*/
|
||||
|
@ -78,7 +78,8 @@ class ScopedAccessTokenSubscriber implements SubscriberInterface
|
||||
$this->tokenFunc = $tokenFunc;
|
||||
if (!(is_string($scopes) || is_array($scopes))) {
|
||||
throw new \InvalidArgumentException(
|
||||
'wants scope should be string or array');
|
||||
'wants scope should be string or array'
|
||||
);
|
||||
}
|
||||
$this->scopes = $scopes;
|
||||
|
||||
@ -102,28 +103,30 @@ class ScopedAccessTokenSubscriber implements SubscriberInterface
|
||||
/**
|
||||
* Updates the request with an Authorization header when auth is 'scoped'.
|
||||
*
|
||||
* E.g this could be used to authenticate using the AppEngine
|
||||
* AppIdentityService.
|
||||
* E.g this could be used to authenticate using the AppEngine AppIdentityService.
|
||||
*
|
||||
* use google\appengine\api\app_identity\AppIdentityService;
|
||||
* use Google\Auth\Subscriber\ScopedAccessTokenSubscriber;
|
||||
* use GuzzleHttp\Client;
|
||||
* Example:
|
||||
* ```
|
||||
* use google\appengine\api\app_identity\AppIdentityService;
|
||||
* use Google\Auth\Subscriber\ScopedAccessTokenSubscriber;
|
||||
* use GuzzleHttp\Client;
|
||||
*
|
||||
* $scope = 'https://www.googleapis.com/auth/taskqueue'
|
||||
* $subscriber = new ScopedAccessToken(
|
||||
* 'AppIdentityService::getAccessToken',
|
||||
* $scope,
|
||||
* ['prefix' => 'Google\Auth\ScopedAccessToken::'],
|
||||
* $cache = new Memcache()
|
||||
* );
|
||||
* $scope = 'https://www.googleapis.com/auth/taskqueue'
|
||||
* $subscriber = new ScopedAccessToken(
|
||||
* 'AppIdentityService::getAccessToken',
|
||||
* $scope,
|
||||
* ['prefix' => 'Google\Auth\ScopedAccessToken::'],
|
||||
* $cache = new Memcache()
|
||||
* );
|
||||
*
|
||||
* $client = new Client([
|
||||
* 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/',
|
||||
* 'defaults' => ['auth' => 'scoped']
|
||||
* ]);
|
||||
* $client->getEmitter()->attach($subscriber);
|
||||
* $client = new Client([
|
||||
* 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/',
|
||||
* 'defaults' => ['auth' => 'scoped']
|
||||
* ]);
|
||||
* $client->getEmitter()->attach($subscriber);
|
||||
*
|
||||
* $res = $client->get('myproject/taskqueues/myqueue');
|
||||
* $res = $client->get('myproject/taskqueues/myqueue');
|
||||
* ```
|
||||
*
|
||||
* @param BeforeEvent $event
|
||||
*/
|
||||
|
@ -62,19 +62,22 @@ class SimpleSubscriber implements SubscriberInterface
|
||||
/**
|
||||
* Updates the request query with the developer key if auth is set to simple.
|
||||
*
|
||||
* use Google\Auth\Subscriber\SimpleSubscriber;
|
||||
* use GuzzleHttp\Client;
|
||||
* Example:
|
||||
* ```
|
||||
* use Google\Auth\Subscriber\SimpleSubscriber;
|
||||
* use GuzzleHttp\Client;
|
||||
*
|
||||
* $my_key = 'is not the same as yours';
|
||||
* $subscriber = new SimpleSubscriber(['key' => $my_key]);
|
||||
* $my_key = 'is not the same as yours';
|
||||
* $subscriber = new SimpleSubscriber(['key' => $my_key]);
|
||||
*
|
||||
* $client = new Client([
|
||||
* 'base_url' => 'https://www.googleapis.com/discovery/v1/',
|
||||
* 'defaults' => ['auth' => 'simple']
|
||||
* ]);
|
||||
* $client->getEmitter()->attach($subscriber);
|
||||
* $client = new Client([
|
||||
* 'base_url' => 'https://www.googleapis.com/discovery/v1/',
|
||||
* 'defaults' => ['auth' => 'simple']
|
||||
* ]);
|
||||
* $client->getEmitter()->attach($subscriber);
|
||||
*
|
||||
* $res = $client->get('drive/v2/rest');
|
||||
* $res = $client->get('drive/v2/rest');
|
||||
* ```
|
||||
*
|
||||
* @param BeforeEvent $event
|
||||
*/
|
||||
|
Reference in New Issue
Block a user