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' into markup
Browse files Browse the repository at this point in the history
Conflicts:
	library/Zend/Markup/Parser/Textile.php
	library/Zend/Markup/Renderer/AbstractRenderer.php
	library/Zend/Markup/Renderer/Html.php
  • Loading branch information
kokx committed Oct 30, 2010
3 parents d7eb727 + ea05ef8 + 3b0e0d4 commit 431fead
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 31 deletions.
6 changes: 2 additions & 4 deletions src/Decode.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
* @package Zend_Mime
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
* @namespace
*/
namespace Zend\Mime;
use Zend;

/**
* @uses \Zend\Exception
Expand Down Expand Up @@ -72,7 +70,7 @@ public static function splitMime($body, $boundary)
// no more parts, find end boundary
$p = strpos($body, '--' . $boundary . '--', $start);
if ($p===false) {
throw new Zend\Exception('Not a valid Mime Message: End Missing');
throw new Exception\RuntimeException('Not a valid Mime Message: End Missing');
}

// the remaining part also needs to be parsed:
Expand Down Expand Up @@ -205,7 +203,7 @@ public static function splitHeaderField($field, $wantedPart = null, $firstName =

$field = $firstName . '=' . $field;
if (!preg_match_all('%([^=\s]+)\s*=\s*("[^"]+"|[^;]+)(;\s*|$)%', $field, $matches)) {
throw new Zend\Exception('not a valid header field');
throw new Exception\RuntimeException('not a valid header field');
}

if ($wantedPart) {
Expand Down
4 changes: 1 addition & 3 deletions src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
* @package Zend_Mime
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
* @namespace
*/
namespace Zend\Mime;
use Zend;

/**
* @uses \Zend\Exception
Expand All @@ -32,6 +30,6 @@
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Exception extends Zend\Exception
interface Exception
{}

41 changes: 41 additions & 0 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Mime
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id$
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* @namespace
*/
namespace Zend\Mime\Exception;
use Zend\Mime\Exception;

/**
* Exception for Zend_Mime component.
*
* @uses Zend\Exception
* @category Zend
* @package Zend_Mime
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class RuntimeException
extends \RuntimeException
implements Exception
{
}
6 changes: 2 additions & 4 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
* @package Zend_Mime
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
* @namespace
*/
namespace Zend\Mime;
use Zend;

/**
* @uses \Zend\Exception
Expand Down Expand Up @@ -221,7 +219,7 @@ protected static function _disassembleMime($body, $boundary)
// no more parts, find end boundary
$p = strpos($body, '--' . $boundary . '--', $start);
if ($p===false) {
throw new Zend\Exception('Not a valid Mime Message: End Missing');
throw new Exception\RuntimeException('Not a valid Mime Message: End Missing');
}

// the remaining part also needs to be parsed:
Expand Down Expand Up @@ -273,7 +271,7 @@ public static function createFromMessage($message, $boundary, $EOL = Mime::LINEE
$newPart->language = $value;
break;
default:
throw new Zend\Exception('Unknown header ignored for MimePart:' . $key);
throw new Exception\RuntimeException('Unknown header ignored for MimePart:' . $key);
}
}
$res->addPart($newPart);
Expand Down
1 change: 0 additions & 1 deletion src/Mime.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @package Zend_Mime
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand Down
7 changes: 3 additions & 4 deletions src/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @package Zend_Mime
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand Down Expand Up @@ -94,7 +93,7 @@ public function isStream()
public function getEncodedStream()
{
if (!$this->_isStream) {
throw new Exception('Attempt to get a stream from a string part');
throw new Exception\RuntimeException('Attempt to get a stream from a string part');
}

//stream_filter_remove(); // ??? is that right?
Expand All @@ -110,7 +109,7 @@ public function getEncodedStream()
)
);
if (!is_resource($filter)) {
throw new Exception('Failed to append quoted-printable filter');
throw new Exception\RuntimeException('Failed to append quoted-printable filter');
}
break;
case Mime::ENCODING_BASE64:
Expand All @@ -124,7 +123,7 @@ public function getEncodedStream()
)
);
if (!is_resource($filter)) {
throw new Exception('Failed to append base64 filter');
throw new Exception\RuntimeException('Failed to append base64 filter');
}
break;
default:
Expand Down
5 changes: 0 additions & 5 deletions test/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage UnitTests
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand All @@ -26,10 +25,6 @@
namespace ZendTest\Mime;
use Zend\Mime;

/**
* PHPUnit test case
*/

/**
* @category Zend
* @package Zend_Mime
Expand Down
1 change: 0 additions & 1 deletion test/MimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage UnitTests
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id $
*/

/**
Expand Down
9 changes: 0 additions & 9 deletions test/PartTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage UnitTests
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand All @@ -26,14 +25,6 @@
namespace ZendTest\Mime;
use Zend\Mime;

/**
* Zend_Mime_Part
*/

/**
* PHPUnit test case
*/

/**
* @category Zend
* @package Zend_Mime
Expand Down

0 comments on commit 431fead

Please sign in to comment.