コード例 #1
0
 /**
  * Compile the entire MIME document into a string
  * The returned string may be used in other documents if needed.
  * @return Swift_Cache_OutputStream
  */
 public function build()
 {
     $this->preBuild();
     $data = $this->buildData();
     $joint_os = new Swift_Cache_JointOutputStream();
     $this->cache->clear("headers");
     $this->cache->write("headers", $this->headers->build());
     $joint_os->addStream($this->cache->getOutputStream("headers"));
     $this->cache->clear("dbl_le");
     $this->cache->write("dbl_le", str_repeat($this->LE, 2));
     $joint_os->addStream($this->cache->getOutputStream("dbl_le"));
     $joint_os->addStream($data);
     return $joint_os;
     //return $this->headers->build() . str_repeat($this->LE, 2) . $data;
 }
コード例 #2
0
ファイル: Mime.php プロジェクト: jeffthestampede/excelsior
 /**
  * Compile the entire MIME document into a string
  * The returned string may be used in other documents if needed.
  * @return Swift_Cache_OutputStream
  */
 function &build()
 {
     $this->preBuild();
     $data =& $this->buildData();
     $i = array();
     $joint_os =& new Swift_Cache_JointOutputStream($i);
     $this->cache->clear("headers");
     $this->cache->write("headers", $this->headers->build());
     $headers =& $this->cache->getOutputStream("headers");
     $joint_os->addStream($headers);
     $this->cache->clear("dbl_le");
     $this->cache->write("dbl_le", str_repeat($this->LE, 2));
     $dbl_le =& $this->cache->getOutputStream("dbl_le");
     $joint_os->addStream($dbl_le);
     $joint_os->addStream($data);
     return $joint_os;
 }
コード例 #3
0
 public function testAttemptsToInjectLFFollowedByDotAreSquashed()
 {
     $headers = new Swift_Message_Headers();
     $headers->set(".Foo", "xxx");
     $structure = $headers->build();
     $this->assertEqual("Foo: xxx", $structure);
     $headers = new Swift_Message_Headers();
     $headers->set(".......Foo", "xxx");
     $structure = $headers->build();
     $this->assertEqual("Foo: xxx", $structure);
 }