Unable to include Cloud Storage Tools library in App Engine

会有一股神秘感。 提交于 2020-01-05 22:18:44

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/28769342/unable-to-include-cloud-storage-tools-library-in-app-engine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!