From: Michael M Slusarz Date: Mon, 13 Jul 2009 20:15:22 +0000 (-0600) Subject: Remove dependency on Mail_mimedecode. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=11f96fc9ee47d45fb32ed339b8fd1ea1d7a59832;p=horde.git Remove dependency on Mail_mimedecode. --- diff --git a/ingo/lib/Script/imap/mock.php b/ingo/lib/Script/imap/mock.php index 849b7f34b..ecd4784a1 100644 --- a/ingo/lib/Script/imap/mock.php +++ b/ingo/lib/Script/imap/mock.php @@ -23,19 +23,9 @@ class Ingo_Script_imap_mock extends Ingo_Script_imap_api $dh = opendir($dir); while (($dent = readdir($dh)) !== false) { - if ($dent == '.' || $dent == '..') { - continue; + if (!in_array($dent, array('.', '..'))) { + $this->_fixtures[$dent] = Horde_Mime_Part::parseHeaders(file_get_contents($dir . '/' . $dent)); } - $name = $dir . '/' . $dent; - $fh = fopen($name, 'r'); - $data = fread($fh, filesize($name)); - fclose($fh); - - $params = array('input' => &$data, - 'include_bodies' => true, - 'decode_bodies' => true, - 'decode_headers' => true); - $this->_fixtures[$dent] = Mail_mimeDecode::decode($params); } closedir($dh); @@ -121,7 +111,7 @@ class Ingo_Script_imap_mock extends Ingo_Script_imap_api $fixture = $this->_fixtures[$this->_folders['INBOX'][$i]['fixture']]; $result[] = array( 'envelope' => array( - 'from' => $fixture->headers['from'], + 'from' => $fixture->getValue('from'), 'uid' => $uid ) );