无法在App Engine中包含云端存储工具库 [英] Unable to include Cloud Storage Tools library in App Engine

查看:151
本文介绍了无法在App Engine中包含云端存储工具库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的CodeIgniter项目中,我无法包含大量示例PHP代码中使用的云存储工具PHP库。



我已将以下内容一个Controller扩展的顶部,但我在尝试使用CloudStorageTools :: createUploadUrl()时出现错误

  require_once' google / appengine / api / cloud_storage / CloudStorageTools.php'; 
使用google\appengine\api\cloud_storage\CloudStorageTools;

这是错误:


PHP致命错误:找不到类'CloudStorageTools'


p>

我认为这个库是自动存在的(看来有一个自动的Google云端存储包装,所以你可以使用gs://上传),但似乎这不是

$ p

解决方案

您不需要require_once语句,因为所有SDK类都自动加载: https://cloud.google.com/appengine/docs/php/#PHP_Automatic_class_loading


In my CodeIgniter project, I am unable to include the Cloud Storage Tools PHP library, as used in lots of example PHP code.

I have put the following at the top of an Controller extension, but I get an error when trying to use "CloudStorageTools::createUploadUrl()"

require_once 'google/appengine/api/cloud_storage/CloudStorageTools.php';
use google\appengine\api\cloud_storage\CloudStorageTools;

This is the error:

PHP Fatal error: Class 'CloudStorageTools' not found

Is this library automatically in the App Engine?

I thought this library was automatically there (seeing as there is an automatic Google Cloud Storage wrapper so you can use gs:// for uploading) but it seems like this isn't the case.

解决方案

You don't need the "require_once" statement as all SDK classes are auto-loaded: https://cloud.google.com/appengine/docs/php/#PHP_Automatic_class_loading

这篇关于无法在App Engine中包含云端存储工具库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆