获取错误消息PHP致命错误:调用未定义的方法Zend_Mail_Storage_Imap :: requestAndResponse()

时间:2012-10-04 08:17:44

标签: php zend-framework zend-mail

我是Zend Framework的新手。我正在使用该应用程序来搜索Gmail收件箱(我添加到Zend/Mail/Storage/Imap.php

/**
 * 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();
}

我这样称呼它:

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

但每次我尝试运行它时都会显示错误:

  

PHP致命错误:在第655行的/public_html/test06/Zend/Mail/Storage/Imap.php中调用未定义的方法Zend_Mail_Storage_Imap :: requestAndResponse()

1 个答案:

答案 0 :(得分:0)

似乎requestAndResponse没有以你调用它的方式定义。我不使用ZF,但你确定requestAndResponse接受你发送的2个参数。我的意思是('SEARCH',$ params)。