本文整理汇总了PHP中ZPush::GetSearchProvider方法的典型用法代码示例。如果您正苦于以下问题:PHP ZPush::GetSearchProvider方法的具体用法?PHP ZPush::GetSearchProvider怎么用?PHP ZPush::GetSearchProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZPush
的用法示例。
在下文中一共展示了ZPush::GetSearchProvider方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Handle
//.........这里部分代码省略.........
}
if (self::$decoder->getElementStartTag(SYNC_AIRSYNCBASE_ALLORNONE)) {
$cpo->BodyPreference($bptype)->SetAllOrNone(self::$decoder->getElementContent());
if (!self::$decoder->getElementEndTag()) {
return false;
}
}
if (self::$decoder->getElementStartTag(SYNC_AIRSYNCBASE_PREVIEW)) {
$cpo->BodyPreference($bptype)->SetPreview(self::$decoder->getElementContent());
if (!self::$decoder->getElementEndTag()) {
return false;
}
}
if (!self::$decoder->getElementEndTag()) {
return false;
}
}
$e = self::$decoder->peek();
if ($e[EN_TYPE] == EN_TYPE_ENDTAG) {
self::$decoder->getElementEndTag();
break;
}
}
}
if (!self::$decoder->getElementEndTag()) {
//store
return false;
}
if (!self::$decoder->getElementEndTag()) {
//search
return false;
}
// get SearchProvider
$searchprovider = ZPush::GetSearchProvider();
$status = SYNC_SEARCHSTATUS_SUCCESS;
$rows = array();
// TODO support other searches
if ($searchprovider->SupportsType($searchname)) {
$storestatus = SYNC_SEARCHSTATUS_STORE_SUCCESS;
try {
if ($searchname == ISearchProvider::SEARCH_GAL) {
//get search results from the searchprovider
$rows = $searchprovider->GetGALSearchResults($searchquery, $searchrange);
} elseif ($searchname == ISearchProvider::SEARCH_MAILBOX) {
$rows = $searchprovider->GetMailboxSearchResults($cpo);
}
} catch (StatusException $stex) {
$storestatus = $stex->getCode();
}
} else {
$rows = array('searchtotal' => 0);
$status = SYNC_SEARCHSTATUS_SERVERERROR;
ZLog::Write(LOGLEVEL_WARN, sprintf("Searchtype '%s' is not supported.", $searchname));
self::$topCollector->AnnounceInformation(sprintf("Unsupported type '%s''", $searchname), true);
}
$searchprovider->Disconnect();
self::$topCollector->AnnounceInformation(sprintf("'%s' search found %d results", $searchname, $rows['searchtotal']), true);
self::$encoder->startWBXML();
self::$encoder->startTag(SYNC_SEARCH_SEARCH);
self::$encoder->startTag(SYNC_SEARCH_STATUS);
self::$encoder->content($status);
self::$encoder->endTag();
if ($status == SYNC_SEARCHSTATUS_SUCCESS) {
self::$encoder->startTag(SYNC_SEARCH_RESPONSE);
self::$encoder->startTag(SYNC_SEARCH_STORE);
self::$encoder->startTag(SYNC_SEARCH_STATUS);