/** * Edit attributes of a document. * * @param object $doc EstraierPure_Document * which is a document object. * @return bool True if success, else false. * @access public */ public function edit_doc(EstraierPure_Document $doc) { $this->status = -1; if (!$this->url) { return false; } $turl = $this->url . '/edit_doc'; $reqheads = array('Content-Type' => 'text/x-estraier-draft'); if ($this->auth) { $reqheads['Authorization'] = 'Basic ' . base64_encode($this->auth); } $reqbody = $doc->dump_draft(); $rv = EstraierPure_Utility::shuttle_url($turl, $this->pxhost, $this->pxport, $this->timeout, $reqheads, $reqbody); if (PEAR::isError($rv)) { return false; } $this->status = $rv; return $rv == 200; }