不推荐使用google-api-php-client的自动加载器 [英] google-api-php-client's autoloader deprecated

查看:215
本文介绍了不推荐使用google-api-php-client的自动加载器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为测试,我在PHP中运行了一行代码来实现PHP客户端库。


$ b

indexTest.php



 <?php 
require_once realpath(dirname(__ FILE __)。'/ google-api-php-client / autoload.php');
return;

我得到这个错误:


已弃用:google-api-php-client的自动加载器已移至1.1.3中的src / Google / autoload.php。这个重定向将在1.2中被删除。请调整您的代码以使用新位置。在C:\用户\名称\文档\academic-being-90217\google-api-php-client\autoload.php在线25


我需要做些什么来解决这个问题?

解决方案

快速修复:


$ b $ p $ require_once realpath(dirname(__ FILE __)。'/ google-api-php-client / src / Google / autoload.php');



Google需要更新他们的API文档。 (我最近花了一段时间让自己陷入了一片混乱之中,试图通过他们的文档使它工作)。



你最终使用API​​的目标是什么?它只是用于登录?如果您需要任何帮助,我将非常乐意与您讨论任何不适当的事情。


As a test, I ran one line of code in PHP to implement the PHP Client Library.

indexTest.php

<?php
require_once realpath(dirname(__FILE__).'/google-api-php-client/autoload.php');
return;

I get this error:

Deprecated: google-api-php-client's autoloader was moved to src/Google/autoload.php in 1.1.3. This redirect will be removed in 1.2. Please adjust your code to use the new location. in C:\Users\NoName\Documents\academic-being-90217\google-api-php-client\autoload.php on line 25

What do I need to do to fix this?

解决方案

Quick Fix:

require_once realpath(dirname(__FILE__).'/google-api-php-client/src/Google/autoload.php');

Google need to update their documentation on the API. (I spent quite a while getting myself in a fuddle recently, trying to get it working using their documentation).

What is you final aim on using the API? Is it just for Login? If you need any help with it, I'll be more than happy to talk you through anything that isn't working as it should be

这篇关于不推荐使用google-api-php-client的自动加载器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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