我已经使用composer安装google api php,并将vendor文件夹上传到我的服务器。
php composer.phar require google/apiclient:^2.0
我的代码:getVideo.php
<?
require_once __DIR__ . '/vendor/autoload.php';
define('ID_VIDEO', '0B9SXFdezvkZtOE9xVlVNR3U0a1U');
$client = new Google_Client();
$client->setApplicationName("LOAD_VIDEO");
$client->setDeveloperKey("AIzaSyD1AVpO4qBgH0JmQOEU_xxxx");
$client->addScope(Google_Service_Drive::DRIVE);
$client->setAccessType('offline_access');
session_start();
if (isset($_SESSION['token'])) {
$client->setAccessToken($_SESSION['token']);
}
$service = new Google_DriveService($client);
$file = $service->files->get(ID_VIDEO);
$access_toke = json_decode($client->getAccessToken(), TRUE);
$access_toke = $access_toke['access_token'];
?>
<embed width="100%" height="100%" name="plugin" src="<?= urldecode($file['embedLink']);?>&access_token=<?= $access_toke;?>" type="application/x-shockwave-flash" >
我收到了错误代码:
致命错误:第18行的/home/myserver/public_html/getVideo.php中找不到“Google_DriveService”类
我在文件夹供应商中找不到google_driveservice的文件,我错过了什么吗?