/** * Get the value of an attribute. * * @param string $name The name of an attribute. * @return string The value of the attribute. If it does not exist, returns `null'. * @access public */ public function getAttribute($name) { SERVICES_HYPERESTRAIER_DEBUG && Services_HyperEstraier_Utility::checkTypes(array($name, 'string')); return isset($this->_attrs[$name]) ? $this->_attrs[$name] : null; }
/** * Get the value of hint information. * * @param string $key The key of a hint. * "VERSION", "NODE", "HIT", "HINT#n", "DOCNUM", * "WORDNUM", "TIME", "TIME#n", "LINK#n", and "VIEW" * are provided for keys. * @return string The hint. If the key does not exist, returns `null'. * @access public */ public function getHint($key) { SERVICES_HYPERESTRAIER_DEBUG && Services_HyperEstraier_Utility::checkTypes(array($key, 'string')); return isset($this->_hints[$key]) ? $this->_hints[$key] : null; }
/** * Set information of the node. * * @return void * @access private */ private function _setInfo() { $this->_status = -1; if (!$this->_url) { return; } $turl = $this->_url . '/inform'; $reqheads = array(); $res = Services_HyperEstraier_Utility::shuttleUrl($turl, $this->_auth, $this->_pxhost, $this->_pxport, $this->_timeout, $reqheads, null, $res); if (!$res) { return; } $this->_status = $res->getResponseCode(); if ($res->isError()) { return; } $lines = explode("\n", $res->getResponseBody()); if (count($lines) == 0) { return; } $elems = explode("\t", $lines[0]); if (count($elems) != 5) { return; } $this->_name = $elems[0]; $this->_label = $elems[1]; $this->_dnum = intval($elems[2]); $this->_wnum = intval($elems[3]); $this->_size = floatval($elems[4]); $llen = count($lines); if ($llen < 2) { return; } $lnum = 1; if ($lnum < $llen && strlen($lines[$lnum]) < 1) { $lnum++; } $this->_admins = array(); while ($lnum < $llen) { $line = $lines[$lnum]; if (strlen($line) < 1) { break; } $this->_admins[] = $line; $lnum++; } if ($lnum < $llen && strlen($lines[$lnum]) < 1) { $lnum++; } $this->_users = array(); while ($lnum < $llen) { $line = $lines[$lnum]; if (strlen($line) < 1) { break; } $this->_users[] = $line; $lnum++; } if ($lnum < $llen && strlen($lines[$lnum]) < 1) { $lnum++; } $this->_links = array(); while ($lnum < $llen) { $line = $lines[$lnum]; if (strlen($line) < 1) { break; } $links = explode($line); if (count($links) == 3) { $this->_links[] = $links; } $lnum++; } }
/** * Set the mask of targets of meta search. * * @param int $mask A masking number. * 1 means the first target, 2 means the second target, * 4 means the third target, and power values of 2 and * their summation compose the mask. * @return void * @access public */ public function setMask($mask) { SERVICES_HYPERESTRAIER_DEBUG && Services_HyperEstraier_Utility::checkTypes(array($mask, 'integer')); $this->_mask = $mask; }