Livestatus\Connection: discover column headers...

...in case the query doesn't know about
This commit is contained in:
Thomas Gelf 2014-11-16 15:56:58 +01:00
parent 8ec8c153dd
commit e755b37af3
1 changed files with 9 additions and 0 deletions

View File

@ -248,6 +248,15 @@ class Connection
return $buffer;
}
protected function discoverColumnHeaders($query)
{
if ($query->hasColumns()) {
$this->headers = $query->getColumnAliases();
} else {
$this->headers = $this->splitLine($this->readLineFromSocket());
}
}
protected function readLineFromSocket()
{
if ($this->bytesRead === $this->responseSize) {