Closed Ttakeleif closed 3 years ago
stick to 2.7.x (unfortunately not my case because I use it indirectly via lib with dependency like ^2.x)
Btw you can still "fix" this yourself my (temporary) making it a root dependency in your project for 2.7, so you wouldn't have to resort the build step. At least I would like to think so that this should work.
@mfn I solved the conflict by adding
"require": {
"google/apiclient": "2.7.2 as 2.8.0"
}
to composer.json. Though I have to retest the functionality for any possible issues because of that blatant substitution 🤞 😄
Thank you for reporting this, I will look into how to fix it. In the meantime, you can just require google/apiclient:2.7.2
rather than use an alias for 2.8.0 as you do above:
"require": {
"google/apiclient": "2.7.2"
}
The issue with your transitive dependency is you need to remove composer.lock
and vendor
before updating with the above require.
@Ttakeleif this is now fixed! Update to v.2.8.1 and you'll be all set!
@bshaffer I can confirm the issue is fixed.
Does this mean the class_exists line in src/aliases.php is no longer needed?
Edit: Just saw this was the fix for this issue. I'm still getting a problem while running docker container php7.4-apache. I am able to avoid the issue by using 2.8.0 though.
@snoogans235 is it possible this will fix your issue?
https://github.com/googleapis/google-api-php-client/pull/1991
@bshaffer Is this solved in 2.8.3? because I still get the warnings.
PHP Warning: Can't preload already declared class Google_Utils_UriTemplate
I got the same issue again for 2.8.3
After merge PR preload send warnings. https://github.com/googleapis/google-api-php-client/pull/1995
I'm not sure that this fix has been sufficient. I am running v. 2.9.1 of "google/apiclient" and I get the following output:
Can't preload already declared class Google_Utils_UriTemplate in /code/platform/vendor/go
ogle/apiclient/src/aliases.php on line 64
Can't preload already declared class Google_Task_Runner in /code/platform/vendor/google/a
piclient/src/aliases.php on line 63
Can't preload already declared class Google_Task_Retryable in /code/platform/vendor/googl
e/apiclient/src/aliases.php on line 62
Can't preload already declared class Google_Task_Exception in /code/platform/vendor/googl
e/apiclient/src/aliases.php on line 61
Can't preload already declared class Google_Service_Resource in /code/platform/vendor/goo
gle/apiclient/src/aliases.php on line 60
Can't preload already declared class Google_Service_Exception in /code/platform/vendor/go
ogle/apiclient/src/aliases.php on line 59
Can't preload already declared class Google_Service in /code/platform/vendor/google/apicl
ient/src/aliases.php on line 58
Can't preload already declared class Google_Model in /code/platform/vendor/google/apiclie
nt/src/aliases.php on line 57
Can't preload already declared class Google_Http_REST in /code/platform/vendor/google/api
client/src/aliases.php on line 56
Can't preload already declared class Google_Http_MediaFileUpload in /code/platform/vendor
/google/apiclient/src/aliases.php on line 55
Can't preload already declared class Google_Http_Batch in /code/platform/vendor/google/ap
iclient/src/aliases.php on line 54
Can't preload already declared class Google_Exception in /code/platform/vendor/google/api
client/src/aliases.php on line 53
Can't preload already declared class Google_Collection in /code/platform/vendor/google/ap
iclient/src/aliases.php on line 52
Can't preload already declared class Google_Client in /code/platform/vendor/google/apicli
ent/src/aliases.php on line 51
Can't preload already declared class Google_AuthHandler_Guzzle7AuthHandler in /code/platf
orm/vendor/google/apiclient/src/aliases.php on line 50
Can't preload already declared class Google_AuthHandler_Guzzle6AuthHandler in /code/platf
orm/vendor/google/apiclient/src/aliases.php on line 49
Can't preload already declared class Google_AuthHandler_Guzzle5AuthHandler in /code/platf
orm/vendor/google/apiclient/src/aliases.php on line 48
Can't preload already declared class Google_AuthHandler_AuthHandlerFactory in /code/platf
orm/vendor/google/apiclient/src/aliases.php on line 47
Can't preload already declared class Google_AccessToken_Verify in /code/platform/vendor/g
oogle/apiclient/src/aliases.php on line 46
Can this issue perhaps be reopened?
@nmeirik they fixed it in google\apiclient
, but the same issue exists in google\apiclient-services
library which is not fixed.
My bug report.
EDIT: seems to be an issue on my end. I had left-over directory after composer vendor directory upload.
@nmeirik I missed your comment because this issue is closed. Were you able to get it resolved? If not can you open a new issue? Thanks.
@bshaffer I realized that is was just a warning and not a blocker as I initially thought, so I moved on.
There is no such thing as "warning and not a blocker". Whenever you have warnings AND ALSO a crash for which you seek support, the first question you'll get asked is "are there any warnings"?
Environment details
Steps to reproduce
I have an issue with aliases in Symfony app optimized for PHP 7.4 preloading feature. It loads all the required classes at once and conflicts with the aliases file which leads to numerous errors like
Could you please make it optional or add checking that those classes are not defined yet?
For those who have the same issue possible solutions are
echo '<?php' > ./vendor/google/apiclient/src/aliases.php