当前位置: 首页>>代码示例>>PHP>>正文


PHP Swift_InputByteStream::commit方法代码示例

本文整理汇总了PHP中Swift_InputByteStream::commit方法的典型用法代码示例。如果您正苦于以下问题:PHP Swift_InputByteStream::commit方法的具体用法?PHP Swift_InputByteStream::commit怎么用?PHP Swift_InputByteStream::commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Swift_InputByteStream的用法示例。


在下文中一共展示了Swift_InputByteStream::commit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: copyFromOpenSSLOutput

 /**
  * @param Swift_OutputByteStream $fromStream
  * @param Swift_InputByteStream  $toStream
  */
 protected function copyFromOpenSSLOutput(Swift_OutputByteStream $fromStream, Swift_InputByteStream $toStream)
 {
     $bufferLength = 4096;
     $filteredStream = new Swift_ByteStream_TemporaryFileByteStream();
     $filteredStream->addFilter($this->replacementFactory->createFilter("\r\n", "\n"), 'CRLF to LF');
     $filteredStream->addFilter($this->replacementFactory->createFilter("\n", "\r\n"), 'LF to CRLF');
     while (false !== ($buffer = $fromStream->read($bufferLength))) {
         $filteredStream->write($buffer);
     }
     $filteredStream->flushBuffers();
     while (false !== ($buffer = $filteredStream->read($bufferLength))) {
         $toStream->write($buffer);
     }
     $toStream->commit();
 }
开发者ID:NivalM,项目名称:VacantesJannaMotors,代码行数:19,代码来源:SMimeSigner.php

示例2: toByteStream

 /**
  * Write this entire entity to a {@see Swift_InputByteStream}.
  *
  * @param Swift_InputByteStream
  */
 public function toByteStream(Swift_InputByteStream $is)
 {
     $is->write($this->_headers->toString());
     $is->commit();
     $this->_bodyToByteStream($is);
 }
开发者ID:Annnnnnnnnnnl,项目名称:CodingGirlsWeb,代码行数:11,代码来源:SimpleMimeEntity.php

示例3: toByteStream

 /**
  * Write this entire entity to a {@see Swift_InputByteStream}.
  *
  * @param Swift_InputByteStream
  */
 public function toByteStream(Swift_InputByteStream $is)
 {
     $is->write($this->_headers->toString());
     $is->commit();
     if (empty($this->_immediateChildren)) {
         if (isset($this->_body)) {
             if ($this->_cache->hasKey($this->_cacheKey, 'body')) {
                 $this->_cache->exportToByteStream($this->_cacheKey, 'body', $is);
             } else {
                 $cacheIs = $this->_cache->getInputByteStream($this->_cacheKey, 'body');
                 if ($cacheIs) {
                     $is->bind($cacheIs);
                 }
                 $is->write("\r\n");
                 if ($this->_body instanceof Swift_OutputByteStream) {
                     $this->_body->setReadPointer(0);
                     $this->_encoder->encodeByteStream($this->_body, $is, 0, $this->getMaxLineLength());
                 } else {
                     $is->write($this->_encoder->encodeString($this->getBody(), 0, $this->getMaxLineLength()));
                 }
                 if ($cacheIs) {
                     $is->unbind($cacheIs);
                 }
             }
         }
     }
     if (!empty($this->_immediateChildren)) {
         foreach ($this->_immediateChildren as $child) {
             $is->write("\r\n\r\n--" . $this->getBoundary() . "\r\n");
             $child->toByteStream($is);
         }
         $is->write("\r\n\r\n--" . $this->getBoundary() . "--\r\n");
     }
 }
开发者ID:laiello,项目名称:yii-mail-fix,代码行数:39,代码来源:SimpleMimeEntity.php


注:本文中的Swift_InputByteStream::commit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。