Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
 1: <?php
 2: 
 3: /*
 4:  * This file is part of SwiftMailer.
 5:  * (c) 2004-2009 Chris Corbyn
 6:  *
 7:  * For the full copyright and license information, please view the LICENSE
 8:  * file that was distributed with this source code.
 9:  */
10: 
11: /**
12:  * Handles Base 64 Transfer Encoding in Swift Mailer.
13:  * @package Swift
14:  * @subpackage Mime
15:  * @author Chris Corbyn
16:  */
17: class Swift_Mime_ContentEncoder_Base64ContentEncoder extends Swift_Encoder_Base64Encoder implements Swift_Mime_ContentEncoder
18: {
19:     /**
20:      * Encode stream $in to stream $out.
21:      * @param Swift_OutputByteStream $in
22:      * @param Swift_InputByteStream  $out
23:      * @param int                    $firstLineOffset
24:      * @param int                    $maxLineLength,  optional, 0 indicates the default of 76 bytes
25:      */
26:     public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0)
27:     {
28:         if (0 >= $maxLineLength || 76 < $maxLineLength) {
29:             $maxLineLength = 76;
30:         }
31: 
32:         $remainder = 0;
33: 
34:         while (false !== $bytes = $os->read(8190)) {
35:             $encoded = base64_encode($bytes);
36:             $encodedTransformed = '';
37:             $thisMaxLineLength = $maxLineLength - $remainder - $firstLineOffset;
38: 
39:             while ($thisMaxLineLength < strlen($encoded)) {
40:                 $encodedTransformed .= substr($encoded, 0, $thisMaxLineLength) . "\r\n";
41:                 $firstLineOffset = 0;
42:                 $encoded = substr($encoded, $thisMaxLineLength);
43:                 $thisMaxLineLength = $maxLineLength;
44:                 $remainder = 0;
45:             }
46: 
47:             if (0 < $remainingLength = strlen($encoded)) {
48:                 $remainder += $remainingLength;
49:                 $encodedTransformed .= $encoded;
50:                 $encoded = null;
51:             }
52: 
53:             $is->write($encodedTransformed);
54:         }
55:     }
56: 
57:     /**
58:      * Get the name of this encoding scheme.
59:      * Returns the string 'base64'.
60:      * @return string
61:      */
62:     public function getName()
63:     {
64:         return 'base64';
65:     }
66: }
67: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen