function RunQueries()
{
if (empty($this->_reqs)) {
$this->_error = "no queries defined, issue AddQuery() first";
return false;
}
// mbstring workaround
$this->_MBPush();
if (!($fp = $this->_Connect())) {
$this->_MBPop();
return false;
}
// send query, get response
$nreqs = count($this->_reqs);
$req = join("", $this->_reqs);
$len = 8 + strlen($req);
$req = pack("nnNNN", SEARCHD_COMMAND_SEARCH, VER_COMMAND_SEARCH, $len, 0, $nreqs) . $req;
// add header
if (!$this->_Send($fp, $req, $len + 8) || !($response = $this->_GetResponse($fp, VER_COMMAND_SEARCH))) {
$this->_MBPop();
return false;
}
// query sent ok; we can reset reqs now
$this->_reqs = array();
// parse and return response
return $this->_ParseSearchResponse($response, $nreqs);
}