當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ZPush::GetSearchProvider方法代碼示例

本文整理匯總了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);
開發者ID:Alex9779,項目名稱:Z-Push_org-src,代碼行數:67,代碼來源:search.php


注:本文中的ZPush::GetSearchProvider方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。