GitList
Repositories
Help
Report an Issue
vroom360
Code
Commits
Branches
Tags
Search
Tree:
e36c40f
Branches
Tags
master
vroom360
ezcMail
Mail
src
parser
parts
rfc822_digest_parser.php
initial commit
Dev Ghai
commited
e36c40f
at 2013-09-26 06:24:15
rfc822_digest_parser.php
Blame
History
Raw
<?php /** * File containing the ezcMailRfc822DigestParser class * * @package Mail * @version 1.7.1 * @copyright Copyright (C) 2005-2010 eZ Systems AS. All rights reserved. * @license http://ez.no/licenses/new_bsd New BSD License */ /** * Parses RFC822 messages. * * Note that this class does not parse RFC822 digest messages containing of an extra header block. * Use the RFC822DigestParser to these. * * @package Mail * @version 1.7.1 * @access private */ class ezcMailRfc822DigestParser extends ezcMailPartParser { /** * Holds the headers for this part. * * @var ezcMailHeadersHolder */ private $headers = null; /** * Holds the digested message parser. * * @var ezcMailPartParser */ private $mailParser = null; /** * Holds the size of the digest. * * @var int */ private $size; /** * Constructs a new digest parser with the headers $headers. * * @param ezcMailHeadersHolder $headers */ public function __construct( ezcMailHeadersHolder $headers ) { $this->headers = $headers; $this->mailParser = new ezcMailRfc822Parser(); $this->size = 0; } /** * Parses each line of the digest body. * * Every line is part of the digested mail. It is sent directly to the mail parser. * * @param string $line */ public function parseBody( $line ) { $this->mailParser->parseBody( $line ); $this->size += strlen( $line ); } /** * Returns a ezcMailRfc822Digest with the digested mail in it. * * @return ezcMailRfc822Digest */ public function finish() { $digest = new ezcMailRfc822Digest( $this->mailParser->finish() ); ezcMailPartParser::parsePartHeaders( $this->headers, $digest ); $digest->size = $this->size; return $digest; } } ?>