Beispiel #1
0
 /**
  * Wrap a structured header line
  * 
  * @param  string $value 
  * @param  Header $header 
  * @return string
  */
 protected static function wrapStructuredHeader($value, Header $header)
 {
     $delimiter = $header->getDelimiter();
     $length = strlen($value);
     $lines = array();
     $temp = '';
     for ($i = 0; $i < $length; $i++) {
         $temp .= $value[$i];
         if ($value[$i] == $delimiter) {
             $lines[] = $temp;
             $temp = '';
         }
     }
     return implode("\r\n ", $lines);
 }
Beispiel #2
0
 /**
  * Add a Header to this container, for raw values @see addHeaderLine() and addHeaders()
  * 
  * @param  Header $header
  * @return Headers
  */
 public function addHeader(Header $header)
 {
     $key = $this->normalizeFieldName($header->getFieldName());
     $this->headersKeys[] = $key;
     $this->headers[] = $header;
     $header->setEncoding($this->getEncoding());
     return $this;
 }