Support
Quality
Security
License
Reuse
kandi has reviewed google-cloud-php and discovered the below as its top functions. This is intended to give you an instant insight into google-cloud-php implemented functionality, and help decide if they suit your requirements.
Get all kandi verified functions for this library.
Get all kandi verified functions for this library.
Google Cloud Client Library for PHP
See all related Code Snippets
QUESTION
(Could not construct ApplicationDefaultCredentials) for PHP dialogflow
Asked 2022-Mar-10 at 10:38use Google\Cloud\Storage\StorageClient;
use Google\Cloud\Dialogflow\V2\EntityTypesClient;
$storage = new StorageClient([
'keyFile' => json_decode(file_get_contents(storage_path('app/public/tunepath-bot-tkpf-811257321355.json')), true)
]);
$entityTypesClient = new EntityTypesClient();
$projectId = '[project_id]';
$entityTypeId = '[ENTITY_TYPE_ID]';
$formattedEntityTypeName = $entityTypesClient->entityTypeName($projectId, $entityTypeId);
$entityType = $entityTypesClient->getEntityType($formattedEntityTypeName);
foreach ($entityType->getEntities() as $entity) {
print(PHP_EOL);
printf('Entity value: %s' . PHP_EOL, $entity->getValue());
print('Synonyms: ');
foreach ($entity->getSynonyms() as $synonym) {
print($synonym . "\t");
}
print(PHP_EOL);
}
I have done according to documentation https://github.com/googleapis/google-cloud-php-dialogflow. I got this error - Could not construct ApplicationDefaultCredentials
ANSWER
Answered 2022-Mar-10 at 10:38putenv("GOOGLE_APPLICATION_CREDENTIALS=$path");
$path -> path to google service acccount json file. put this code above.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
Save this library and start creating your kit
Open Weaver – Develop Applications Faster with Open Source