getHeaders() публичный Метод

Return the message headers.
public getHeaders ( ) : Horde_Mime_Headers
Результат Horde_Mime_Headers The header object.
Пример #1
0
    public function testHeadersMultipartAlternativeAsStream()
    {
        $fixture = fopen(__DIR__ . '/fixtures/iOSMultipartAlternative.eml', 'r');
        $rfc822 = new Horde_ActiveSync_Rfc822($fixture);
        $test = $rfc822->getHeaders();
        $expected = array('Subject' => 'Testing', 'From' => '*****@*****.**', 'Content-Type' => 'multipart/alternative;
 boundary=Apple-Mail-B1C01B47-00D8-4AFB-8B65-DF81C4E4B47D', 'Message-Id' => '<*****@*****.**>', 'Date' => 'Tue, 1 Jan 2013 18:10:37 -0500', 'To' => 'Michael Rubinsky <*****@*****.**>', 'Content-Transfer-Encoding' => '7bit', 'Mime-Version' => '1.0 (1.0)', 'User-Agent' => 'Horde Application Framework 5');
        $this->assertEquals($expected, $rfc822->getHeaders()->toArray());
        fclose($fixture);
    }
Пример #2
0
 /**
  * @dataProvider headersMultipartAlternativeProvider
  */
 public function testHeadersMultipartAlternative($fixture, $expected)
 {
     $rfc822 = new Horde_ActiveSync_Rfc822($fixture);
     $test = array_change_key_case($rfc822->getHeaders()->toArray(), CASE_LOWER);
     ksort($test);
     $this->assertEquals($expected, $test);
     if (is_resource($fixture)) {
         fclose($fixture);
     }
 }
Пример #3
0
 /**
  * Set the raw message content received from the EAS client to send.
  *
  * @param Horde_ActiveSync_Rfc822 $raw  The data from the EAS client.
  */
 public function setRawMessage(Horde_ActiveSync_Rfc822 $raw)
 {
     $this->_headers = $raw->getHeaders();
     // Attempt to always use the identity's From address, but fall back
     // to the device's sent value if it's not present.
     if ($from = $this->_getIdentityFromAddress()) {
         $this->_headers->removeHeader('From');
         $this->_headers->addHeader('From', $from);
     }
     // Reply-To?
     if ($replyto = $this->_getReplyToAddress()) {
         $this->_headers->addHeader('Reply-To', $replyto);
     }
     $this->_raw = $raw;
 }