當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。