2011-07-14 91 views
0

我不知道這是否是一個全球性的Zend屬性存儲系統或者什麼,但是當我創建下列類型的代碼:的PHP Zend的GData的Picasa /照片屬性

$serviceName = Zend_Gdata_Photos::AUTH_SERVICE_NAME; 
$client = Zend_Gdata_ClientLogin::getHttpClient($username, $pass, $serviceName); 

// update the second argument to be CompanyName-ProductName-Version 
$gp = new Zend_Gdata_Photos($client, "Google-DevelopersGuide-1.0"); 

$userFeed = $gp->getUserFeed("default"); 
foreach ($userFeed as $userEntry) { 
    echo $userEntry->title->text . "<br />\n"; 
} 

我似乎無法得到所有的指定$ userEntry的屬性。當我做print_r時,它只給出了元素的結構,而不是實際的數據。

我的問題是我如何得到一個包含諸如「title」爲$ userEntry的項目的列表?

非常感謝!

回答

0

這不完全是一個答案,但你有沒有嘗試使用下面的代碼進行調試?

} catch (Zend_Gdata_App_HttpException $e) { 
echo "Error: " . $e->getMessage() . "<br />\n"; 
if ($e->getResponse() != null) { 
    echo "Body: <br />\n" . $e->getResponse()->getBody() . 
     "<br />\n"; 
} 
// In new versions of Zend Framework, you also have the option 
// to print out the request that was made. As the request 
// includes Auth credentials, it's not advised to print out 
// this data unless doing debugging 
// echo "Request: <br />\n" . $e->getRequest() . "<br />\n"; 
} catch (Zend_Gdata_App_Exception $e) { 
    echo "Error: " . $e->getMessage() . "<br />\n"; 
} 

gl Paulo Bueno。編號:Zend_Gdata_Photos listing all albums and photos

+0

是的,我目前使用的(我只是想正確的點...即站起來,簡短,坐着)。從本質上說,只是捕獲「屬性{名稱}不存在」。感謝您的回覆! – Nitroware