简体   繁体   English

如何使用 PHP Api 访问 Google Cloud Storage Buckets 及其对象

[英]How to access Google Cloud Storage Buckets and its objects using a PHP Api

First of all, I'm a Fresher php developer and i'm required by my product based company to automate the install and uninstall reports of their Android app which are available on Play Developers console.首先,我是一名新手 php 开发人员,我的产品公司要求我自动生成他们的 Android 应用程序的安装和卸载报告,这些报告可在 Play Developers 控制台上找到。

I have created a Service account and i'm following the steps given in the following documentation( Here ) but somehow i'm stuck somewhere and i can't seem to move forward with it.我已经创建了一个服务帐户,我正在按照以下文档( 此处)中给出的步骤进行操作,但不知何故我被困在某个地方,我似乎无法继续前进。 I want to fetch the data of app installs and uninstalls on a regular basis.我想定期获取应用安装和卸载的数据。

I installed the google client php api library as follows which i got from Github here -我安装的是谷歌的客户端PHP API库如下这是我从Github上了这里-

include __DIR__.'/vendor/autoload.php'; 

Now, on the cloud storage examples they have mentioned something like this -现在,在云存储示例中,他们提到了这样的事情——

include __DIR__.'/vendor/autoload.php'; 

use Google\Cloud\Storage\StorageClient;

and using this i'm getting the following error -并使用它我收到以下错误 -

Fatal error: Uncaught Error: Class 'Google\\Cloud\\Storage\\StorageClient' >not found in /home/USERNAME/public_html/appreport/report/index.php:31 >Stack trace: #0 {main} thrown in >/home/USERNAME/public_html/appreport/report/index.php on line 31致命错误:未捕获的错误:类 'Google\\Cloud\\Storage\\StorageClient' > 在 /home/USERNAME/public_html/appreport/report/index.php:31 > 堆栈跟踪:#0 {main} 中抛出 >/home /USERNAME/public_html/appreport/report/index.php 第 31 行

It would be really great if someone could help me with this如果有人能帮我解决这个问题,那就太好了

Have you properly installed the storage client using composer?您是否使用 composer 正确安装了存储客户端? Per this page:每页:

https://googleapis.github.io/google-cloud-php/#/docs/google-cloud/v0.122.0/storage/readme

That would be my guess.那将是我的猜测。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM