public function uploadstatus() { $this->sessionCheck(); $result = Zotero_Sync::getSessionUploadResult($this->sessionID); if ($result === false) { $queued = $this->responseXML->addChild('queued'); $queued['wait'] = $this->getWaitTime($this->sessionID); $this->end(); } $this->clearWaitTime($this->sessionID); if (!isset($result['exception'])) { $this->responseXML['timestamp'] = $result['timestamp']; $this->responseXML->addChild('uploaded'); $this->end(); } if (is_array($result)) { $this->handleUploadError($result['exception'], $result['xmldata']); } throw new Exception("Unexpected session result {$result}"); }