2012-10-04 20 views
0

我是Zend Framework的新手。我工作的一個應用程序,通過使用類(我加入Zend/Mail/Storage/Imap.php獲取錯誤消息PHP致命錯誤:調用未定義的方法Zend_Mail_Storage_Imap :: requestAndResponse()

/** 
* do a search request 
* 
* This method is currently marked as internal as the API might change and is not 
* safe if you don't take precautions. 
* 
* @internal 
* @return array message ids 
*/ 
public function search(array $params) 
{ 
    $response = $this->requestAndResponse('SEARCH', $params); 
    if (!$response) { 
     return $response; 
    } 

    foreach ($response as $ids) { 
     if ($ids[0] == 'SEARCH') { 
      array_shift($ids); 
      return $ids; 
     } 
    } 
    return array(); 
} 

通過Gmail收件箱搜索和我打電話這樣說:

$searchresults = $storage->search(array('search_terms')); 

但每次我嘗試運行它顯示了一個錯誤:

PHP Fatal error: Call to undefined method Zend_Mail_Storage_Imap::requestAndResponse() in /public_html/test06/Zend/Mail/Storage/Imap.php on line 655

+1

您是否正在修補ZF代碼庫以實現您想要的功能? – Florent

+0

是的,我有。實際上,我使用來自http://code.google.com/p/google-mail-oauth2-tools/wiki/PhpSampleCode的谷歌代碼的lib xoauth-php-samples通過imap和oAuth訪問Gmail。 – user1719367

回答

0

看起來requestAndResponse沒有以您調用它的方式定義。我不使用ZF,但你確定requestAndResponse接受你發送的2個參數。我的意思是('搜索',$ params)。

相關問題