protected function read()
    {
        $line = fgets($this->input);
        if ($line === false) {
            throw new PAGIException('Could not read from AGI');
        }
        $line = substr($line, 0, -1);
        $this->logger->debug('Read: ' . $line);
        return $line;
    }