function read_block() { $block = fgets($this->stream); if ($json = JsonDataParser::decode($block)) { return $json; } if (strlen($block)) { $this->stderr->write("Unable to read block from input"); die; } }
function read_block() { $block = ''; while (!feof($this->stream) && ($c = fgetc($this->stream)) != "") { $block .= $c; } if ($json = JsonDataParser::decode($block)) { return $json; } if (strlen($block)) { $this->stderr->write("Unable to read block from input"); die; } }
function to_php($value) { return JsonDataParser::decode($value); }