Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
 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;
     }
 }
Exemplo n.º 3
0
 function to_php($value)
 {
     return JsonDataParser::decode($value);
 }