是否可以使用PHP从Google Team Drive获取所有照片?
<?php
require_once '/vendor/autoload.php';
$client = new Google_Client();
$client->setApplicationName('Google Drive API PHP Quickstart');
$client->setScopes(Google_Service_Drive::DRIVE);
$client->setAuthConfig(__DIR__ . '/themejson.json');
//$client->setAccessType('offline');
$service = new Google_Service_Drive($client);
$folderId = 'xxxxxxxxxxxxx';
// Print the names and IDs for up to 10 files.
$optParams = array(
"q" => "'$folderId' in parents",
'pageSize' => 20,
'corpora' => "user,allTeamDrives",
'includeTeamDriveItems' => true,
'supportsTeamDrives' => true
);
$results = $service->files->listFiles($optParams);
if (count($results->getFiles()) == 0) {
print "No files found.\n";
} else {
print "Files:\n";
foreach ($results->getFiles() as $file) {
printf("%s (%s)\n", $file->getName(), $file->getId());
}
}
?>
时,什么也没有返回