/** * Initializes the importer * * @param string $state * @param int $flags * * @access public * @return boolean * @throws StatusException */ public function Config($state, $flags = 0) { $this->flags = $flags; // this should never happen if ($this->importer === false) { throw new StatusException("ImportChangesICS->Config(): Error, importer not available", SYNC_FSSTATUS_CODEUNKNOWN, null, LOGLEVEL_ERROR); } // Put the state information in a stream that can be used by ICS $stream = mapi_stream_create(); if (strlen($state) == 0) { $state = hex2bin("0000000000000000"); } ZLog::Write(LOGLEVEL_DEBUG, sprintf("ImportChangesICS->Config(): initializing importer with state: 0x%s", bin2hex($state))); mapi_stream_write($stream, $state); $this->statestream = $stream; if ($this->folderid !== false) { // possible conflicting messages will be cached here $this->memChanges = new ChangesMemoryWrapper(); $stat = mapi_importcontentschanges_config($this->importer, $stream, $flags); } else { $stat = mapi_importhierarchychanges_config($this->importer, $stream, $flags); } if (!$stat) { throw new StatusException(sprintf("ImportChangesICS->Config(): Error, mapi_import_*_changes_config() failed: 0x%X", mapi_last_hresult()), SYNC_FSSTATUS_CODEUNKNOWN, null, LOGLEVEL_WARN); } return $stat; }
function Config($state, $flags = 0) { $stream = mapi_stream_create(); if (strlen($state) == 0) { $state = hex2bin("0000000000000000"); } mapi_stream_write($stream, $state); $this->statestream = $stream; mapi_importcontentschanges_config($this->importer, $stream, $flags); }
function Config($state, $flags = 0) { $stream = mapi_stream_create(); if (strlen($state) == 0) { $state = hex2bin("0000000000000000"); } mapi_stream_write($stream, $state); $this->statestream = $stream; mapi_importcontentschanges_config($this->importer, $stream, $flags); $this->_flags = $flags; // conflicting messages can be cached here $this->_memChanges = new ImportContentsChangesMem(); }
function Config($state, $flags = 0, $mclass = false, $restrict = false, $bodypreference = false, $optionbodypreference = false) { $stream = mapi_stream_create(); if (strlen($state) == 0) { $state = hex2bin("0000000000000000"); } mapi_stream_write($stream, $state); $this->statestream = $stream; mapi_importcontentschanges_config($this->importer, $stream, $flags); $this->_flags = $flags; // debugLog("ImportContentsChangesICS->Config: ".($this->_folderid ? "Have Folder" : "No Folder"). " mclass: ". $mclass. " state: ". bin2hex($state) . " restriction " . $restrict); // configure an exporter so we can detect conflicts $exporter = new ExportChangesICS($this->_session, $this->_store, $this->_folderid); $memImporter = new ImportContentsChangesMem(); $exporter->Config($memImporter, $mclass, $restrict, $state, 0, 0, $bodypreference, $optionbodypreference); while (is_array($exporter->Synchronize())) { } $this->_memChanges = $memImporter; }