저는 도서관 프로젝트 인 google-api-php-client-0.6.1.tar.gts를 사용합니다. 복사 예를 https://developers.google.com/drive/v2/reference/about/get?hl=ru :PHP : Google_DriveService.php 클래스에 오류가 발생했습니다.
function printAbout($service) {
try {
$about = $service->about->get();
print "Current user name: " . $about->getName();
print "Root folder ID: " . $about->getRootFolderId();
print "Total quota (bytes): " . $about->getQuotaBytesTotal();
print "Used quota (bytes): " . $about->getQuotaBytesUsed();
} catch (Exception $e) {
print "An error occurred: " . $e->getMessage();
}
}
PHP 오류 : 치명적인 오류 :에서가 아닌 객체의 멤버 함수 getName()를 호출합니다 ......
$ 객체에 할당되지 않은 약, 입력 어레이 :
Array (
[kind] => drive#file
[id] => 0B6xE_F1PfpXTWUVUNE5nZW5qYUU
[etag] => "Ys3khhcpAWaV7oeqaRGUOvsvqpo/MTM2MjEyNTY4MjE5NA"
[selfLink] => https://www.googleapis.com/drive/v2/files/0B6xE_F1PfpXTWUVUNE5nZW5qYUU
[webContentLink] => https://docs.google.com/uc?id=0B6xE_F1PfpXTWUVUNE5nZW5qYUU&export=download
[alternateLink] => https://docs.google.com/file/d/0B6xE_F1PfpXTWUVUNE5nZW5qYUU/edit
[iconLink] => https://ssl.gstatic.com/docs/doclist/images/icon_10_word_list.png
[thumbnailLink] => https://lh5.googleusercontent.com/Mb3p9nFVuzwGaaKVVxfyBKwPOS4-0QjiSUi7EcfiA6_QBgRThM7NrPOcBC-UcRKt6Q=s220
[title] => Kniga3_A5.doc
[mimeType] => application/msword
[labels] => Array
(
[starred] =>
[hidden] =>
[trashed] =>
[restricted] =>
[viewed] =>
)
[createdDate] => 2013-03-01T08:14:40.352Z
[modifiedDate] => 2013-03-01T08:14:42.194Z
[modifiedByMeDate] => 2013-03-01T08:14:40.332Z
[parents] => Array ..................
배열의 예는 함수 printFile 수득하지만 printAbout 같이 포맷 동일하다.
나는 주어진 객체가 있어야한다고 생각한다 ....
다른 실수로 나는 다른 기능에서 눈치 챘다.
감사합니다, 그것은 일 ... 지금은 알 수 – ne3Vubeki