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
  • Loading branch information
thomasweidner committed Jun 26, 2011
5 parents 77ccbbc + ea99bf1 + e2703e7 + 90db7ae + b2f5380 commit 74b0454
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/AbstractProtocol.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function __construct($host = '127.0.0.1', $port = null)
$this->_validHost->addValidator(new HostnameValidator(HostnameValidator::ALLOW_ALL));

if (!$this->_validHost->isValid($host)) {
throw new Protocol\Exception\RuntimeException(join(', ', $this->_validHost->getMessages()));
throw new Protocol\Exception\RuntimeException(implode(', ', $this->_validHost->getMessages()));
}

$this->_host = $host;
Expand Down
1 change: 0 additions & 1 deletion src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
namespace Zend\Mail;

/**
* @uses \Zend\Exception
* @category Zend
* @package Zend_Mail
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down
2 changes: 1 addition & 1 deletion src/Part/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
use Zend\Mail;

/**
* @uses \Zend\Exception
* @uses \Zend\Mail\Exception
* @category Zend
* @package Zend_Mail
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down
2 changes: 1 addition & 1 deletion src/Protocol/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use Zend\Mail;

/**
* @uses \Zend\Exception
* @uses \Zend\Mail\Exception
* @category Zend
* @package Zend_Mail
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down
4 changes: 2 additions & 2 deletions src/Protocol/Imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public function sendRequest($command, $tokens = array(), &$tag = null)

foreach ($tokens as $token) {
if (is_array($token)) {
if (@fputs($this->_socket, $line . ' ' . $token[0] . "\r\n") === false) {
if (@fwrite($this->_socket, $line . ' ' . $token[0] . "\r\n") === false) {
throw new Exception\RuntimeException('cannot write - connection closed?');
}
if (!$this->_assumedNextLine('+ ')) {
Expand All @@ -342,7 +342,7 @@ public function sendRequest($command, $tokens = array(), &$tag = null)
}
}

if (@fputs($this->_socket, $line . "\r\n") === false) {
if (@fwrite($this->_socket, $line . "\r\n") === false) {
throw new Exception\RuntimeException('cannot write - connection closed?');
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Protocol/Smtp.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function helo($host = '127.0.0.1')

// Validate client hostname
if (!$this->_validHost->isValid($host)) {
throw new Exception\RuntimeException(join(', ', $this->_validHost->getMessages()));
throw new Exception\RuntimeException(implode(', ', $this->_validHost->getMessages()));
}

// Initiate helo sequence
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use Zend\Mail;

/**
* @uses \Zend\Exception
* @uses \Zend\Mail\Exception
* @category Zend
* @package Zend_Mail
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down
10 changes: 5 additions & 5 deletions src/Storage/Writable/Maildir.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ public function renameFolder($oldName, $newName)
protected function _createUniqueId()
{
$id = '';
$id .= function_exists('microtime') ? microtime(true) : (time() . ' ' . rand(0, 100000));
$id .= '.' . (function_exists('posix_getpid') ? posix_getpid() : rand(50, 65535));
$id .= microtime(true);
$id .= '.' . getmypid();
$id .= '.' . php_uname('n');

return $id;
Expand Down Expand Up @@ -477,7 +477,7 @@ public function appendMessage($message, $folder = null, $flags = null, $recent =
if (is_resource($message) && get_resource_type($message) == 'stream') {
stream_copy_to_stream($message, $temp_file['handle']);
} else {
fputs($temp_file['handle'], $message);
fwrite($temp_file['handle'], $message);
}
fclose($temp_file['handle']);

Expand Down Expand Up @@ -819,8 +819,8 @@ protected function _calculateMaildirsize()
$definition[] = $value . $type;
}
$definition = implode(',', $definition);
fputs($fh, "$definition\n");
fputs($fh, "$total_size $messages\n");
fwrite($fh, "$definition\n");
fwrite($fh, "$total_size $messages\n");
fclose($fh);
rename($tmp['filename'], $this->_rootdir . 'maildirsize');
foreach ($timestamps as $dir => $timestamp) {
Expand Down
2 changes: 1 addition & 1 deletion src/Transport/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use Zend\Mail;

/**
* @uses \Zend\Exception
* @uses \Zend\Mail\Exception
* @category Zend
* @package Zend_Mail
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down
16 changes: 8 additions & 8 deletions test/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function testSplitInvalidMessage()
{
try {
Mime\Decode::splitMessageStruct("--xxx\n", 'xxx');
} catch (\Zend\Exception $e) {
} catch (\Zend\Mime\Exception $e) {
return; // ok
}

Expand All @@ -173,7 +173,7 @@ public function testInvalidMailHandler()
{
try {
$message = new Message(array('handler' => 1));
} catch (\Zend\Exception $e) {
} catch (\Zend\Mime\Exception $e) {
return; // ok
}

Expand All @@ -187,7 +187,7 @@ public function testMissingId()

try {
$message = new Message(array('handler' => $mail));
} catch (\Zend\Exception $e) {
} catch (\Zend\Mime\Exception $e) {
return; // ok
}

Expand Down Expand Up @@ -230,7 +230,7 @@ public function testSplitInvalidHeader()
$header = '';
try {
Mime\Decode::splitHeaderField($header);
} catch (\Zend\Exception $e) {
} catch (\Zend\Mime\Exception $e) {
return; // ok
}

Expand Down Expand Up @@ -268,7 +268,7 @@ public function testNoContent()

try {
$message->getContent();
} catch (\Zend\Exception $e) {
} catch (\Zend\Mime\Exception $e) {
return; // ok
}

Expand All @@ -284,7 +284,7 @@ public function testEmptyHeader()
$subject = null;
try {
$subject = $message->subject;
} catch (\Zend\Exception $e) {
} catch (\Zend\Mime\Exception $e) {
// ok
}
if ($subject) {
Expand All @@ -298,7 +298,7 @@ public function testEmptyBody()
$part = null;
try {
$part = $message->getPart(1);
} catch (\Zend\Exception $e) {
} catch (\Zend\Mime\Exception $e) {
// ok
}
if ($part) {
Expand Down Expand Up @@ -329,7 +329,7 @@ public function testWrongMultipart()

try {
$message->getPart(1);
} catch (\Zend\Exception $e) {
} catch (\Zend\Mime\Exception $e) {
return; // ok
}
$this->fail('no exception raised while getting part from message without boundary');
Expand Down

0 comments on commit 74b0454

Please sign in to comment.