在google-api-php-client-master中缺少vendor / autoload.php

问题描述 投票:0回答:2

在google-api-php-client-master中没有像供应商这样的文件夹,而在搜索autoload.php时我发现它在C:\wamp\www\gapi\google-api-php-client-master\src\Google\autoload.php

Google\autoload.php查看源代码时,它再次在第21行请求/vendor/autoload.php但没有文件夹名称供应商。我还通过下载https://github.com/google/google-api-php-client的拉链包括完整的包装

大多数搜索都没有为我提供解决方案,但我发现了很多关于这个主题的文章。有人帮我这个。

错误:

致命错误:未捕获的异常'Exception',带有消息'此库必须通过composer安装或下载完整的软件包。请参阅第14行C:\ wamp \ www \ gapi \ google-api-php-client-master \ src \ Google \ autoload.php中的说明at_ _ _'

文件内容(autoload.php):

$file = __DIR__ . '/../../vendor/autoload.php';

if (!file_exists($file)) {
  $exception = 'This library must be installed via composer or by downloading the full package.';
  $exception .= ' See the instructions at https://github.com/google/google-api-php-client#installation.';
  throw new **Exception($exception);
php composer-php google-calendar-api
2个回答
1
投票

您需要从https://github.com/google/google-api-php-client/releases而不是https://github.com/google/google-api-php-client.下载文件夹/版本

安装指南可让您了解此信息:

如果您厌恶使用作曲家,可以完整下载该软件包。 Releases页面列出了所有稳定版本。

我犯了同样的错误,但是使用发布页面中的最新稳定版本修复了它。


0
投票

使用命令“composer require google / apiclient:^ 2.0”的作曲家来安装包

要么

https://github.com/google/google-api-php-client/releases的任何发布

但是无法通过从https://github.com/google/google-api-php-client(google-api-php-client-master.zip)直接下载找到包装供应商,使用以上两种方式中的任何一种并确保快速启动,你需要在https://developers.google.com/google-apps/calendar/quickstart/php指导

© www.soinside.com 2019 - 2024. All rights reserved.