Пример #1
0
 function GetState()
 {
     if (!isset($this->statestream) || $this->exporter === false) {
         return false;
     }
     if (mapi_exportchanges_updatestate($this->exporter, $this->statestream) != true) {
         debugLog("Unable to update state: " . sprintf("%X", mapi_last_hresult()));
         return false;
     }
     mapi_stream_seek($this->statestream, 0, STREAM_SEEK_SET);
     $state = "";
     while (true) {
         $data = mapi_stream_read($this->statestream, 4096);
         if (strlen($data)) {
             $state .= $data;
         } else {
             break;
         }
     }
     return $state;
 }
Пример #2
0
 /**
  * Reads the current state from the Exporter
  *
  * @access public
  * @return string
  * @throws StatusException
  */
 public function GetState()
 {
     $error = false;
     if (!isset($this->statestream) || $this->exporter === false) {
         $error = true;
     }
     if ($error === true || mapi_exportchanges_updatestate($this->exporter, $this->statestream) != true) {
         throw new StatusException(sprintf("ExportChangesICS->GetState(): Error, state not available or unable to update: 0x%X", mapi_last_hresult()), $this->folderid ? SYNC_STATUS_FOLDERHIERARCHYCHANGED : SYNC_FSSTATUS_CODEUNKNOWN, null, LOGLEVEL_WARN);
     }
     mapi_stream_seek($this->statestream, 0, STREAM_SEEK_SET);
     $state = "";
     while (true) {
         $data = mapi_stream_read($this->statestream, 4096);
         if (strlen($data)) {
             $state .= $data;
         } else {
             break;
         }
     }
     return $state;
 }