Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
bakura10 committed Oct 23, 2012
4 parents 5e1c4bb + de6ba8b + 19c92ef + 730f592 commit 4ea71ee
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 91 deletions.
21 changes: 21 additions & 0 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,4 +535,25 @@ public function toString()
. Headers::EOL
. $this->getBodyText();
}

/**
* Instantiate from raw message string
*
* @todo Restore body to Mime\Message
* @param string $rawMessage
* @return Message
*/
public static function fromString($rawMessage)
{
$message = new static();
$headers = null;
$content = null;
Mime\Decode::splitMessage($rawMessage, $headers, $content);
if ($headers->has('mime-version')) {
// todo - restore body to mime\message
}
$message->setHeaders($headers);
$message->setBody($content);
return $message;
}
}
Loading

0 comments on commit 4ea71ee

Please sign in to comment.