ich die Liste der Dateien mit der folgenden Code-Abfrage:Wie die Dateiänderungsdaten mit Google Drive bekommen
$service = new \Google_Service_Drive($google->getClient());
$files = $service->files->listFiles();
Dann wird die folgenden Daten zurückgegeben werden (dies ist ein print_r Dump). Alle Felder, die Daten enthalten sollen, sind leer (sie sind eigentlich null). Für alle Dateien. Die Felder, die festgelegt sind (Dateiname, ID usw.), sind korrekt. Warum fehlen die Daten?
[17] => Google_Service_Drive_DriveFile Object
(
[collection_key:protected] => spaces
[appProperties] =>
[capabilitiesType:protected] => Google_Service_Drive_DriveFileCapabilities
[capabilitiesDataType:protected] =>
[contentHintsType:protected] => Google_Service_Drive_DriveFileContentHints
[contentHintsDataType:protected] =>
[createdTime] =>
[description] =>
[explicitlyTrashed] =>
[fileExtension] =>
[folderColorRgb] =>
[fullFileExtension] =>
[hasAugmentedPermissions] =>
[hasThumbnail] =>
[headRevisionId] =>
[iconLink] =>
[id] => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[imageMediaMetadataType:protected] => Google_Service_Drive_DriveFileImageMediaMetadata
[imageMediaMetadataDataType:protected] =>
[isAppAuthorized] =>
[kind] => drive#file
[lastModifyingUserType:protected] => Google_Service_Drive_User
[lastModifyingUserDataType:protected] =>
[md5Checksum] =>
[mimeType] => application/vnd.google-apps.spreadsheet
[modifiedByMe] =>
[modifiedByMeTime] =>
[modifiedTime] =>
[name] => Untitled
[originalFilename] =>
[ownedByMe] =>
[ownersType:protected] => Google_Service_Drive_User
[ownersDataType:protected] => array
[parents] =>
[permissionIds] =>
[permissionsType:protected] => Google_Service_Drive_Permission
[permissionsDataType:protected] => array
[properties] =>
[quotaBytesUsed] =>
[shared] =>
[sharedWithMeTime] =>
[sharingUserType:protected] => Google_Service_Drive_User
[sharingUserDataType:protected] =>
[size] =>
[spaces] =>
[starred] =>
[teamDriveId] =>
[thumbnailLink] =>
[thumbnailVersion] =>
[trashed] =>
[trashedTime] =>
[trashingUserType:protected] => Google_Service_Drive_User
[trashingUserDataType:protected] =>
[version] =>
[videoMediaMetadataType:protected] => Google_Service_Drive_DriveFileVideoMediaMetadata
[videoMediaMetadataDataType:protected] =>
[viewedByMe] =>
[viewedByMeTime] =>
[viewersCanCopyContent] =>
[webContentLink] =>
[webViewLink] =>
[writersCanShare] =>
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
)
Meine composer.json hat die folgende Zeile:
"google/apiclient": "^2.2",
ich die Methoden kannte, und verwendet sie. Das Ergebnis ist für mich dasselbe. Es hat für dich funktioniert? –
Ja, versuchen Sie, Optionen params zur Liste hinzuzufügenFiles() wie in meinem [Bearbeiten] – alvarofvr
Danke, es funktioniert mit den Optionen! –