googleapis / google-api-php-client

A PHP client library for accessing Google APIs
Apache License 2.0
9.22k stars 3.52k forks source link

google/apiclient-services 0.303.0 changes php version requirement #2450

Closed Gerben-T closed 1 year ago

Gerben-T commented 1 year ago

google/apiclient v2.14.0 says it supports php ^5.6|^7.0|^8.0, but requires google/apiclient-services ~0.200 which will translate to 0.303.0, at time of writing this, and that version does not support php ^7.0 but instead ^7.4 which breaks on a system running php 7.2

Environment details

Steps to reproduce

N/A

Code example

N/A

vishwarajanand commented 1 year ago

@Gerben we have migrated away from supporting php<7.4 versions. Like you said, it was done in v0.303.0.

I'd recommend you to pin the dependency version, till we resolve the release.

bshaffer commented 1 year ago

@Gerben-T If you run composer install on PHP 7.2, Composer should be smart enough to avoid installing that version, and instead install the last version of google/apiclient-services which supports PHP 7.2.

However, if you're downloading the ZIP files for the releases, as noted in the filenames they will only work for the PHP versions listed.

As long as Composer is used correctly, and/or only the correctly labeled releases are installed, there should be no way for this change to "break" on a system running php 7.2. If this DID happen, please tell me the exact steps you followed so we can try to address it, as we want to make sure existing code on those systems does not break.

bshaffer commented 1 year ago

I just ran this locally to be 100% certain:

$ php -v
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.34, Copyright (c) 1999-2018, by Zend Technologies
$ composer require google/apiclient
Using version ^2.14 for google/apiclient
./composer.json has been created
Running composer update google/apiclient
Loading composer repositories with package information
Updating dependencies
Lock file operations: 18 installs, 0 updates, 0 removals
  - Locking firebase/php-jwt (v6.4.0)
  - Locking google/apiclient (v2.14.0)
  - Locking google/apiclient-services (v0.302.0)
  - Locking google/auth (v1.26.0)
  - Locking guzzlehttp/guzzle (7.7.0)
  - Locking guzzlehttp/promises (2.0.0)
  - Locking guzzlehttp/psr7 (2.5.0)
  - Locking monolog/monolog (2.9.1)
  - Locking paragonie/constant_time_encoding (v2.6.3)
  - Locking paragonie/random_compat (v9.99.100)
  - Locking phpseclib/phpseclib (3.0.19)
  - Locking psr/cache (1.0.1)
  - Locking psr/http-client (1.0.2)
  - Locking psr/http-factory (1.0.2)
  - Locking psr/http-message (1.1)
  - Locking psr/log (1.1.4)
  - Locking ralouphie/getallheaders (3.0.3)
  - Locking symfony/deprecation-contracts (v2.5.2)
Writing lock file...

As you can see, the dependencies google/apiclient (v2.14.0) and google/apiclient-services (v0.302.0) were installed, which are both compatible with PHP 7.2.

Please reopen this issue (or file a new one) if there's something I'm missing that can cause existing PHP 7.2 code to break.