当前位置: 首页>>代码示例>>PHP>>正文


PHP api_Utils::GenerateFolderHash方法代码示例

本文整理汇总了PHP中api_Utils::GenerateFolderHash方法的典型用法代码示例。如果您正苦于以下问题:PHP api_Utils::GenerateFolderHash方法的具体用法?PHP api_Utils::GenerateFolderHash怎么用?PHP api_Utils::GenerateFolderHash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在api_Utils的用法示例。


在下文中一共展示了api_Utils::GenerateFolderHash方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getMessageListByUids

 /**
  * Obtains a list of specific messages.
  * 
  * @param CAccount $oAccount Account object.
  * @param string $sFolderFullNameRaw Raw full name of the folder.
  * @param array $aUids List of message UIDs.
  *
  * @return CApiMailMessageCollection
  *
  * @throws CApiInvalidArgumentException
  */
 public function getMessageListByUids($oAccount, $sFolderFullNameRaw, $aUids)
 {
     if (0 === strlen($sFolderFullNameRaw) || !is_array($aUids) || 0 === count($aUids)) {
         throw new CApiInvalidArgumentException();
     }
     $oMessageCollection = false;
     $oImapClient =& $this->_getImapClient($oAccount);
     $oImapClient->FolderExamine($sFolderFullNameRaw);
     $aList = $this->_getFolderInformation($oImapClient, $sFolderFullNameRaw);
     $iMessageRealCount = $aList[0];
     $iMessageUnseenCount = $aList[1];
     $sUidNext = $aList[2];
     $oMessageCollection = CApiMailMessageCollection::createInstance();
     $oMessageCollection->FolderName = $sFolderFullNameRaw;
     $oMessageCollection->Offset = 0;
     $oMessageCollection->Limit = 0;
     $oMessageCollection->Search = '';
     $oMessageCollection->UidNext = $sUidNext;
     if (0 < $iMessageRealCount) {
         $bIndexAsUid = true;
         $aIndexOrUids = $aUids;
         if (is_array($aIndexOrUids)) {
             $oMessageCollection->MessageCount = $iMessageRealCount;
             $oMessageCollection->MessageUnseenCount = $iMessageUnseenCount;
             $oMessageCollection->MessageSearchCount = $oMessageCollection->MessageCount;
             $oMessageCollection->MessageResultCount = $oMessageCollection->MessageCount;
             if (0 < count($aIndexOrUids)) {
                 $aRequestIndexOrUids = $aIndexOrUids;
                 if ($bIndexAsUid) {
                     $oMessageCollection->Uids = $aRequestIndexOrUids;
                 }
                 if (is_array($aRequestIndexOrUids) && 0 < count($aRequestIndexOrUids)) {
                     $aFetchResponse = $oImapClient->Fetch(array(\MailSo\Imap\Enumerations\FetchType::INDEX, \MailSo\Imap\Enumerations\FetchType::UID, \MailSo\Imap\Enumerations\FetchType::RFC822_SIZE, \MailSo\Imap\Enumerations\FetchType::INTERNALDATE, \MailSo\Imap\Enumerations\FetchType::FLAGS, \MailSo\Imap\Enumerations\FetchType::BODYSTRUCTURE, \MailSo\Imap\Enumerations\FetchType::BODY_HEADER_PEEK), implode(',', $aRequestIndexOrUids), $bIndexAsUid);
                     if (is_array($aFetchResponse) && 0 < count($aFetchResponse)) {
                         $aFetchIndexArray = array();
                         $oFetchResponseItem = null;
                         foreach ($aFetchResponse as &$oFetchResponseItem) {
                             $aFetchIndexArray[$bIndexAsUid ? $oFetchResponseItem->GetFetchValue(\MailSo\Imap\Enumerations\FetchType::UID) : $oFetchResponseItem->GetFetchValue(\MailSo\Imap\Enumerations\FetchType::INDEX)] =& $oFetchResponseItem;
                             unset($oFetchResponseItem);
                         }
                         foreach ($aRequestIndexOrUids as $iFUid) {
                             if (isset($aFetchIndexArray[$iFUid])) {
                                 $oMailMessage = CApiMailMessage::createInstance($oMessageCollection->FolderName, $aFetchIndexArray[$iFUid]);
                                 if (!$bIndexAsUid) {
                                     $oMessageCollection->Uids[] = $oMailMessage->getUid();
                                 }
                                 $oMessageCollection->Add($oMailMessage);
                                 unset($oMailMessage);
                             }
                         }
                     }
                 }
             }
         }
     }
     $oMessageCollection->FolderHash = api_Utils::GenerateFolderHash($sFolderFullNameRaw, $oMessageCollection->MessageCount, $oMessageCollection->MessageUnseenCount, $oMessageCollection->UidNext);
     return $oMessageCollection;
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:69,代码来源:manager.php

示例2: responseObject


//.........这里部分代码省略.........
             }
             $mResult['Custom'] = $this->responseObject($oAccount, $mResponse->getCustomList(), $sParent, $aParameters);
             $mResult['Subject'] = \MailSo\Base\Utils::Utf8Clear($mResult['Subject']);
         } else {
             if ('CApiMailIcs' === $sClassName) {
                 $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('Uid' => $mResponse->Uid, 'Sequence' => $mResponse->Sequence, 'Attendee' => $mResponse->Attendee, 'File' => $mResponse->File, 'Type' => $mResponse->Type, 'Location' => $mResponse->Location, 'Description' => \MailSo\Base\LinkFinder::NewInstance()->Text($mResponse->Description)->UseDefaultWrappers(true)->CompileText(), 'When' => $mResponse->When, 'CalendarId' => $mResponse->CalendarId));
             } else {
                 if ('CApiMailVcard' === $sClassName) {
                     $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('Uid' => $mResponse->Uid, 'File' => $mResponse->File, 'Name' => $mResponse->Name, 'Email' => $mResponse->Email, 'Exists' => $mResponse->Exists));
                 } else {
                     if ('CFilter' === $sClassName) {
                         $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('Enable' => $mResponse->Enable, 'Field' => $mResponse->Field, 'Filter' => $mResponse->Filter, 'Condition' => $mResponse->Condition, 'Action' => $mResponse->Action, 'FolderFullName' => $mResponse->FolderFullName));
                     } else {
                         if ('CHelpdeskThread' === $sClassName) {
                             $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('IdHelpdeskThread' => $mResponse->IdHelpdeskThread, 'ThreadHash' => $mResponse->StrHelpdeskThreadHash, 'IdOwner' => $mResponse->IdOwner, 'Owner' => $mResponse->Owner, 'Type' => $mResponse->Type, 'Subject' => $mResponse->Subject, 'IsRead' => $mResponse->IsRead, 'IsArchived' => $mResponse->IsArchived, 'ItsMe' => $mResponse->ItsMe, 'HasAttachments' => $mResponse->HasAttachments, 'PostCount' => $mResponse->PostCount, 'Created' => $mResponse->Created, 'Updated' => $mResponse->Updated));
                         } else {
                             if ('CHelpdeskPost' === $sClassName) {
                                 $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('IdHelpdeskPost' => $mResponse->IdHelpdeskPost, 'IdHelpdeskThread' => $mResponse->IdHelpdeskThread, 'IdOwner' => $mResponse->IdOwner, 'Owner' => $mResponse->Owner, 'Attachments' => $this->responseObject($oAccount, $mResponse->Attachments, $sParent), 'IsThreadOwner' => $mResponse->IsThreadOwner, 'ItsMe' => $mResponse->ItsMe, 'Type' => $mResponse->Type, 'SystemType' => $mResponse->SystemType, 'Text' => \MailSo\Base\HtmlUtils::ConvertPlainToHtml($mResponse->Text), 'Created' => $mResponse->Created));
                             } else {
                                 if ('CHelpdeskAttachment' === $sClassName) {
                                     $iThumbnailLimit = 1024 * 1024 * 2;
                                     // 2MB
                                     /* @var $mResponse CHelpdeskAttachment */
                                     $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('IdHelpdeskAttachment' => $mResponse->IdHelpdeskAttachment, 'IdHelpdeskPost' => $mResponse->IdHelpdeskPost, 'IdHelpdeskThread' => $mResponse->IdHelpdeskThread, 'SizeInBytes' => $mResponse->SizeInBytes, 'FileName' => $mResponse->FileName, 'MimeType' => \MailSo\Base\Utils::MimeContentType($mResponse->FileName), 'Thumb' => \CApi::GetConf('labs.allow-thumbnail', true) && $mResponse->SizeInBytes < $iThumbnailLimit && \api_Utils::IsGDImageMimeTypeSuppoted(\MailSo\Base\Utils::MimeContentType($mResponse->FileName), $mResponse->FileName), 'Hash' => $mResponse->Hash, 'Content' => $mResponse->Content, 'Created' => $mResponse->Created));
                                 } else {
                                     if ('CFetcher' === $sClassName) {
                                         /* @var $mResponse \CFetcher */
                                         $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('IdFetcher' => $mResponse->IdFetcher, 'IdAccount' => $mResponse->IdAccount, 'IsEnabled' => $mResponse->IsEnabled, 'IsLocked' => $mResponse->IsLocked, 'Folder' => $mResponse->Folder, 'Name' => $mResponse->Name, 'Email' => $mResponse->Email, 'Signature' => $mResponse->Signature, 'SignatureOptions' => $mResponse->SignatureOptions, 'LeaveMessagesOnServer' => $mResponse->LeaveMessagesOnServer, 'IncomingMailServer' => $mResponse->IncomingMailServer, 'IncomingMailPort' => $mResponse->IncomingMailPort, 'IncomingMailLogin' => $mResponse->IncomingMailLogin, 'IsOutgoingEnabled' => $mResponse->IsOutgoingEnabled, 'OutgoingMailServer' => $mResponse->OutgoingMailServer, 'OutgoingMailPort' => $mResponse->OutgoingMailPort, 'OutgoingMailAuth' => $mResponse->OutgoingMailAuth, 'IncomingMailSsl' => $mResponse->IncomingMailSecurity === \MailSo\Net\Enumerations\ConnectionSecurityType::SSL, 'OutgoingMailSsl' => $mResponse->OutgoingMailSecurity === \MailSo\Net\Enumerations\ConnectionSecurityType::SSL));
                                     } else {
                                         if ('CApiMailFolder' === $sClassName) {
                                             $aExtended = null;
                                             $mStatus = $mResponse->getStatus();
                                             if (is_array($mStatus) && isset($mStatus['MESSAGES'], $mStatus['UNSEEN'], $mStatus['UIDNEXT'])) {
                                                 $aExtended = array('MessageCount' => (int) $mStatus['MESSAGES'], 'MessageUnseenCount' => (int) $mStatus['UNSEEN'], 'UidNext' => (string) $mStatus['UIDNEXT'], 'Hash' => \api_Utils::GenerateFolderHash($mResponse->getRawFullName(), $mStatus['MESSAGES'], $mStatus['UNSEEN'], $mStatus['UIDNEXT']));
                                             }
                                             $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('Type' => $mResponse->getType(), 'Name' => $mResponse->getName(), 'FullName' => $mResponse->getFullName(), 'FullNameRaw' => $mResponse->getRawFullName(), 'FullNameHash' => md5($mResponse->getRawFullName()), 'Delimiter' => $mResponse->getDelimiter(), 'IsSubscribed' => $oAccount->isExtensionEnabled(\CAccount::IgnoreSubscribeStatus) ? true : $mResponse->isSubscribed(), 'IsSelectable' => $mResponse->isSelectable(), 'Exists' => $mResponse->exists(), 'Extended' => $aExtended, 'SubFolders' => $this->responseObject($oAccount, $mResponse->getSubFolders(), $sParent, $aParameters)));
                                         } else {
                                             if ('CApiMailAttachment' === $sClassName) {
                                                 $mFoundedCIDs = isset($aParameters['FoundedCIDs']) && is_array($aParameters['FoundedCIDs']) ? $aParameters['FoundedCIDs'] : null;
                                                 $mFoundedContentLocationUrls = isset($aParameters['FoundedContentLocationUrls']) && \is_array($aParameters['FoundedContentLocationUrls']) && 0 < \count($aParameters['FoundedContentLocationUrls']) ? $aParameters['FoundedContentLocationUrls'] : null;
                                                 if ($mFoundedCIDs || $mFoundedContentLocationUrls) {
                                                     $aFoundedCIDs = \array_merge($mFoundedCIDs ? $mFoundedCIDs : array(), $mFoundedContentLocationUrls ? $mFoundedContentLocationUrls : array());
                                                     $aFoundedCIDs = 0 < \count($mFoundedCIDs) ? $mFoundedCIDs : null;
                                                 }
                                                 $sMimeType = strtolower(trim($mResponse->getMimeType()));
                                                 $sMimeIndex = strtolower(trim($mResponse->getMimeIndex()));
                                                 $sContentTransferEncoding = strtolower(trim($mResponse->getEncoding()));
                                                 $sFileName = $mResponse->getFileName(true);
                                                 $iEstimatedSize = $mResponse->getEstimatedSize();
                                                 $iThumbnailLimit = 1024 * 1024 * 2;
                                                 // 2MB //TODO
                                                 if (in_array($sMimeType, array('application/octet-stream'))) {
                                                     $sMimeType = \MailSo\Base\Utils::MimeContentType($sFileName);
                                                 }
                                                 $sCid = \trim(\trim($mResponse->getCid()), '<>');
                                                 $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('FileName' => $sFileName, 'MimeType' => $sMimeType, 'MimePartIndex' => 'message/rfc822' === $sMimeType && ('base64' === $sContentTransferEncoding || 'quoted-printable' === $sContentTransferEncoding) ? '' : $sMimeIndex, 'EstimatedSize' => $iEstimatedSize, 'CID' => $sCid, 'ContentLocation' => $mResponse->getContentLocation(), 'Thumb' => \CApi::GetConf('labs.allow-thumbnail', true) && $iEstimatedSize < $iThumbnailLimit && \api_Utils::IsGDImageMimeTypeSuppoted($sMimeType, $sFileName), 'Expand' => \CApi::isExpandMimeTypeSupported($sMimeType, $sFileName), 'Iframed' => \CApi::isIframedMimeTypeSupported($sMimeType, $sFileName), 'Content' => $mResponse->getContent(), 'IsInline' => $mResponse->isInline(), 'IsLinked' => !empty($sCid) && $mFoundedCIDs && \in_array($sCid, $mFoundedCIDs) || $mFoundedContentLocationUrls && \in_array(\trim($mResponse->getContentLocation()), $mFoundedContentLocationUrls)));
                                                 $mResult['Hash'] = \CApi::EncodeKeyValues(array('Iframed' => $mResult['Iframed'], 'AccountID' => $oAccount ? $oAccount->IdAccount : 0, 'Folder' => $mResponse->getFolder(), 'Uid' => $mResponse->getUid(), 'MimeIndex' => $sMimeIndex, 'MimeType' => $sMimeType, 'FileName' => $mResponse->getFileName(true)));
                                             } else {
                                                 if ('MailSo\\Mime\\Email' === $sClassName) {
                                                     $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('DisplayName' => \MailSo\Base\Utils::Utf8Clear($mResponse->GetDisplayName()), 'Email' => \MailSo\Base\Utils::Utf8Clear($mResponse->GetEmail())));
                                                 } else {
                                                     if ('CApiMailMessageCollection' === $sClassName) {
                                                         $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('Uids' => $mResponse->Uids, 'UidNext' => $mResponse->UidNext, 'FolderHash' => $mResponse->FolderHash, 'MessageCount' => $mResponse->MessageCount, 'MessageUnseenCount' => $mResponse->MessageUnseenCount, 'MessageResultCount' => $mResponse->MessageResultCount, 'FolderName' => $mResponse->FolderName, 'Offset' => $mResponse->Offset, 'Limit' => $mResponse->Limit, 'Search' => $mResponse->Search, 'Filters' => $mResponse->Filters, 'New' => $mResponse->New));
                                                     } else {
                                                         if ('CIdentity' === $sClassName) {
                                                             $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('IdIdentity' => $mResponse->IdIdentity, 'IdAccount' => $mResponse->IdAccount, 'Default' => $mResponse->Default, 'Enabled' => $mResponse->Enabled, 'Email' => $mResponse->Email, 'FriendlyName' => $mResponse->FriendlyName, 'UseSignature' => $mResponse->UseSignature, 'Signature' => $mResponse->Signature));
开发者ID:Git-Host,项目名称:email,代码行数:67,代码来源:ActionsBase.php


注:本文中的api_Utils::GenerateFolderHash方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。