Mise à jour des librairies
This commit is contained in:
32
vendor/google/apiclient/README.md
vendored
32
vendor/google/apiclient/README.md
vendored
@@ -2,21 +2,17 @@
|
||||
|
||||
# Google APIs Client Library for PHP #
|
||||
|
||||
## Library maintenance
|
||||
This client library is supported but in maintenance mode only. We are fixing necessary bugs and adding essential features to ensure this library continues to meet your needs for accessing Google APIs. Non-critical issues will be closed. Any issue may be reopened if it is causing ongoing problems.
|
||||
|
||||
## Description ##
|
||||
The Google API Client Library enables you to work with Google APIs such as Google+, Drive, or YouTube on your server.
|
||||
|
||||
## Beta ##
|
||||
This library is in Beta. We're comfortable enough with the stability and features of the library that we want you to build real production applications on it. We will make an effort to support the public and protected surface of the library and maintain backwards compatibility in the future. While we are still in Beta, we reserve the right to make incompatible changes.
|
||||
These client libraries are officially supported by Google. However, the libraries are considered complete and are in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.
|
||||
|
||||
## Google Cloud Platform
|
||||
|
||||
For Google Cloud Platform APIs such as Datastore, Cloud Storage or Pub/Sub, we recommend using [GoogleCloudPlatform/google-cloud-php](https://github.com/GoogleCloudPlatform/google-cloud-php) which is under active development.
|
||||
|
||||
## Requirements ##
|
||||
* [PHP 5.4.0 or higher](http://www.php.net/)
|
||||
|
||||
## Google Cloud Platform APIs
|
||||
If you're looking to call the **Google Cloud Platform** APIs, you will want to use the [Google Cloud PHP](https://github.com/googlecloudplatform/google-cloud-php) library instead of this one.
|
||||
|
||||
## Developer Documentation ##
|
||||
http://developers.google.com/api-client-library/php
|
||||
|
||||
@@ -125,6 +121,11 @@ foreach ($results as $item) {
|
||||
|
||||
> An example of this can be seen in [`examples/service-account.php`](examples/service-account.php).
|
||||
|
||||
Some APIs
|
||||
(such as the [YouTube Data API](https://developers.google.com/youtube/v3/)) do
|
||||
not support service accounts. Check with the specific API documentation if API
|
||||
calls return unexpected 401 or 403 errors.
|
||||
|
||||
1. Follow the instructions to [Create a Service Account](https://developers.google.com/api-client-library/php/auth/service-accounts#creatinganaccount)
|
||||
1. Download the JSON credentials
|
||||
1. Set the path to these credentials using the `GOOGLE_APPLICATION_CREDENTIALS` environment variable:
|
||||
@@ -264,14 +265,21 @@ $response = $httpClient->get('https://www.googleapis.com/plus/v1/people/me');
|
||||
It is recommended to use another caching library to improve performance. This can be done by passing a [PSR-6](http://www.php-fig.org/psr/psr-6/) compatible library to the client:
|
||||
|
||||
```php
|
||||
$cache = new Stash\Pool(new Stash\Driver\FileSystem);
|
||||
use League\Flysystem\Adapter\Local;
|
||||
use League\Flysystem\Filesystem;
|
||||
use Cache\Adapter\Filesystem\FilesystemCachePool;
|
||||
|
||||
$filesystemAdapter = new Local(__DIR__.'/');
|
||||
$filesystem = new Filesystem($filesystemAdapter);
|
||||
|
||||
$cache = new FilesystemCachePool($filesystem);
|
||||
$client->setCache($cache);
|
||||
```
|
||||
|
||||
In this example we use [StashPHP](http://www.stashphp.com/). Add this to your project with composer:
|
||||
In this example we use [PHP Cache](http://www.php-cache.com/). Add this to your project with composer:
|
||||
|
||||
```
|
||||
composer require tedivm/stash
|
||||
composer require cache/filesystem-adapter
|
||||
```
|
||||
|
||||
### Updating Tokens ###
|
||||
|
||||
2
vendor/google/apiclient/composer.json
vendored
2
vendor/google/apiclient/composer.json
vendored
@@ -16,7 +16,7 @@
|
||||
"guzzlehttp/psr7": "^1.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4",
|
||||
"phpunit/phpunit": "~4.8.36",
|
||||
"squizlabs/php_codesniffer": "~2.3",
|
||||
"symfony/dom-crawler": "~2.1",
|
||||
"symfony/css-selector": "~2.1",
|
||||
|
||||
@@ -178,7 +178,7 @@ class Google_AccessToken_Verify
|
||||
{
|
||||
$certs = null;
|
||||
if ($cache = $this->getCache()) {
|
||||
$cacheItem = $cache->getItem('federated_signon_certs_v3', 3600);
|
||||
$cacheItem = $cache->getItem('federated_signon_certs_v3');
|
||||
$certs = $cacheItem->get();
|
||||
}
|
||||
|
||||
@@ -189,6 +189,7 @@ class Google_AccessToken_Verify
|
||||
);
|
||||
|
||||
if ($cache) {
|
||||
$cacheItem->expiresAt(new DateTime('+1 hour'));
|
||||
$cacheItem->set($certs);
|
||||
$cache->save($cacheItem);
|
||||
}
|
||||
@@ -210,8 +211,8 @@ class Google_AccessToken_Verify
|
||||
$jwtClass = 'Firebase\JWT\JWT';
|
||||
}
|
||||
|
||||
if (property_exists($jwtClass, 'leeway')) {
|
||||
// adds 1 second to JWT leeway
|
||||
if (property_exists($jwtClass, 'leeway') && $jwtClass::$leeway < 1) {
|
||||
// Ensures JWT leeway is at least 1
|
||||
// @see https://github.com/google/google-api-php-client/issues/827
|
||||
$jwtClass::$leeway = 1;
|
||||
}
|
||||
|
||||
22
vendor/google/apiclient/src/Google/Client.php
vendored
22
vendor/google/apiclient/src/Google/Client.php
vendored
@@ -25,7 +25,6 @@ use Google\Auth\Credentials\UserRefreshCredentials;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\ClientInterface;
|
||||
use GuzzleHttp\Ring\Client\StreamHandler;
|
||||
use GuzzleHttp\Psr7;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
@@ -39,7 +38,7 @@ use Monolog\Handler\SyslogHandler as MonologSyslogHandler;
|
||||
*/
|
||||
class Google_Client
|
||||
{
|
||||
const LIBVER = "2.2.1";
|
||||
const LIBVER = "2.2.2";
|
||||
const USER_AGENT_SUFFIX = "google-api-php-client/";
|
||||
const OAUTH2_REVOKE_URI = 'https://accounts.google.com/o/oauth2/revoke';
|
||||
const OAUTH2_TOKEN_URI = 'https://www.googleapis.com/oauth2/v4/token';
|
||||
@@ -211,7 +210,7 @@ class Google_Client
|
||||
|
||||
/**
|
||||
* Fetches a fresh access token with a given assertion token.
|
||||
* @param $assertionCredentials optional.
|
||||
* @param ClientInterface $authHttp optional.
|
||||
* @return array access token
|
||||
*/
|
||||
public function fetchAccessTokenWithAssertion(ClientInterface $authHttp = null)
|
||||
@@ -441,11 +440,16 @@ class Google_Client
|
||||
return $this->token;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getRefreshToken()
|
||||
{
|
||||
if (isset($this->token['refresh_token'])) {
|
||||
return $this->token['refresh_token'];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -480,6 +484,9 @@ class Google_Client
|
||||
return ($created + ($this->token['expires_in'] - 30)) < time();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated See UPGRADING.md for more information
|
||||
*/
|
||||
public function getAuth()
|
||||
{
|
||||
throw new BadMethodCallException(
|
||||
@@ -487,6 +494,9 @@ class Google_Client
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated See UPGRADING.md for more information
|
||||
*/
|
||||
public function setAuth($auth)
|
||||
{
|
||||
throw new BadMethodCallException(
|
||||
@@ -753,7 +763,7 @@ class Google_Client
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @return string|null
|
||||
* @visible For Testing
|
||||
*/
|
||||
public function prepareScopes()
|
||||
@@ -886,7 +896,7 @@ class Google_Client
|
||||
/**
|
||||
* Use when the service account has been delegated domain wide access.
|
||||
*
|
||||
* @param string subject an email address account to impersonate
|
||||
* @param string $subject an email address account to impersonate
|
||||
*/
|
||||
public function setSubject($subject)
|
||||
{
|
||||
@@ -968,7 +978,7 @@ class Google_Client
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Google\Auth\CacheInterface Cache implementation
|
||||
* @param array $cacheConfig
|
||||
*/
|
||||
public function setCacheConfig(array $cacheConfig)
|
||||
{
|
||||
|
||||
@@ -255,8 +255,14 @@ class Google_Service_Resource
|
||||
*/
|
||||
public function createRequestUri($restPath, $params)
|
||||
{
|
||||
// Override the default servicePath address if the $restPath use a /
|
||||
if ('/' == substr($restPath, 0, 1)) {
|
||||
$requestUrl = substr($restPath, 1);
|
||||
} else {
|
||||
$requestUrl = $this->servicePath . $restPath;
|
||||
}
|
||||
|
||||
// code for leading slash
|
||||
$requestUrl = $this->servicePath . $restPath;
|
||||
if ($this->rootUrl) {
|
||||
if ('/' !== substr($this->rootUrl, -1) && '/' !== substr($requestUrl, 0, 1)) {
|
||||
$requestUrl = '/' . $requestUrl;
|
||||
|
||||
Reference in New Issue
Block a user