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

Fatal Error: Undefined constant Google\\Cloud\\PubSub\\PubSubClient::SERVICE_NAME #8000

Open
mrVrAlex opened this issue Jan 8, 2025 · 0 comments

Comments

@mrVrAlex
Copy link

mrVrAlex commented Jan 8, 2025

Hello!
It seems missing constant for PubSubClient:

Here in costruct have calling trait method ClientOptionsTrait::buildClientOptions from Google/ApiCore:
https://github.com/googleapis/google-cloud-php-pubsub/blob/main/src/PubSubClient.php#L191
And there have calling method ClientOptionsTrait::logConfiguration
https://github.com/googleapis/gax-php/blob/main/src/ClientOptionsTrait.php#L147
where access to constant in current client:
https://github.com/googleapis/gax-php/blob/main/src/ClientOptionsTrait.php#L374

Code example

putenv('GOOGLE_SDK_PHP_LOGGING=true');
$pubSub = new PubSubClient();
$topic = $pubSub->topic('my_topic');
$topic->publish([
    'data' => 'My new message.',
    'attributes' => [
        'location' => 'Detroit'
    ]
]);

Environment details

  • OS: Any
  • PHP version: Any
  • Package name and version: Latest
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