original_string: protected function _msgText($stream, $data)
      {
          if ($data instanceof Horde_Stream) {
              if ($stream) {
                  $data->rewind();
                  return $data->stream;
              }
              return strval($data);
          }
  
          if (is_resource($data)) {
              rewind($data);
              return $stream
                  ? $data
                  : stream_get_contents($data);
          }
  
          if (!$stream) {
              return strval($data);
          }
  
          $tmp = fopen('php://temp', 'w+');
  
          if (!is_null($data)) {
              fwrite($tmp, $data);
              rewind($tmp);
          }
  
          return $tmp;
      }
code: protected function _msgText($stream, $data)
      {
          if ($data instanceof Horde_Stream) {
              if ($stream) {
                  $data->rewind();
                  return $data->stream;
              }
              return strval($data);
          }
  
          if (is_resource($data)) {
              rewind($data);
              return $stream
                  ? $data
                  : stream_get_contents($data);
          }
  
          if (!$stream) {
              return strval($data);
          }
  
          $tmp = fopen('php://temp', 'w+');
  
          if (!is_null($data)) {
              fwrite($tmp, $data);
              rewind($tmp);
          }
  
          return $tmp;
      }
code_tokens: protected function _msgText ( $ stream , $ data ) { if ( $ data instanceof Horde_Stream ) { if ( $ stream ) { $ data -> rewind ( ) ; return $ data -> stream ; } return strval ( $ data ) ; } if ( is_resource ( $ data ) ) { rewind ( $ data ) ; return $ stream ? $ data : stream_get_contents ( $ data ) ; } if ( ! $ stream ) { return strval ( $ data ) ; } $ tmp = fopen ( 'php://temp' , 'w+' ) ; if ( ! is_null ( $ data ) ) { fwrite ( $ tmp , $ data ) ; rewind ( $ tmp ) ; } return $ tmp ; }
docstring: Return text representation of a field.
  
  @param boolean $stream  Return as a stream?
  @param mixed $data      The field data (string or resource) or null if
  field does not exist.
  
  @return mixed  Requested text representation.
docstring_tokens: Return text representation of a field .