Google 캘린더 API 작업에 대한 http://www.ibm.com/developerworks/library/x-googleclndr/의 자습서를 따르고 있지만 일부 이상한 문제가 있습니다. 예외의젠드 라이브러리를 사용하는 Google 캘린더 API
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
Zend_Loader::loadClass('Zend_Http_Client');
//create authenticated HTTP client for Calendar service
$gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$user = "[email protected]";
$pass = "*******";
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $gcal);
$gcal = new Zend_Gdata_Calendar($client);
//generate query to get event list
$query = $gcal->newEventQuery();
$query->setUser($user);
$query->setVisibility('private');
$query->setProjection('basic');
//get and parse calendar feed
//print output
try {
$feed = $gcal->getCalendarEventFeed($query);
echo "<!--comment-->\n";
} catch (Exception $e) {
echo "<!--different comment-->\n";
}
어떤 종류의 오류 메시지가 표시되지 않는 아니라 Zend_Gdata_App_Exception
때문에, try 블록 내에서 발생하는 같은 내 PHP 코드가 보인다. 나는 내가 뭘 잘못하고 있는지 알 수 없다.
또한 여기에 나와있는대로 PHP를 배우고 있습니다. 도와 주셔서 정말로 고맙습니다.
catch (Exception $ e) { Zend_Debug :: dump ($ e); }'디스플레이? – Liyali
@ 리얄 아무 것도. 또한 일부 디버깅 코드를 넣었고 try/catch 블록에있는 위의 주석 중 어느 것도 페이지 소스에 나타나지 않습니다. – Daniel
'try catch '에 도달하기 전에 실패하기 때문에 코드가 실행되지 않을 수 있습니까? 또는 시도하지만 예외가 throw되지 않고 실패 할 수 있습니다 (예를 들어 PHP 치명적인 오류) – Liyali