示例#1
0
 /**
  * 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;
 }
示例#2
0
文件: ics.php 项目: jkreska/test1
 function Config($state)
 {
     // Put the state information in a stream that can be used by ICS
     $stream = mapi_stream_create();
     if (strlen($state) > 0) {
         mapi_stream_write($stream, $state);
     } else {
         mapi_stream_write($stream, hex2bin("0000000000000000"));
     }
     return mapi_importhierarchychanges_config($this->importer, $stream, 0);
 }
示例#3
0
文件: ics.php 项目: nnaannoo/paskot
 function Config($state, $flags = 0)
 {
     // Put the state information in a stream that can be used by ICS
     $stream = mapi_stream_create();
     if (strlen($state) == 0) {
         $state = hex2bin("0000000000000000");
     }
     mapi_stream_write($stream, $state);
     $this->statestream = $stream;
     return mapi_importhierarchychanges_config($this->importer, $stream, $flags);
 }
示例#4
0
 function Config($state)
 {
     return mapi_importhierarchychanges_config($this->importer, $state);
 }