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

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2
Browse files Browse the repository at this point in the history
Fixed files permissions
  • Loading branch information
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 34 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.4-dev",
"dev-develop": "2.5-dev"
"dev-master": "2.1-dev",
"dev-develop": "2.2-dev"
}
},
"autoload-dev": {
Expand Down
5 changes: 0 additions & 5 deletions src/Decode.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Mime
*/

namespace Zend\Mime;

use Zend\Mail\Headers;
use Zend\Stdlib\ErrorHandler;

/**
* @category Zend
* @package Zend_Mime
*/
class Decode
{
/**
Expand Down
5 changes: 0 additions & 5 deletions src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Mime
*/

namespace Zend\Mime\Exception;

/**
* @category Zend
* @package Zend_Mime
*/
interface ExceptionInterface
{}
4 changes: 0 additions & 4 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Mime
*/

namespace Zend\Mime\Exception;

/**
* Exception for Zend_Mime component.
*
* @category Zend
* @package Zend_Mime
*/
class RuntimeException
extends \RuntimeException
Expand Down
16 changes: 6 additions & 10 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Mime
*/

namespace Zend\Mime;

/**
* @category Zend
* @package Zend_Mime
*/
class Message
{

Expand Down Expand Up @@ -111,9 +106,9 @@ public function getMime()
*/
public function generateMessage($EOL = Mime::LINEEND)
{
if (! $this->isMultiPart()) {
$body = array_shift($this->parts);
$body = $body->getContent($EOL);
if (!$this->isMultiPart()) {
$part = current($this->parts);
$body = $part->getContent($EOL);
} else {
$mime = $this->getMime();

Expand Down Expand Up @@ -181,8 +176,8 @@ public function getPartContent($partnum, $EOL = Mime::LINEEND)
*/
protected static function _disassembleMime($body, $boundary)
{
$start = 0;
$res = array();
$start = 0;
$res = array();
// find every mime part limiter and cut out the
// string before it.
// the part before the first boundary string is discarded:
Expand Down Expand Up @@ -265,6 +260,7 @@ public static function createFromMessage($message, $boundary, $EOL = Mime::LINEE
}
$res->addPart($newPart);
}

return $res;
}
}
4 changes: 0 additions & 4 deletions src/Mime.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Mime
*/

namespace Zend\Mime;

/**
* Support class for MultiPart Mime Messages
*
* @category Zend
* @package Zend_Mime
*/
class Mime
{
Expand Down
5 changes: 1 addition & 4 deletions src/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Mime
*/

namespace Zend\Mime;

/**
* Class representing a MIME part.
*
* @category Zend
* @package Zend_Mime
*/
class Part
{
Expand Down Expand Up @@ -70,6 +66,7 @@ public function isStream()
* if this was created with a stream, return a filtered stream for
* reading the content. very useful for large file attachments.
*
* @param string $EOL
* @return stream
* @throws Exception\RuntimeException if not a stream or unable to append filter
*/
Expand Down
12 changes: 12 additions & 0 deletions test/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,16 @@ public function testDecodeMimeMessage()
$this->assertEquals('base64', $part2->encoding);
$this->assertEquals('12', $part2->id);
}

public function testNonMultipartMessageShouldNotRemovePartFromMessage()
{
$message = new Mime\Message(); // No Parts
$part = new Mime\Part('This is a test');
$message->addPart($part);
$message->generateMessage();

$parts = $message->getParts();
$test = current($parts);
$this->assertSame($part, $test);
}
}

0 comments on commit 420f236

Please sign in to comment.