vendor/swiftmailer/lib/classes/Swift/Encoding.php
changeset 0 7f95f8617b0b
equal deleted inserted replaced
-1:000000000000 0:7f95f8617b0b
       
     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 /**
       
    13  * Provides quick access to each encoding type.
       
    14  * 
       
    15  * @package Swift
       
    16  * @subpackage Encoder
       
    17  * @author Chris Corbyn
       
    18  */
       
    19 class Swift_Encoding
       
    20 {
       
    21   
       
    22   /**
       
    23    * Get the Encoder that provides 7-bit encoding.
       
    24    * 
       
    25    * @return Swift_Mime_ContentEncoder
       
    26    */
       
    27   public static function get7BitEncoding()
       
    28   {
       
    29     return self::_lookup('mime.7bitcontentencoder');
       
    30   }
       
    31   
       
    32   /**
       
    33    * Get the Encoder that provides 8-bit encoding.
       
    34    * 
       
    35    * @return Swift_Mime_ContentEncoder
       
    36    */
       
    37   public static function get8BitEncoding()
       
    38   {
       
    39     return self::_lookup('mime.8bitcontentencoder');
       
    40   }
       
    41   
       
    42   /**
       
    43    * Get the Encoder that provides Quoted-Printable (QP) encoding.
       
    44    * 
       
    45    * @return Swift_Mime_ContentEncoder
       
    46    */
       
    47   public static function getQpEncoding()
       
    48   {
       
    49     return self::_lookup('mime.qpcontentencoder');
       
    50   }
       
    51   
       
    52   /**
       
    53    * Get the Encoder that provides Base64 encoding.
       
    54    * 
       
    55    * @return Swift_Mime_ContentEncoder
       
    56    */
       
    57   public static function getBase64Encoding()
       
    58   {
       
    59     return self::_lookup('mime.base64contentencoder');
       
    60   }
       
    61   
       
    62   // -- Private Static Methods
       
    63   
       
    64   private static function _lookup($key)
       
    65   {
       
    66     return Swift_DependencyContainer::getInstance()->lookup($key);
       
    67   }
       
    68   
       
    69 }