/** * 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; }
/** * 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; }