Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'Google_Service' not found in apiclient-services\autoload.php on line 21 #384

Closed
hakimio opened this issue Jun 23, 2021 · 3 comments
Closed

Comments

@hakimio
Copy link

hakimio commented Jun 23, 2021

@bshaffer
After upgrading to the latest version of google\apiclient-services, I started getting warnings like the following:

Class 'Google_Service' not found in apiclient-services\autoload.php on line 21

Environment details

  • OS: Windows 10
  • PHP version: 7.4
  • Package name and version: google/apiclient v2.9.2

Steps to reproduce

  1. Use composer autoload to load class files.
@hakimio
Copy link
Author

hakimio commented Jun 23, 2021

Ok, I think I found out what's the real issue:
Following:

echo Google_Client::LIBVER;

returns:

2.7.2

and the following:

echo \Google\Client::LIBVER;

returns:

2.9.1

Some caching issue?

Maybe instead of the following check:

version_compare(Google_Client::LIBVER, '2.7.2', '<=')

you should just check if the class exists:

!class_exists('Google\\Client')

@hakimio
Copy link
Author

hakimio commented Jun 23, 2021

I guess it's the same issue as described here.

@hakimio
Copy link
Author

hakimio commented Jun 23, 2021

Issue on my end. Had left-over apiclient/src/Google directory after composer vendor directory upload. Wonder why composer was still loading it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant