本文整理汇总了PHP中SyncObject类的典型用法代码示例。如果您正苦于以下问题:PHP SyncObject类的具体用法?PHP SyncObject怎么用?PHP SyncObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SyncObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: SyncBaseBody
function SyncBaseBody()
{
$mapping = array(SYNC_AIRSYNCBASE_TYPE => array(self::STREAMER_VAR => "type"), SYNC_AIRSYNCBASE_ESTIMATEDDATASIZE => array(self::STREAMER_VAR => "estimatedDataSize"), SYNC_AIRSYNCBASE_TRUNCATED => array(self::STREAMER_VAR => "truncated"), SYNC_AIRSYNCBASE_DATA => array(self::STREAMER_VAR => "data"));
if (Request::GetProtocolVersion() >= 14.0) {
$mapping[SYNC_AIRSYNCBASE_PREVIEW] = array(self::STREAMER_VAR => "preview");
}
parent::SyncObject($mapping);
}
开发者ID:narikenabilli,项目名称:spiritualtablet,代码行数:8,代码来源:syncbasebody.php
示例2: SyncAttendee
function SyncAttendee()
{
$mapping = array(SYNC_POOMCAL_EMAIL => array(self::STREAMER_VAR => "email", self::STREAMER_CHECKS => array(self::STREAMER_CHECK_REQUIRED => self::STREAMER_CHECK_SETEMPTY)), SYNC_POOMCAL_NAME => array(self::STREAMER_VAR => "name", self::STREAMER_CHECKS => array(self::STREAMER_CHECK_REQUIRED => self::STREAMER_CHECK_SETEMPTY)));
if (Request::GetProtocolVersion() >= 12.0) {
$mapping[SYNC_POOMCAL_ATTENDEESTATUS] = array(self::STREAMER_VAR => "attendeestatus");
$mapping[SYNC_POOMCAL_ATTENDEETYPE] = array(self::STREAMER_VAR => "attendeetype");
}
parent::SyncObject($mapping);
}
开发者ID:alanturing1,项目名称:Z-Push-contrib,代码行数:9,代码来源:syncattendee.php
示例3: SyncUserInformation
public function SyncUserInformation()
{
$mapping = array(SYNC_SETTINGS_ACCOUNTID => array(self::STREAMER_VAR => "accountid"), SYNC_SETTINGS_ACCOUNTNAME => array(self::STREAMER_VAR => "accountname"), SYNC_SETTINGS_EMAILADDRESSES => array(self::STREAMER_VAR => "emailaddresses", self::STREAMER_ARRAY => SYNC_SETTINGS_SMPTADDRESS), SYNC_SETTINGS_PROP_STATUS => array(self::STREAMER_VAR => "Status", self::STREAMER_TYPE => self::STREAMER_TYPE_IGNORE));
if (Request::GetProtocolVersion() >= 12.1) {
$mapping[SYNC_SETTINGS_USERDISPLAYNAME] = array(self::STREAMER_VAR => "userdisplayname");
}
if (Request::GetProtocolVersion() >= 14.0) {
$mapping[SYNC_SETTINGS_SENDDISABLED] = array(self::STREAMER_VAR => "senddisabled");
}
parent::SyncObject($mapping);
}
开发者ID:alanturing1,项目名称:Z-Push-contrib,代码行数:11,代码来源:syncuserinformation.php
示例4: SyncDeviceInformation
public function SyncDeviceInformation()
{
$mapping = array(SYNC_SETTINGS_MODEL => array(self::STREAMER_VAR => "model"), SYNC_SETTINGS_IMEI => array(self::STREAMER_VAR => "imei"), SYNC_SETTINGS_FRIENDLYNAME => array(self::STREAMER_VAR => "friendlyname"), SYNC_SETTINGS_OS => array(self::STREAMER_VAR => "os"), SYNC_SETTINGS_OSLANGUAGE => array(self::STREAMER_VAR => "oslanguage"), SYNC_SETTINGS_PHONENUMBER => array(self::STREAMER_VAR => "phonenumber"), SYNC_SETTINGS_PROP_STATUS => array(self::STREAMER_VAR => "Status", self::STREAMER_TYPE => self::STREAMER_TYPE_IGNORE));
if (Request::GetProtocolVersion() >= 12.1) {
$mapping[SYNC_SETTINGS_USERAGENT] = array(self::STREAMER_VAR => "useragent");
}
if (Request::GetProtocolVersion() >= 14.0) {
$mapping[SYNC_SETTINGS_MOBILEOPERATOR] = array(self::STREAMER_VAR => "mobileoperator");
$mapping[SYNC_SETTINGS_ENABLEOUTBOUNDSMS] = array(self::STREAMER_VAR => "enableoutboundsms");
}
parent::SyncObject($mapping);
}
开发者ID:karanikn,项目名称:php-addressbook,代码行数:12,代码来源:syncdeviceinformation.php
示例5: Check
/**
* Method checks if the object has the minimum of required parameters
* and fullfills semantic dependencies
*
* This overloads the general check() with special checks to be executed
*
* @param boolean $logAsDebug (opt) default is false, so messages are logged in WARN log level
*
* @access public
* @return boolean
*/
public function Check($logAsDebug = false)
{
$ret = parent::Check($logAsDebug);
if (!$ret) {
return false;
}
if (isset($this->start) && isset($this->until) && $this->until < $this->start) {
ZLog::Write(LOGLEVEL_WARN, sprintf("SyncObject->Check(): Unmet condition in object from type %s: parameter 'start' is HIGHER than 'until'. Check failed!", get_class($this)));
return false;
}
return true;
}
开发者ID:netconstructor,项目名称:sogosync,代码行数:23,代码来源:synctaskrecurrence.php
示例6: Check
/**
* Method checks if the object has the minimum of required parameters
* and fullfills semantic dependencies
*
* This overloads the general check() with special checks to be executed
*
* @param boolean $logAsDebug (opt) default is false, so messages are logged in WARN log level
*
* @access public
* @return boolean
*/
public function Check($logAsDebug = false)
{
$ret = parent::Check($logAsDebug);
// semantic checks general "turn off switch"
if (defined("DO_SEMANTIC_CHECKS") && DO_SEMANTIC_CHECKS === false) {
return $ret;
}
if (!$ret) {
return false;
}
if (isset($this->start) && isset($this->until) && $this->until < $this->start) {
ZLog::Write(LOGLEVEL_WARN, sprintf("SyncObject->Check(): Unmet condition in object from type %s: parameter 'start' is HIGHER than 'until'. Check failed!", get_class($this)));
return false;
}
return true;
}
开发者ID:narikenabilli,项目名称:spiritualtablet,代码行数:27,代码来源:synctaskrecurrence.php
示例7: importMessage
/**
* Imports a message
*
* @param SyncParameters $spa SyncParameters object
* @param array $actiondata Actiondata array
* @param integer $todo WBXML flag indicating how message should be imported.
* Valid values: SYNC_ADD, SYNC_MODIFY, SYNC_REMOVE
* @param SyncObject $message SyncObject message to be imported
* @param string $clientid Client message identifier
* @param string $serverid Server message identifier
* @param string $foldertype On sms sync, this says "SMS", else false
* @param integer $messageCount Counter of already imported messages
*
* @access private
* @throws StatusException in case the importer is not available
* @return - Message related status are returned in the actiondata.
*/
private function importMessage($spa, &$actiondata, $todo, $message, $clientid, $serverid, $foldertype, $messageCount)
{
// the importer needs to be available!
if ($this->importer == false) {
throw StatusException("Sync->importMessage(): importer not available", SYNC_STATUS_SERVERERROR);
}
// mark this state as used, e.g. for HeartBeat
self::$deviceManager->SetHeartbeatStateIntegrity($spa->GetFolderId(), $spa->GetUuid(), $spa->GetUuidCounter());
// Detect incoming loop
// messages which were created/removed before will not have the same action executed again
// if a message is edited we perform this action "again", as the message could have been changed on the mobile in the meantime
$ignoreMessage = false;
if ($actiondata["failstate"]) {
// message was ADDED before, do NOT add it again
if ($todo == SYNC_ADD && isset($actiondata["failstate"]["clientids"][$clientid])) {
$ignoreMessage = true;
// make sure no messages are sent back
self::$deviceManager->SetWindowSize($spa->GetFolderId(), 0);
$actiondata["clientids"][$clientid] = $actiondata["failstate"]["clientids"][$clientid];
$actiondata["statusids"][$clientid] = $actiondata["failstate"]["statusids"][$clientid];
ZLog::Write(LOGLEVEL_WARN, sprintf("Mobile loop detected! Incoming new message '%s' was created on the server before. Replying with known new server id: %s", $clientid, $actiondata["clientids"][$clientid]));
}
// message was REMOVED before, do NOT attemp to remove it again
if ($todo == SYNC_REMOVE && isset($actiondata["failstate"]["removeids"][$serverid])) {
$ignoreMessage = true;
// make sure no messages are sent back
self::$deviceManager->SetWindowSize($spa->GetFolderId(), 0);
$actiondata["removeids"][$serverid] = $actiondata["failstate"]["removeids"][$serverid];
$actiondata["statusids"][$serverid] = $actiondata["failstate"]["statusids"][$serverid];
ZLog::Write(LOGLEVEL_WARN, sprintf("Mobile loop detected! Message '%s' was deleted by the mobile before. Replying with known status: %s", $clientid, $actiondata["statusids"][$serverid]));
}
}
if (!$ignoreMessage) {
switch ($todo) {
case SYNC_MODIFY:
self::$topCollector->AnnounceInformation(sprintf("Saving modified message %d", $messageCount));
try {
$actiondata["modifyids"][] = $serverid;
// ignore sms messages
if ($foldertype == "SMS" || stripos($serverid, self::ZPUSHIGNORESMS) !== false) {
ZLog::Write(LOGLEVEL_DEBUG, "SMS sync are not supported. Ignoring message.");
// TODO we should update the SMS
$actiondata["statusids"][$serverid] = SYNC_STATUS_SUCCESS;
} else {
if (!$message instanceof SyncObject || !$message->Check(true)) {
$actiondata["statusids"][$serverid] = SYNC_STATUS_CLIENTSERVERCONVERSATIONERROR;
} else {
if (isset($message->read)) {
// Currently, 'read' is only sent by the PDA when it is ONLY setting the read flag.
$this->importer->ImportMessageReadFlag($serverid, $message->read);
} elseif (!isset($message->flag)) {
$this->importer->ImportMessageChange($serverid, $message);
}
// email todoflags - some devices send todos flags together with read flags,
// so they have to be handled separately
if (isset($message->flag)) {
$this->importer->ImportMessageChange($serverid, $message);
}
$actiondata["statusids"][$serverid] = SYNC_STATUS_SUCCESS;
}
}
} catch (StatusException $stex) {
$actiondata["statusids"][$serverid] = $stex->getCode();
}
break;
case SYNC_ADD:
self::$topCollector->AnnounceInformation(sprintf("Creating new message from mobile %d", $messageCount));
try {
// ignore sms messages
if ($foldertype == "SMS") {
ZLog::Write(LOGLEVEL_DEBUG, "SMS sync are not supported. Ignoring message.");
// TODO we should create the SMS
// return a fake serverid which we can identify later
$actiondata["clientids"][$clientid] = self::ZPUSHIGNORESMS . $clientid;
$actiondata["statusids"][$clientid] = SYNC_STATUS_SUCCESS;
} else {
if (!$message instanceof SyncObject || !$message->Check(true)) {
$actiondata["clientids"][$clientid] = false;
$actiondata["statusids"][$clientid] = SYNC_STATUS_CLIENTSERVERCONVERSATIONERROR;
} else {
$actiondata["clientids"][$clientid] = false;
$actiondata["clientids"][$clientid] = $this->importer->ImportMessageChange(false, $message);
$actiondata["statusids"][$clientid] = SYNC_STATUS_SUCCESS;
//.........这里部分代码省略.........
开发者ID:SvKn,项目名称:Z-Push-contrib,代码行数:101,代码来源:sync.php
示例8: SyncRRPicture
public function SyncRRPicture()
{
$mapping = array(SYNC_RESOLVERECIPIENTS_MAXSIZE => array(self::STREAMER_VAR => "maxsize"), SYNC_RESOLVERECIPIENTS_MAXPICTURES => array(self::STREAMER_VAR => "maxpictures"), SYNC_RESOLVERECIPIENTS_STATUS => array(self::STREAMER_VAR => "status"), SYNC_RESOLVERECIPIENTS_DATA => array(self::STREAMER_VAR => "data"));
parent::SyncObject($mapping);
}
开发者ID:SvKn,项目名称:Z-Push-contrib,代码行数:5,代码来源:syncresolverecipientspicture.php
示例9: SyncMailFlags
function SyncMailFlags()
{
$mapping = array(SYNC_POOMTASKS_SUBJECT => array(self::STREAMER_VAR => "subject"), SYNC_POOMMAIL_FLAGSTATUS => array(self::STREAMER_VAR => "flagstatus"), SYNC_POOMMAIL_FLAGTYPE => array(self::STREAMER_VAR => "flagtype"), SYNC_POOMTASKS_DATECOMPLETED => array(self::STREAMER_VAR => "datecompleted", self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES), SYNC_POOMMAIL_COMPLETETIME => array(self::STREAMER_VAR => "completetime", self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES), SYNC_POOMTASKS_STARTDATE => array(self::STREAMER_VAR => "startdate", self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES), SYNC_POOMTASKS_DUEDATE => array(self::STREAMER_VAR => "duedate", self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES), SYNC_POOMTASKS_UTCSTARTDATE => array(self::STREAMER_VAR => "utcstartdate", self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES), SYNC_POOMTASKS_UTCDUEDATE => array(self::STREAMER_VAR => "utcduedate", self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES), SYNC_POOMTASKS_REMINDERSET => array(self::STREAMER_VAR => "reminderset"), SYNC_POOMTASKS_REMINDERTIME => array(self::STREAMER_VAR => "remindertime", self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES), SYNC_POOMTASKS_ORDINALDATE => array(self::STREAMER_VAR => "ordinaldate", self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES), SYNC_POOMTASKS_SUBORDINALDATE => array(self::STREAMER_VAR => "subordinaldate"));
parent::SyncObject($mapping);
}
开发者ID:narikenabilli,项目名称:spiritualtablet,代码行数:5,代码来源:syncmailflags.php
示例10: Check
/**
* Method checks if the object has the minimum of required parameters
* and fullfills semantic dependencies
*
* This overloads the general check() with special checks to be executed
*
* @param boolean $logAsDebug (opt) default is false, so messages are logged in WARN log level
*
* @access public
* @return boolean
*/
public function Check($logAsDebug = false)
{
$ret = parent::Check($logAsDebug);
// semantic checks general "turn off switch"
if (defined("DO_SEMANTIC_CHECKS") && DO_SEMANTIC_CHECKS === false) {
return $ret;
}
if (!$ret) {
return false;
}
if (isset($this->startdate) && isset($this->duedate) && $this->duedate < $this->startdate) {
ZLog::Write(LOGLEVEL_WARN, sprintf("SyncObject->Check(): Unmet condition in object from type %s: parameter 'startdate' is HIGHER than 'duedate'. Check failed!", get_class($this)));
return false;
}
if (isset($this->utcstartdate) && isset($this->utcduedate) && $this->utcduedate < $this->utcstartdate) {
ZLog::Write(LOGLEVEL_WARN, sprintf("SyncObject->Check(): Unmet condition in object from type %s: parameter 'utcstartdate' is HIGHER than 'utcduedate'. Check failed!", get_class($this)));
return false;
}
if (isset($this->duedate) && $this->duedate != Utils::getDayStartOfTimestamp($this->duedate)) {
$this->duedate = Utils::getDayStartOfTimestamp($this->duedate);
ZLog::Write(LOGLEVEL_DEBUG, "Set the due time to the start of the day");
if (isset($this->startdate) && $this->duedate < $this->startdate) {
$this->startdate = Utils::getDayStartOfTimestamp($this->startdate);
ZLog::Write(LOGLEVEL_DEBUG, "Set the start date to the start of the day");
}
}
return true;
}
开发者ID:SvKn,项目名称:Z-Push-contrib,代码行数:39,代码来源:synctask.php
示例11: SyncItemOperationsAttachment
function SyncItemOperationsAttachment()
{
$mapping = array(SYNC_AIRSYNCBASE_CONTENTTYPE => array(self::STREAMER_VAR => "contenttype"), SYNC_ITEMOPERATIONS_DATA => array(self::STREAMER_VAR => "data", self::STREAMER_TYPE => self::STREAMER_TYPE_STREAM, self::STREAMER_PROP => self::STREAMER_TYPE_MULTIPART));
parent::SyncObject($mapping);
}
开发者ID:alanturing1,项目名称:Z-Push-contrib,代码行数:5,代码来源:syncitemoperationsattachment.php
示例12: SyncRROptions
public function SyncRROptions()
{
$mapping = array(SYNC_RESOLVERECIPIENTS_CERTIFICATERETRIEVAL => array(self::STREAMER_VAR => "certificateretrieval"), SYNC_RESOLVERECIPIENTS_MAXCERTIFICATES => array(self::STREAMER_VAR => "maxcertificates"), SYNC_RESOLVERECIPIENTS_MAXAMBIGUOUSRECIPIENTS => array(self::STREAMER_VAR => "maxambiguousrecipients"), SYNC_RESOLVERECIPIENTS_AVAILABILITY => array(self::STREAMER_VAR => "availability", self::STREAMER_TYPE => "SyncRRAvailability"), SYNC_RESOLVERECIPIENTS_PICTURE => array(self::STREAMER_VAR => "picture", self::STREAMER_TYPE => "SyncRRPicture"));
parent::SyncObject($mapping);
}
开发者ID:alanturing1,项目名称:Z-Push-contrib,代码行数:5,代码来源:syncresolverecipientsoptions.php
示例13: SyncOOFMessage
public function SyncOOFMessage()
{
$mapping = array(SYNC_SETTINGS_APPLIESTOINTERVAL => array(self::STREAMER_VAR => "appliesToInternal", self::STREAMER_PROP => self::STREAMER_TYPE_SEND_EMPTY), SYNC_SETTINGS_APPLIESTOEXTERNALKNOWN => array(self::STREAMER_VAR => "appliesToExternal", self::STREAMER_PROP => self::STREAMER_TYPE_SEND_EMPTY), SYNC_SETTINGS_APPLIESTOEXTERNALUNKNOWN => array(self::STREAMER_VAR => "appliesToExternalUnknown", self::STREAMER_PROP => self::STREAMER_TYPE_SEND_EMPTY), SYNC_SETTINGS_ENABLED => array(self::STREAMER_VAR => "enabled"), SYNC_SETTINGS_REPLYMESSAGE => array(self::STREAMER_VAR => "replymessage"), SYNC_SETTINGS_BODYTYPE => array(self::STREAMER_VAR => "bodytype", self::STREAMER_CHECKS => array(self::STREAMER_CHECK_ONEVALUEOF => array(SYNC_SETTINGSOOF_BODYTYPE_HTML, ucfirst(strtolower(SYNC_SETTINGSOOF_BODYTYPE_TEXT))))));
parent::SyncObject($mapping);
}
开发者ID:SvKn,项目名称:Z-Push-contrib,代码行数:5,代码来源:syncoofmessage.php
示例14: SyncNote
function SyncNote()
{
$mapping = array(SYNC_AIRSYNCBASE_BODY => array(self::STREAMER_VAR => "asbody", self::STREAMER_TYPE => "SyncBaseBody"), SYNC_NOTES_CATEGORIES => array(self::STREAMER_VAR => "categories", self::STREAMER_ARRAY => SYNC_NOTES_CATEGORY), SYNC_NOTES_LASTMODIFIEDDATE => array(self::STREAMER_VAR => "lastmodified", self::STREAMER_TYPE => self::STREAMER_TYPE_DATE), SYNC_NOTES_MESSAGECLASS => array(self::STREAMER_VAR => "messageclass"), SYNC_NOTES_SUBJECT => array(self::STREAMER_VAR => "subject"));
parent::SyncObject($mapping);
}
开发者ID:alanturing1,项目名称:Z-Push-contrib,代码行数:5,代码来源:syncnote.php
示例15: SyncDevicePassword
public function SyncDevicePassword()
{
$mapping = array(SYNC_SETTINGS_DEVICEPW => array(self::STREAMER_VAR => "password"), SYNC_SETTINGS_PROP_STATUS => array(self::STREAMER_VAR => "Status", self::STREAMER_TYPE => self::STREAMER_TYPE_IGNORE));
parent::SyncObject($mapping);
}
开发者ID:SvKn,项目名称:Z-Push-contrib,代码行数:5,代码来源:syncdevicepassword.php
示例16: SyncBaseAttachment
function SyncBaseAttachment()
{
$mapping = array(SYNC_AIRSYNCBASE_DISPLAYNAME => array(self::STREAMER_VAR => "displayname"), SYNC_AIRSYNCBASE_FILEREFERENCE => array(self::STREAMER_VAR => "filereference"), SYNC_AIRSYNCBASE_METHOD => array(self::STREAMER_VAR => "method"), SYNC_AIRSYNCBASE_ESTIMATEDDATASIZE => array(self::STREAMER_VAR => "estimatedDataSize"), SYNC_AIRSYNCBASE_CONTENTID => array(self::STREAMER_VAR => "contentid"), SYNC_AIRSYNCBASE_CONTENTLOCATION => array(self::STREAMER_VAR => "contentlocation"), SYNC_AIRSYNCBASE_ISINLINE => array(self::STREAMER_VAR => "isinline"));
parent::SyncObject($mapping);
}
开发者ID:narikenabilli,项目名称:spiritualtablet,代码行数:5,代码来源:syncbaseattachment.php
示例17: importMessage
/**
* Imports a message
*
* @param SyncParameters $spa SyncParameters object
* @param array $actiondata Actiondata array
* @param integer $todo WBXML flag indicating how message should be imported.
* Valid values: SYNC_ADD, SYNC_MODIFY, SYNC_REMOVE
* @param SyncObject $message SyncObject message to be imported
* @param string $clientid Client message identifier
* @param string $serverid Server message identifier
*
* @access private
* @throws StatusException in case the importer is not available
* @return - Message related status are returned in the actiondata.
*/
private function importMessage($spa, &$actiondata, $todo, $message, $clientid, $serverid)
{
// the importer needs to be available!
if ($this->importer == false) {
throw StatusException(sprintf("Sync->importMessage(): importer not available", SYNC_STATUS_SERVERERROR));
}
// Detect incoming loop
// messages which were created/removed before will not have the same action executed again
// if a message is edited we perform this action "again", as the message could have been changed on the mobile in the meantime
$ignoreMessage = false;
if ($actiondata["failstate"]) {
// message was ADDED before, do NOT add it again
if ($todo == SYNC_ADD && $actiondata["failstate"]["clientids"][$clientid]) {
$ignoreMessage = true;
// make sure no messages are sent back
self::$deviceManager->SetWindowSize($spa->GetFolderId(), 0);
$actiondata["clientids"][$clientid] = $actiondata["failstate"]["clientids"][$clientid];
$actiondata["statusids"][$clientid] = $actiondata["failstate"]["statusids"][$clientid];
ZLog::Write(LOGLEVEL_WARN, sprintf("Mobile loop detected! Incoming new message '%s' was created on the server before. Replying with known new server id: %s", $clientid, $actiondata["clientids"][$clientid]));
}
// message was REMOVED before, do NOT attemp to remove it again
if ($todo == SYNC_REMOVE && $actiondata["failstate"]["removeids"][$serverid]) {
$ignoreMessage = true;
// make sure no messages are sent back
self::$deviceManager->SetWindowSize($spa->GetFolderId(), 0);
$actiondata["removeids"][$serverid] = $actiondata["failstate"]["removeids"][$serverid];
$actiondata["statusids"][$serverid] = $actiondata["failstate"]["statusids"][$serverid];
ZLog::Write(LOGLEVEL_WARN, sprintf("Mobile loop detected! Message '%s' was deleted by the mobile before. Replying with known status: %s", $clientid, $actiondata["statusids"][$serverid]));
}
}
if (!$ignoreMessage) {
switch ($todo) {
case SYNC_MODIFY:
try {
$actiondata["modifyids"][] = $serverid;
// check incoming message without logging WARN messages about errors
if (!$message instanceof SyncObject || !$message->Check(true)) {
$actiondata["statusids"][$serverid] = SYNC_STATUS_CLIENTSERVERCONVERSATIONERROR;
} else {
if (isset($message->read)) {
// Currently, 'read' is only sent by the PDA when it is ONLY setting the read flag.
$this->importer->ImportMessageReadFlag($serverid, $message->read);
} elseif (!isset($message->flag)) {
$this->importer->ImportMessageChange($serverid, $message);
}
// email todoflags - some devices send todos flags together with read flags,
// so they have to be handled separately
if (isset($message->flag)) {
$this->importer->ImportMessageChange($serverid, $message);
}
$actiondata["statusids"][$serverid] = SYNC_STATUS_SUCCESS;
}
} catch (StatusException $stex) {
$actiondata["statusids"][$serverid] = $stex->getCode();
}
break;
case SYNC_ADD:
try {
// check incoming message without logging WARN messages about errors
if (!$message instanceof SyncObject || !$message->Check(true)) {
$actiondata["clientids"][$clientid] = false;
$actiondata["statusids"][$clientid] = SYNC_STATUS_CLIENTSERVERCONVERSATIONERROR;
} else {
$actiondata["clientids"][$clientid] = false;
$actiondata["clientids"][$clientid] = $this->importer->ImportMessageChange(false, $message);
$actiondata["statusids"][$clientid] = SYNC_STATUS_SUCCESS;
}
} catch (StatusException $stex) {
$actiondata["statusids"][$clientid] = $stex->getCode();
}
break;
case SYNC_REMOVE:
try {
$actiondata["removeids"][] = $serverid;
// if message deletions are to be moved, move them
if ($spa->GetDeletesAsMoves()) {
$folderid = self::$backend->GetWasteBasket();
if ($folderid) {
$this->importer->ImportMessageMove($serverid, $folderid);
$actiondata["statusids"][$serverid] = SYNC_STATUS_SUCCESS;
break;
} else {
ZLog::Write(LOGLEVEL_WARN, "Message should be moved to WasteBasket, but the Backend did not return a destination ID. Message is hard deleted now!");
}
}
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:sogosync,代码行数:101,代码来源:sync.php
示例18: setPropsInMAPI
/**
* Sets the properties in a MAPI object according to an Sync object and a property mapping
*
* @param mixed $mapimessage
* @param SyncObject $message
* @param array $mapping
*
* @access private
* @return
*/
private function setPropsInMAPI($mapimessage, $message, $mapping)
{
$mapiprops = $this->getPropIdsFromStrings($mapping);
$unsetVars = $message->getUnsetVars();
$propsToDelete = array();
$propsToSet = array();
foreach ($mapiprops as $asprop => $mapiprop) {
if (isset($message->{$asprop})) {
// UTF8->windows1252.. this is ok for all numerical values
if (mapi_prop_type($mapiprop) != PT_BINARY && mapi_prop_type($mapiprop) != PT_MV_BINARY) {
if (is_array($message->{$asprop})) {
$value = array_map("u2wi", $message->{$asprop});
} else {
$value = u2wi($message->{$asprop});
}
} else {
$value = $message->{$asprop};
}
// Make sure the php values are the correct type
switch (mapi_prop_type($mapiprop)) {
case PT_BINARY:
case PT_STRING8:
settype($value, "string");
break;
case PT_BOOLEAN:
settype($value, "boolean");
break;
case PT_SYSTIME:
case PT_LONG:
settype($value, "integer");
break;
}
// decode base64 value
if ($mapiprop == PR_RTF_COMPRESSED) {
$value = base64_decode($value);
if (strlen($value) == 0) {
continue;
}
// PDA will sometimes give us an empty RTF, which we'll ignore.
// Note that you can still remove notes because when you remove notes it gives
// a valid compressed RTF with nothing in it.
}
// if an "empty array" is to be saved, it the mvprop should be deleted - fixes Mantis #468
if (is_array($value) && empty($value)) {
$propsToDelete[] = $mapiprop;
ZLog::Write(LOGLEVEL_DEBUG, sprintf("MAPIProvider->setPropsInMAPI(): Property '%s' to be deleted as it is an empty array", $asprop));
} else {
// all properties will be set at once
$propsToSet[$mapiprop] = $value;
}
} elseif (in_array($asprop, $unsetVars)) {
$propsToDelete[] = $mapiprop;
}
}
mapi_setprops($mapimessage, $propsToSet);
if (mapi_last_hresult()) {
Zlog::Write(LOGLEVEL_WARN, sprintf("Failed to set properties, trying to set them separately. Error code was:%x", mapi_last_hresult()));
$this->setPropsIndividually($mapimessage, $propsToSet, $mapiprops);
}
mapi_deleteprops($mapimessage, $propsToDelete);
//clean up
unset($unsetVars, $propsToDelete);
}
开发者ID:BackupTheBerlios,项目名称:z-push-svn,代码行数:73,代码来源:mapiprovider.php
示例19: SyncOOF
public function SyncOOF()
{
$mapping = array(SYNC_SETTINGS_OOFSTATE => array(self::STREAMER_VAR => "oofstate", self::STREAMER_CHECKS => array(array(self::STREAMER_CHECK_ONEVALUEOF => array(0, 1, 2)))), SYNC_SETTINGS_STARTTIME => array(self::STREAMER_VAR => "starttime", self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES), SYNC_SETTINGS_ENDTIME => array(self::STREAMER_VAR => "endtime", self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES), SYNC_SETTINGS_OOFMESSAGE => array(self::STREAMER_VAR => "oofmessage", self::STREAMER_TYPE => "SyncOOFMessage", self::STREAMER_PROP => self::STREAMER_TYPE_NO_CONTAINER, self::STREAMER_ARRAY => SYNC_SETTINGS_OOFMESSAGE), SYNC_SETTINGS_BODYTYPE => array(self::STREAMER_VAR => "bodytype", self::STREAMER_CHECKS => array(self::STREAMER_CHECK_ONEVALUEOF => array(SYNC_SETTINGSOOF_BODYTYPE_HTML, ucfirst(strtolower(SYNC_SETTINGSOOF_BODYTYPE_TEXT))))), SYNC_SETTINGS_PROP_STATUS => array(self::STREAMER_VAR => "Status", self::STREAMER_TYPE => self::STREAMER_TYPE_IGNORE));
parent::SyncObject($mapping);
}
开发者ID:karanikn,项目名称:php-addressbook,代码行数:5,代码来源:syncoof.php
示例20: array
function __construct()
{
$mapping = array(SYNC_AIRSYNCBASE_TYPE => array(self::STREAMER_VAR => "type"), SYNC_AIRSYNCBASE_ESTIMATEDDATASIZE => array(self::STREAMER_VAR => "estimatedDataSize"), SYNC_AIRSYNCBASE_TRUNCATED => array(self::STREAMER_VAR => "truncated"), SYNC_AIRSYNCBASE_DATA => array(self::STREAMER_VAR => "data", self::STREAMER_TYPE => self::STREAMER_TYPE_STREAM_ASPLAIN, self::STREAMER_RONOTIFY => true));
if (Request::GetProtocolVersion() >= 14.0) {
$mapping[SYNC_AIRSYNCBASE_PREVIEW] = array(self::STREAMER_VAR => "preview");
}
parent::__construct($mapping);
}
开发者ID:EGroupware,项目名称:z-push,代码行数:8,代码来源:syncbasebody.php
注:本文中的SyncObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论